第15章自然言語処理:事前学習
15.5.3. Interpreting GloVe from the Ratio of Co-occurrence Probabilities15.5.3 共起確率の比からGloVeを解釈する
We can also interpret the GloVe model from another perspective. Using the same notation in Section 15.5.1, let be the conditional probability of generating the context word given as the center word in the corpus.
tab_glove lists several co-occurrence probabilities given words “ice” and “steam” and their ratios based on statistics from a large corpus.英語のヒント
GloVeモデルは別の視点からも解釈できる。15.5.1節と同じ記法を使い、コーパスの中でを中心語として与えたときに文脈語を生成する条件付き確率をとする。
tab_gloveは、大きなコーパスの統計にもとづいて、単語「ice」と「steam」が与えられたときのいくつかの共起確率とその比を挙げている。:Word-word co-occurrence probabilities and their ratios from a large corpus (adapted from Table 1 in Pennington et al. (2014))
英語のヒント
:大きなコーパスから得た単語どうしの共起確率とその比(Pennington et al.(2014)の表1をもとに改変)
| = | solidsolid(固体) | gasgas(気体) | waterwater(水) | fashionfashion(ファッション) |
|---|---|---|---|---|
| 0.00019 | 0.000066 | 0.003 | 0.000017 | |
| 0.000022 | 0.00078 | 0.0022 | 0.000018 | |
| 8.9 | 0.085 | 1.36 | 0.96 |
We can observe the following from
tab_glove:英語のヒント
tab_gloveから次のことが見てとれる。- For a word that is related to “ice” but unrelated to “steam”, such as , we expect a larger ratio of co-occurence probabilities, such as 8.9.
英語のヒント
のように、「ice」に関係があり「steam」には関係のない単語については、8.9のような、より大きな共起確率の比が予想される。 - For a word that is related to “steam” but unrelated to “ice”, such as , we expect a smaller ratio of co-occurence probabilities, such as 0.085.
英語のヒント
のように、「steam」に関係があり「ice」には関係のない単語については、0.085のような、より小さな共起確率の比が予想される。 - For a word that is related to both “ice” and “steam”, such as , we expect a ratio of co-occurence probabilities that is close to 1, such as 1.36.
英語のヒント
のように、「ice」とも「steam」とも関係のある単語については、1.36のような、1に近い共起確率の比が予想される。 - For a word that is unrelated to both “ice” and “steam”, such as , we expect a ratio of co-occurence probabilities that is close to 1, such as 0.96.
英語のヒント
のように、「ice」とも「steam」とも関係のない単語については、0.96のような、1に近い共起確率の比が予想される。
It can be seen that the ratio of co-occurrence probabilities can intuitively express the relationship between words. Thus, we can design a function of three word vectors to fit this ratio. For the ratio of co-occurrence probabilities with being the center word and and being the context words, we want to fit this ratio using some function :
英語のヒント
共起確率の比は、単語の間の関係を直観的に表せることがわかる。そこで、この比に当てはめるために、三つの単語ベクトルの関数を設計できる。を中心語、とを文脈語とする共起確率の比について、ある関数を使ってこの比に当てはめたい。
(15.5.5)
Among many possible designs for , we only pick a reasonable choice in the following. Since the ratio of co-occurrence probabilities is a scalar, we require that be a scalar function, such as . Switching word indices and in (15.5.5), it must hold that , so one possibility is , i.e.,
英語のヒント
として考えられる多くの設計の中から、以下では妥当な選び方を一つだけとる。共起確率の比はスカラーなので、はのようなスカラー関数であることを求める。(15.5.5)で単語のインデックスとを入れ替えると、が成り立たなければならないので、一つの可能性は、つまり次のようにすることである。
(15.5.6)
Now let’s pick , where is a constant. Since , after taking the logarithm on both sides we get . We may use additional bias terms to fit , such as the center word bias and the context word bias :
英語のヒント
ここで、を定数としてを選ぼう。なので、両辺の対数をとるとが得られる。に当てはめるために、中心語のバイアスや文脈語のバイアスのような、追加のバイアス項を使ってよい。
(15.5.7)