• No results found

Nonlocal Language Modeling based on Context Co occurrence Vectors

N/A
N/A
Protected

Academic year: 2020

Share "Nonlocal Language Modeling based on Context Co occurrence Vectors"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

N o n l o c a l Language M o d e l i n g

based on C o n t e x t Co-occurrence Vectors

S a d a o K u r o h a s h i a n d M a n a b u O r i G r a d u a t e School of Informatics

K y o t o University

Yoshida-honmachi, Sakyo; Kyoto, 606-8501 J a p a n kuro@±, k y 0 t o - u , a c . j p , o r i O p i n e , k u e e . k y o t o - u , a c . j p

A b s t r a c t

This paper presents a novel nonlocal lmlguage model which utilizes contextual information. A reduced vector space model calculated from co-occurrences of word pairs provides word co-occurrence vectors. The sum of word co- occurrence vectors represents tile context of a document, and the cosine similarity between the context vector and the word co-occurrence vectors represents the ]ong-distmlce lexical de- pendencies. Experiments on the Mainichi Newspaper corpus show significant improve- ment in perplexity (5.070 overall and 27.2% on target vocabulary)

1 I n t r o d u c t i o n

Human pattern recognition rarely handles iso- lated or independent objects. We recog- nize objects in various spatiotemporal circum- stances such as an object in a scene, a word in an uttermlce. These circumstances work as conditions, eliminating ambiguities and en- abling robust recognition. The most challeng- ing topics in machine pattern recognition are in what representation and to what extent those circumstances are utilized.

In laalguage processing, a c o n t e x t - - t h a t is; a portion of the utterance or the text before the object--is ml important circumstmlce. One way of representing a context is statis- tical language nmdels which provide a word sequence probability, P(w~), where w~ de- notes the sequence w i . . . w j . In other words, they provide the conditional probability of a word given with the previous word sequence, P( wilw~-l ), which shows the prediction of a word in a given context.

The most conmmn laalguage models used nowadays are N-granl models based on a ( N - 1)-th order Markov process: event pre- dictions depend on at most ( N - 1) previous events. Therefore, they offer the following ap-

proximation:

P(w.ilw -1)

wiJwi_N+l)

(I)

A common value for N is 2 (bigram language model) or 3 (trigram language model); only a short local context of one or two words is considered.

Even such a local context is effective in some cases. For example, in Japanese, after the word kokumu 'state affairs', words such as daijin 'minister' mad shou 'department' likely follow; kaijin 'monster' and shou 'priZe' do not. After dake de 'only at', you cml often find wa (topic-marker), but you hardly find ga (nominative-marker) or wo (accusative- marker). These examples show behaviors of compound nouns and function word sequences are well handled by bigram mad trigraan mod- els. These models are exploited in several ap- plications such as speech recognition, optical character recognition and nmrphological anal- ysis.

Local language models, however, cannot predict nmch in some cases. For instance, the word probability distribution after de wa 'at (topic-marker)' is very flat. However, even if the probability distribution is flat in local lan- guage models, t h e probability of daijin 'min- ister' and kaijin 'monster' must be very differ- ent in documents concenfing politics. Bigram and trigram models are obviously powerless to such kind of nonlocal, long-distmlce lexical dependencies.

(2)

Wl W2 w3 w4 w5 w6

D1 D2 D3 D4 D~ D6 D7 Ds

1 0 1 0 1 0 1 0

1 O 1 1 0 0 0 0

0 1 0 0 1 1 0 1

1 1 1 0 0 0 0 0

0 0 0 O 1 0 1 0

0 0 0 0 1 0 0 1

Wl w2 w3 w4 w5 w6

Wl W2 w3 W4 w5 w 6

4 2 1 2 2 1

3 0 2 0 0

4 1 1 2

3 0 0

2 1

2

Figure 1: V~rord-document co-occurrence ma- trix.

representation of word co-occurrence informa- tion; and show t h a t t h e context can b e repre- sented as a sum of word co-occurrence vectors in a d o c m n e n t and it is i n c o r p o r a t e d in a non- local language model.

2 W o r d C o - o c c u r r e n c e V e c t o r

2.1 W o r d - D o c u m e n t C o - o c c u r r e n c e M a t r i x

Word co-occurrences are directly represented in a m a t r i x whose rows correspond to words and whose columns correspond to d o c u m e n t s (e.g. a newspaper article). T h e element of the m a t r i x is 1 if t h e word of the row ap- pears in the d o c u m e n t of the colunm (Figure 1). Wre call such a m a t r i x a word-document

co-occurrence matrix.

T h e row-vectors of a w o r d - d o c u m e n t co- occurrence m a t r i x represent the co-occurrence information o f words. I f two words t e n d to ap- pear in the same documents, t h a t is: tend to co-occur, t h e i r row-vectors are similar, t h a t is, they p o i n t in sinfilar directions.

T h e more d o c u m e n t is considered, t h e more reliable and realistic t h e co-occurrence infor- mation will be. Then, t h e row size of a word- d o c u m e n t co-occurrence m a t r i x m a y become very large. Since enormous a m o u n t s o f online text are available these days, row size can be- come m o r e t h a n a million documents. Then, it is n o t practical to use a w o r d - d o c m n e n t co- occurrence m a t r i x as it is. It is necessary to reduce row size and t o simulate t h e t e n d e n c y in the original m a t r i x b y a reduced matrix.

2.2 R e d u c t i o n o f W o r d - D o c u m e n t C o - o c c u r r e n c e M a t r i x

T h e a i m of a w o r d - d o c u m e n t co-occurrence m a t r i x is t o m e a s u r e co-occurrence of two words b y t h e angle o f the two row-vectors. In t h e r e d u c t i o n of a matrix, angles of two row-vectors in the original matrLx should be m a i n t a i n e d in t h e r e d u c e d matrLx.

Figure 2: ~Vord-word co-occurrence matrix.

As such a m a t r i x reduction, we utilized a learning m e t h o d developed b y HNC Software

(Ilgen and Rushall, 1996). 1

1. Not the w o r d - d o c m n e n t co-occurrence m a t r i x is c o n s t r u c t e d from tile learning corpus, b u t a word-word co-occurrence matrix. In this matrix: the rows a n d colunms c o r r e s p o n d to words and the i- th diagonal element denotes the n u m b e r of documents in which t h e word wl ap- pears, F(wi). T h e i:j-th element denotes the n u m b e r of d o c u m e n t s in which b o t h words w,: and wj appear, F(wi, wj) (Fig- ure 2).

T h e i m p o r t m l t information in a word- d o c u m e n t co-occurrence m a t r i x is the co- sine of the angle of t h e row-vector of wi

and t h a t of wj, which can be calculated by the word-word co-occurrence m a t r i x as follows:

F(w,:, wj) (2)

This is because x/F(wi) corresponds to the m a g n i t u d e of t h e row-vector of wl, and F(wl, wi) corresponds to the d o t p r o d u c t o f t h e row-vector of wl and t h a t of wj in the w o r d - d o c m n e n t co- occurrence matrix.

2. Given a r e d u c e d row size, a m a t r i x is ini- tialized as follows: m a t r i x elements are chosen from a n o r m a l distribution ran- domly, then each row-vector is normal- ized to m a g n i t u d e 1.0. T h e r a n d o m refit row-vector of t h e word wl is d e n o t e d as

,WCi Rand.

R a n d o m unit row-vectors in high di- mensional floating p o i n t spaces have a

[image:2.596.95.316.64.152.2] [image:2.596.342.514.65.152.2]
(3)

sori wa kakugi de' kankyo mondai (Prime Minister) (Cabinet meeting) (environment) (issue)

I wc I ] wc II wc \

ni tuite

w (cc • w c ) 2 P c

kaigi (conference) 0.237962 0.002702 senkyo (election) 0.150773 0.001712 yosan (budget) 0.128907 0.001463 daijin (minister) 0.018549 0.000211 yakyu (baseball) 0.004556 0.000052

kaijin (monster) 0.000002 0.000000 sugaku (mathematics) 0.000001 0.000000

T O T A L 88.079230 1.000000

Figure 3: An example of context co-occurrence probabilities.

p r o p e r t y that is referred to a "qnasi- o r t h o g o n a l i t y ' . T h a t is; the expected ~¢alue of the dot p r o d u c t between an3" pair of random row-vectors, w c i Rand a n d

w e t and, is approximately equal to zero (i.e. all vectors are approximately or- thogonal).

3. The trained row-vector, w a i is calculated as follows:

W C i -~ ~13C~ and + "q ~ O'ij'T.ll4 and

J (3)

wc -

(4)

The p r o c e d u r e iterates the following calcu- lation:

O J w e n e~' = w c l - q O w e /

= + rl (a j - w e ~ . wcj)wc

(6)

new -- W C7 e~:

ilwcF wl I

(7)

The learning m e t h o d b y H N C is a rather simple approximation o f the procedure, doing j u s t one step of it. N o t e t h a t w c i . w c j is approximately zero for the initialized random vectors.

a i j corresponds to the degree of the co- occurrence of two words. By adding

w c ~ and to w e t a'd depending on a i j , th.e learning formula (3) achieves t h a t two words that, tend to co-occur will have trained vectors t h a t point in shnilar di- rections, r/is a design p a r a m e t e r chosen to optimize performance. The formula (4) is to normalize vectors to magnitude 1.0.

We call the trained row-vector w e / o f the word wi a w o r d co-occurrence vector.

The background of the above m e t h o d is a stochastic gradient descent procedure for min- imizing the cost function:

1

J = ~ . ~ ( a i j -- w e / " w c j ) 2 (5) %3

subject to the constraints [[we/I[ = 1.

3 C o n t e x t C o - o c c u r r e n c e V e c t o r The next question is how to represent the context of a d o c u m e n t based on word co- occurrence vectors. W e p r o p o s e a simple model which represents the c o n t e x t as the sum of the word co-occurrence vectors associated with content words ill a d o c u m e n t so far. It should b e noted t h a t t h e vector is normalized to unit length. V~re call the resulting vector a

c o n t e x t co-occurrence vector.

W'ord co-occurrence vectors have the prop- e r t y t h a t words which t e n d to co-occur have vectors that. point in similar directions. Con- text co-occurrence vectors are expected to have t h e sinfilar property. T h a t is, if a word tends to a p p e a r in a given context, the word co-occurrence vector of the word and the con- text co-occurrence vector of t h e context will point in similar directions . . .

[image:3.596.111.546.71.229.2]
(4)

where

p(.wdwi_,) = ( P(C~lwi-' ) x P(wdw~-'Cc)

P(Cflwj-') x P(wdw~-lc/)

(

if wl E C~ if wi E C /

P(C~Iw~ -1)

P(wilw~-:C~)

P(wi[w -lc/)

= A:P(Cc) + A2P(C~lwi_l ) + A3P(C~[wi-2wi-1)

= AclP(wiICc) + A~2P(wi[wi-lC~) + A~3P(wi[wi-2Wi-lCc)

= 1 - P ( C ~ l w j - : )

= a / : P ( w d c / ) +

a/2P(wd, -:ci) +

with

Figure 4: Context language model. given context, mad is utilized as a component

of statistical language modeling, as shown in the next section.

4

Language M o d e l i n g using

C o n t e x t C o - o c c u r r e n c e V e c t o r

4.1

Context Co-occurrence

P r o b a b i l i t y

The dot product of a context co-occurrence vector and a word co-occurrence vector shows the degree of affinity of the context m:d the word. The probability of a content word based on such dot products, called a

context co-

occurrence probability,

can b e calculated as follows:

Pc(wilw~_lcc)

= f(cc~ -1

"~cl)

~wjEcc f(cc~ -1" ~vcj)

(S) where

cc~ -1

denotes the context co-occurrence vector of the left context, Wl . . . wi-1, and

Cc

denotes a content word class.

Pc(wilw~-lcc)

metals the conditional probability of wi given that a content word follows w j - : .

One choice for the function .f(x) is the iden- tity. However, a linear contribution of dot p r o d u c t s to the probability results in poorer estimates, since the differences of dot prod- ucts of related words (tend to co-occur) and unrelated words are not so large. Experiments showed that x 2 or x 3 is a b e t t e r estimate.

An example of context co-occurrence prob- abilities is shown in Figure 3.

4.2 L a n g u a g e

Modeling using Context

Co-occurrence

P r o b a b i l i t y

Context co-occurrence probabilities can h a m dle long-distance lexical dependencies while a standard trigram model can handle local con- texts more clearly: in this way they comple- ment each other. Therefore, language model- ing of their linear interpolation is employed. Note that tile linear interpolation of unigram, bigram and trigram models is simply referred to 'trigxan: model' in this paper.

The proposed language model, called a

con-

text language model,

computes probabilities as shown in Figure 4. Since context co- occurrence probabilities are considered only for content words

(Cc),

probabilities are cal- culated separately for content words

(Co)

and function words (C/).

P(Cc[w~ -1)

denotes the probability t h a t a content word follows w~-:, which is approx- imated by a trigrmn nmdel.

P(.wi[w~-lcc)

denotes the probability t h a t

wi

follows w~-: given that a content word follows w~-:, which is a linear interpolation of a standard trigram model and the context co-occurrence proba- bilities.

In the case of a function word, since the context co-occurrence probability is not con- sidered,

P(wdw~-lCi)

is j u s t a standard tri- granl model.

(5)

Table 1: Perplexity results for the stmldard trigrazn model and the context language nmdel. Perplexity on Perplexity on

Language Model the entire the target

vocabulary vocabulary

Standard Trigram Model 107.7 1930.2

Context Language Model Vector size 0

f ( x )

500 0.5 x ~

1000 0.3 x ~

1000 0.5 x

* 1000 0.5 x 2

1000 0.5 x 3

1000 1.0 x 2

2000 0.5 x 2

106.3 (-1.3%) ~o 102.7 (-4., %) 103.6 (-3.9%) 102.4 (-5.0%)

102.4 (-5.0%)

102.5 (-4.8%) 102.4 (-5.0%)

1663.8 (-13.8%) 1495.9 (-22.5%) 1496.1 (-22.5%) 1406.2 (-27.2%) 1416.8 (-26.9%) 1430.3 (-25.9%) 1408.1 (-27.1%)

Standard Bigram Model 130.28 2719.67

Context Language Model

125.06 (-4.0%)

122.85 (-5.7%)

1000 0.5 x

1000 0.5 x 2

2075.10 (-23.7%) 1933.68 (-28.9%)

shijyo no ~

wo

~

ni

Wall-gai ga kakkyou wo teishi,

bei kabushiki

'US' 'stock' 'market' 'sudden rise' 'background' %Vall Street' 'activity' 'show'

wagayonoharu wo ~ a ~ shire iru. [shoukenl kaisha,

~ h ~

ginkou wa 1996 nen ni

'prosperity' 'enjoy' 'do' 'stock' 'company' 'investment' 'bank' 'year'

halite

ka o saiko

l ko shi ]

'96 ne,

I k b shiki l so.ha

'95

'enter' 'past' 'maximum' 'profit' 'renew' 'year'

ni I .tsuzuki]

kyushin .

mata ] kab.uka]

kyushin

wo

'continue' 'rapid increase' 'stock price' 'rapidly increase'

I shinkabul hakkou ga ~

saikou

to natta.

'new stock' 'issue' 'past' 'maximum' 'become'

'stock' 'market' 'year'

ni ~ u ~

no

'background' 'corporation'

Figure 5: Comparison of probabilities of content words by the trigraan model and the context model. (Note that

wa, ga, wo, ni; to

and

no

are Japanese postpositions.)

4 . 3 T e s t S e t P e r p l e x i t y

By using the Mainichi Newspaper corpus (from 1991 to 1997, 440,000 articles), test set perplexities of a standard trigrmn/bigram model and the proposed context language model are compared. The articles of six years were used for the leanfing of word co- occurrence vectors, unigrams, bigrmns and trigrams; the articles of half a year were used as a held-out data for EM re-estimation of A's; the remaining articles (half a year) for com- puting test set perplexities.

Word co-occurrence vectors were computed for the top 50,000 frequent content words (ex- cluding pronouns, numerals, temporal nouns, mad light verbs) in the corpus, and unigrmn: bigrmn and trigrmn were computed for the top

60,000 frequent words.

The upper part of Table 1 shows t h e c o m - parison results of the stmldard trigram model and the context language model. For the best parameters (marked by *), the overall per- plexity decreased 5.0% and the perplexity on target vocabulary (50,000 content words) de- creased 27.270 relative to the standard trigram model. For the best parameters, A's were adapted as follows:

A1 = 0.08, A2 = 0.50, A3 = 0.42

Acl = 0.03, ~c2 = 0.50, Xc3 = 0.30,

Xcc =

0.17 Afl = 0.06, ~f2 = 0.57, A f3 = 0.37

[image:5.596.76.557.84.477.2]
(6)

f ( x ) = x 2 and f ( x ) = x 3 are alnmst the same; better thaaa f ( x ) = x.

The lower part of Table 1 shows the compar- ison results of the s t a n d a r d bigram model and the context language model. Here, the context language model is based on the bigrana model, that is, the terms concerning trigrmn in Fig- ure 4 were eliminated. The result was similar, but the perplexity decreased a bit more; 5.7% overall and 28.9% on target vocabulary.

Figure 5 shows a test article in which the probabilities of content words by the trigram lnodel aald the context model are compared. If that b y the context model is bigger (i.e. the context model predicts better), the word is boxed; if not, the word is underlined.

The figure shows t h a t the context model usually performs b e t t e r after a function word, where the trigram model usually has little pre- diction. On the other hand, the trigram model performs b e t t e r after a content word (i.e. in a compound noun) because a clear prediction by the trigram model is reduced b y paying attention to the relatively vague context co- occurrence probability (Acc is 0.17).

The proposed model is a constant interpo- lation of a trigram model and the context co- .0ccurrence probabilities. More adaptive inter- polation depending on the N - g r a m probabil- ity distribution m a y improve the performance. 5 R e l a t e d W o r k

Cache language models (Kuhn mad de Mori, 1990) boost the probability of the words al- ready seen in the history.

Trigger models (Lau et al., 1993), even more general, try to capture the co-occurrences be- tween words. While the basic idea of our model is similar to trigger models, t h e y handle co-occurrences of word pairs independently and do not use a representation of the whole context. This omission is also done in ap- plications such as word sense dismnbiguation (Yarowsky: 1994; F U N G et al., 1999).

Our model is the most related to Coccaro mad Jurafsky (1998), in that a reduced vec- tor space approach was taken and context is represented by the accumulation of word co- occurrence vectors. Their model was reported to decrease the test set perplexity b y 12%, compared to the bigram nmdel. The major differences are:

1. SVD (Singular Value Decomposition) was used to reduce the matrix which is

common in the L a t e n t Semaaltic Analysis (Deerwester et ai.; 1990), and

2. context co-occurrence probabilities were computed for all words, and the degree of combination of context co-occurrence probabilities and N - g r a m probabilities was c o m p u t e d for each word, depending on its distribution over the set of docu- l n e n t s .

As for the first point, we utilized the computationally-light, iteration-based proce- dure. One reason for this is that the com- putational cost of SVD is very high when millions or more d o c u m e n t s are processed. Furthermore, considering an extension of our nmdel with a cognitive viewpoint, we believe an iteration-based model seems more reason- able than an algebraic model such as SVD.

As for the second point, we doubt the ap- propriateness to use the word's distribution as a measure of combination of two models. W h a t we need to do is to distinguish words to which semantics should be considered and other words. We judged the distinction of con- tent words and function words is good enough for that purpose, and developed their trigram- based distinction as shown in Figure 4.

Several topic-based models have been pro- posed based on the observation that certain words tend to have different probability dis- tributions in different topics. For example, Florian and Yarowsky (1999) proposed the fol- lowing model:

t

(9)

where t denotes a topic id. Topics are obtained b y hierarchical clustering from a training corpus, and a topic-specific language model, Pt, is learned from t h e clustered docu- ments. Reductions in perplexity relative to a bigrmn model were 10.5% for the entire text and 33.5% for the target vocabulary.

(7)

6

C o n c l u s i o n

In this paper we described a novel language model of incorporating long-distance lexical dependencies based on context co-occurrence vectors. R e d u c e d vector representation of word co-occurrences enables rather simple b u t effective representation of the context. Sig- nificant reductions in perplexity are obtained relative to a staaldard trigram model: both on the entire text. (5.0~) and on the target vo- cabulary (27.2%).

A c k n o w l e d g m e n t s

The research described in this paper was sup- ported in part. b y J S P S - R F T F 9 6 P 0 0 5 0 2 (The J a p a n Society for the P r o m o t i o n of Science, Research for the F u t u r e Program).

R e f e r e n c e s

Noah Coccaxo and Daniel Jurafsky. 1998. To- wards better integration of semantic predictors in statistical language modeling. In Proceedings of ICSLP-98, volume 6, pages 2403-2406. Scott Deem, ester, Susan T. Dumais, George W.

Furnas, Thomas K. Landauer, and Richard Harshmaa~. 1990. Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6):391-407.

Radu Florian and David Yarowsky. 1999. Dy- namic nonlocal language modefing via hierar- chical topic-based adaptation. In Proceedings off

the 37rd Annual Meeting of ACL, pages 167- 174.

Pascale FUNG, LIU Xiaohu, mad CHEUNG Chi Shun. 1999. Mixed language query disambigua- tion. In Proceedings of the 37rd Annual Meeting

of A CL, pages 333-340.

Maa'd R. Ilgen and David A. Rushall. 1996. Re- cent advances in HNC's context vector informa- tion retrieval technology. In TIPSTER PRO-

GRAM PHASE II, pages 149--158.

R. Kuhn and IL de Mori. 1990. A cache-based natural language model for speech recognition.

IEEE Transactions on Pattern Analysis and Machine Intelligence, 12(6):570-583.

R. Lau, Ronald Rosenfeld, and Safim Roukos. 1993. Trigger based language models: a max- imum entropy approach. In Proceedings of ICASSP, pages 45-48.

Figure

Figure 1: V~rord-document co-occurrence ma- trix.
Figure 3: An example of context co-occurrence probabilities.
Table 1: Perplexity results for the stmldard trigrazn model and the context language nmdel

References

Related documents

When assessing controls at a service organization that may be relevant to and affect the services provided to user entities, management of a user entity may ask the service

By comparing simulation results for the circular and square shaped coils, it was revealed that the mutual inductance between the transmitters and receiver is slightly higher in case

Section 1: The Challenge of Entrepreneurship Section 2: Building a Business Plan:. Beginning Considerations Section 3: Building a

The limited amount of physical memory per core puts a severe pressure on application datasets. Hence libraries used by the processes should try to reduce their own memory footprint

IF YOU DO NOT AGREE TO THESE TERMS AND CONDITIONS, CLICK THE “CANCEL” OR “NO” OR “CLOSE WINDOW” BUTTON OR OTHERWISE INDICATE REFUSAL, MAKE NO FURTHER USE OF THE SOFTWARE,

Positive learning-related emotions like pride, hope, and enjoyment can enhance the students’ both intrinsic and extrinsic motivation to learn, that is based on curiosity

Apart from credit availability, several other factors contributed ceteris pan bus to a decline in Mexico’s differential saving performance between the early 1980s and early 1990s:

One last possible neighborhood effect that has  rarely been  explored  is that urban renewal  could  reduce  the  redevelopment  option  value  of  buildings  outside