JP6586026B2 - Word vector learning device, natural language processing device, method, and program - Google Patents

Word vector learning device, natural language processing device, method, and program Download PDF

Info

Publication number
JP6586026B2
JP6586026B2 JP2016025130A JP2016025130A JP6586026B2 JP 6586026 B2 JP6586026 B2 JP 6586026B2 JP 2016025130 A JP2016025130 A JP 2016025130A JP 2016025130 A JP2016025130 A JP 2016025130A JP 6586026 B2 JP6586026 B2 JP 6586026B2
Authority
JP
Japan
Prior art keywords
word
vector
context
word vector
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016025130A
Other languages
Japanese (ja)
Other versions
JP2017142746A (en
Inventor
鈴木 潤
潤 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2016025130A priority Critical patent/JP6586026B2/en
Publication of JP2017142746A publication Critical patent/JP2017142746A/en
Application granted granted Critical
Publication of JP6586026B2 publication Critical patent/JP6586026B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Machine Translation (AREA)

Description

本発明は、単語ベクトル学習装置、自然言語処理装置、方法、及びプログラムに係り、特に、単語に関する単語ベクトルを学習する単語ベクトル学習装置、自然言語処理装置、方法、及びプログラムに関する。   The present invention relates to a word vector learning device, a natural language processing device, a method, and a program, and more particularly, to a word vector learning device, a natural language processing device, a method, and a program for learning a word vector related to a word.

個々の単語は離散シンボルであり、かつ物理現象などに基づくものでもないことから、単語間の類似度を定量的に表現するのはそれほど単純ではない。比較として、例えば音声は、計算機上では一般的に周波数の時系列データとして捉えられる。よって、任意の音声区間同士の類似度は、周波数から算出できる様々な特徴量(連続値)をベクトル化したものの間で距離を計算することで、ある程度計測することができる。同様に、画像間の類似度も画素情報を特徴量としてベクトル化したものの間で距離を計算することである程度容易に計算できる。このように、波形であったり色彩であったり物理的な現象を基とするものの間の類似度は、計算機上でも比較的自然に扱うことが可能であるが、言語のような離散的なシンボルで記述された物理現象にも則さないものの間の類似度は、計算機上で単純には扱えない。このような背景から、単語のような離散シンボル間の類似度を計算するために、これまで様々な方法論が考案されている。そのひとつに分散意味表現という方法がある。これは、音声や画像と同様に、各単語に一つのベクトルを割り振り、そのベクトル間の距離をもって単語間の意味的な類似度を表現しようと試みる方法である。ベクトル空間内の距離計算で単語間の意味的な近さを表現するので、計算機にとっては非常に親和性が高い方法と言える。   Since each word is a discrete symbol and not based on a physical phenomenon or the like, it is not so simple to quantitatively express the similarity between words. For comparison, for example, voice is generally regarded as time-series data of frequency on a computer. Therefore, the similarity between arbitrary speech sections can be measured to some extent by calculating the distance between the vectorization of various feature quantities (continuous values) that can be calculated from the frequency. Similarly, similarity between images can be easily calculated to some extent by calculating a distance between pixel information vectorized as feature amounts. In this way, the similarity between waveforms, colors, and those based on physical phenomena can be handled relatively naturally on a computer, but discrete symbols such as languages can be used. The similarity between things that do not conform to the physical phenomenon described in (1) cannot simply be handled on a computer. From this background, various methodologies have been devised so far to calculate the similarity between discrete symbols such as words. One of them is a distributed semantic expression method. This is a method of allocating one vector to each word and trying to express the semantic similarity between words with the distance between the vectors, as in the case of speech and images. It can be said that this method has a very high affinity for computers because it expresses the semantic proximity between words by calculating the distance in the vector space.

図8に分散意味表現による単語間の類似度の概要を示す。   FIG. 8 shows an outline of the similarity between words by the distributed semantic expression.

ここでは、i番目の単語をwと表す。また、i番目の単語wに割り当てられたベクトルをrで表す。以降、単語に割り振られたベクトルのことを特別に「単語ベクトル」と呼ぶこととする。つまり、単語wの単語ベクトルはrである。この時、計算機上の計算としては、二つの単語wとw間の類似度は、w、wの単語ベクトル間の内積、或いは、コサイン距離により定義するのが一般的である。 Here, the i-th word is represented as w i . Also, the vector assigned to the i-th word w i is denoted by r i . Hereinafter, a vector assigned to a word is specifically referred to as a “word vector”. That is, the word vector of word w i is r i . At this time, as a calculation on a computer, the similarity between two words w i and w j is generally defined by an inner product between word vectors of w i and w j or a cosine distance.

この場合、値が大きければ大きいほど単語wとwは似ているということを意味する。これによって、翻訳、対話、文書要約、文書校正といった言語処理の様々なアプリケーションの中で意味的に類似性がある単語を処理の中で扱えるようになる利点がある。結果として、単語間の意味的な近さを用いない処理方式より良い結果が得られることが示されている。 In this case, the larger the value, the more similar the words w i and w j are. This has the advantage that words that are semantically similar can be handled during processing in various applications of language processing such as translation, dialogue, document summarization, and document proofreading. As a result, it is shown that better results can be obtained than a processing method that does not use semantic proximity between words.

ここで、各単語の単語ベクトルの獲得方法には、これまで多くの方法が提案されている。基本的な方法論としては、まず文章内の各単語に対して、その単語の文脈情報を定義する。文脈情報に特に規定はなく様々な情報を用いることができるが、最も単純には各単語の周辺に出現する単語を文脈情報として扱う場合がほとんどである。文脈の定義を変更しても、単語ベクトルの推定アルゴリズムそのものにはあまり影響を与えない。よって、以降の議論では、単語の文脈情報としては、周辺に出現する単語とする。   Here, many methods have been proposed for acquiring word vectors for each word. As a basic methodology, first, for each word in a sentence, the context information of that word is defined. There are no specific rules for the context information and various information can be used, but most simply, the words appearing around each word are mostly handled as context information. Changing the context definition does not significantly affect the word vector estimation algorithm itself. Therefore, in the following discussion, the word context information is a word that appears in the vicinity.

近年では、webから得られるような大規模なデータにも対応できるほど高速に処理可能な方法が主流となっている(非特許文献1及び非特許文献2参照)。大規模データが扱える手法が主流な理由は、データが多ければ多いほど、言語事象を的確に捉えることが可能となるため、類似度の推定精度が向上することが理論的にも期待できるからである。ここでは従来方式の代表として、非特許文献2に即した単語ベクトルの獲得方法を述べる。   In recent years, methods that can be processed at such a high speed as to be able to deal with large-scale data obtained from web have become mainstream (see Non-Patent Document 1 and Non-Patent Document 2). The reason why the method that can handle large-scale data is the main reason is that the more data there is, the more accurately the language event can be captured, so it can be theoretically expected that the estimation accuracy of similarity will be improved. is there. Here, as a representative of the conventional method, a method for acquiring a word vector according to Non-Patent Document 2 will be described.

この方式では、単語がある単語の文脈として出現した場合を表現するために、各単語に単語ベクトルとは別のもう一つのベクトルを割り当てる。これを単語ベクトルと対比して便宜上「文脈ベクトル」と呼ぶ。つまり、i番目の単語wは、単語ベクトルrと文脈ベクトルcの二つのベクトルを持つ。語彙数Vとする。この時に、(ri=1 を全ての単語ベクトルをi=1からVまで順番に並べたベクトルのリストとする。同様に、(ci=1 を全ての文脈ベクトルをi=1からVまで順番に並べたベクトルのリストとする。表記を簡単にするためR=(ri=1 、C=(ci=1 とする。また、i番目の単語に対してj番目の単語が文脈となった回数をXi,jとする。この時、非特許文献2に即した分散意味表現の獲得には以下の目的関数を最小化する問題で定式化できる。 In this method, in order to express a case where a word appears as the context of a certain word, another vector different from the word vector is assigned to each word. For convenience, this is called a “context vector” in contrast to the word vector. That is, the i-th word w i has two vectors, a word vector r i and a context vector c i . The vocabulary number is V. At this time, let (r i ) i = 1 V be a vector list in which all word vectors are arranged in order from i = 1 to V. Similarly, (c i ) i = 1 V is a list of vectors in which all context vectors are arranged in order from i = 1 to V. In order to simplify the notation, R = (r i ) i = 1 V and C = (c i ) i = 1 V. Further, the number of times that the j-th word becomes a context with respect to the i-th word is X i, j . At this time, the acquisition of the distributed semantic expression according to Non-Patent Document 2 can be formulated by the problem of minimizing the following objective function.

ただし、^R=(^ri=1 および^C=(^ci=1 は、単語ベクトルおよび文脈ベクトルの推定結果を表す。また、φは重み係数をXi,jから計算するための関数である。 However, {circumflex over (R)} (^ r i ) i = 1 V and {circumflex over (C)} (^ c i ) i = 1 V represent estimation results of word vectors and context vectors. Φ is a function for calculating a weighting factor from X i, j .

最終的に得られた^rがi番目の単語の単語ベクトルである。これが、(2)式の類似度計算などで用いられる単語ベクトルとなる。また、翻訳、文書校正といった自然言語処理の応用アプリケーションで利用される。 Finally obtained ^ r i is a word vector of the i-th word. This is a word vector used in the similarity calculation of equation (2). It is also used in natural language processing application applications such as translation and document proofreading.

Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean, Efficient Estimation of Word Representations in Vector Space. Proceedings of Workshop at ICLR, 2013.Tomas Mikolov, Kai Chen, Greg Corrado, Jeffrey Dean, Efficient Estimation of Word Representations in Vector Space.Proceedings of Workshop at ICLR, 2013. Jeffrey Pennington, Richard Socher, and Christopher Manning, Glove: Global Vectors for Word Representation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP),2014.Jeffrey Pennington, Richard Socher, and Christopher Manning, Glove: Global Vectors for Word Representation.Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2014.

前述の非特許文献2のような現在主流に用いられている方法の課題は、扱う「単語数」や出力となるベクトル空間の「次元数」が大きくなると、最終的に得られる単語ベクトルの結果を保持するのに必要なメモリ量が大きい点があげられる。   The problem of the method used in the current mainstream as in Non-Patent Document 2 described above is that when the “number of words” to be handled and the “dimension number” of the output vector space are increased, the result of the word vector finally obtained The amount of memory required to hold the data is large.

ファイルサイズは、そのまま実行時のメモリ占有量と同じとなる。メモリ占有量は、携帯端末等の限定されたリソースしか持たない計算環境で、非常に大きな問題となる可能性がある。また、一般的な計算機上での実行時にも、近年のマルチコアな計算機上で同時に複数実行する際や、他のプログラムになるべく影響を与えないという観点で、メモリ占有量は極力少ないことが望まれる。   The file size is the same as the memory occupancy during execution. Memory occupancy can be a significant problem in computing environments with limited resources, such as portable terminals. In addition, even when executing on a general computer, it is desirable that the memory occupancy is as small as possible from the viewpoint of not affecting other programs as much as possible when simultaneously executing multiple on a recent multi-core computer. .

本発明は、上記問題点を解決するために成されたものであり、必要なメモリ容量を削減することができる単語ベクトルを学習することができる単語ベクトル学習装置、方法、及びプログラムを提供することを目的とする。   The present invention has been made to solve the above-described problems, and provides a word vector learning apparatus, method, and program capable of learning a word vector that can reduce a necessary memory capacity. With the goal.

また、学習された単語ベクトルを用いて、単語の意味的な類似度に基づく自然言語処理を行う自然言語処理装置、及びプログラムを提供することを目的とする。   It is another object of the present invention to provide a natural language processing apparatus and program for performing natural language processing based on the semantic similarity of words using learned word vectors.

上記目的を達成するために、第1の発明に係る単語ベクトル学習装置は、文書データに基づいて、単語の各々について、前記単語に関するD次元の単語ベクトル、及び前記単語が他の単語の文脈として出現することを表すD次元の文脈ベクトルを学習する単語ベクトル学習装置であって、前記単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、前記文書データにおいて単語ペアについて一方の単語が他方の単語の文脈として出現した回数とに基づいて、前記単語ベクトル及び文脈ベクトルの各々の各ブロックが、前記S種類の実数ベクトルの何れかとなる制約の下で、前記単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、前記単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定する学習部、を含んで構成されている。   In order to achieve the above object, the word vector learning device according to the first invention is based on document data, and for each word, a D-dimensional word vector related to the word and the word as a context of another word A word vector learning device for learning a D-dimensional context vector representing appearance, wherein each of the word vector and the context vector is divided into B blocks having a dimensionality F, Based on the set of real vectors and the number of times one word has appeared as the context of the other word for the word pair in the document data, each block of the word vector and context vector is the S types of real vectors. The objective function representing the likelihood of each block of the word vector and the context vector is optimized under any of the constraints To, and is configured to include a learning unit, which estimates the real value vector of each block of word vectors and the context vector for each of the words.

また、第1の発明に係る単語ベクトル学習装置において、前記学習部は、以下の式により表される、前記目的関数を最適化するように、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新する更新部と、予め定められた反復終了条件を満たすまで、前記更新部による更新を繰り返させる反復判定部と、を含むようにしてもよい。
ただし、Dは、文書データで出現する、前記単語と、前記単語の文脈として出現する単語とのペアの集合を表し、αi,b、βi,bは、ラグランジュ未定乗数であり、ui,b、vj,bは、次元数Fの実数ベクトルである補助パラメタであり、ρは、定数であり、ζは、次元数FのS種類の実数ベクトルの集合を表し、Xi,jは単語iに対して単語jが文脈として出現した回数を表す。
Further, in the word vector learning device according to the first invention, the learning unit represents each block r i of the word vector for each word i so as to optimize the objective function represented by the following equation: , b and the word j, an update unit that updates the real vector of each block c j, b of the context vector, and an iterative determination unit that repeats the update by the update unit until a predetermined iteration end condition is satisfied. May be included.
Here, D represents a set of pairs of the word appearing in the document data and a word appearing as the context of the word, α i, b and β i, b are Lagrange undetermined multipliers, and u i , b , v j, b are auxiliary parameters that are real vectors of dimension F, ρ is a constant, ζ represents a set of S types of real vectors of dimension F, and X i, j Represents the number of times word j appears as context with respect to word i.

第2の発明に係る自然言語処理装置は、入力された入力文書に対して、請求項1又は2記載の単語ベクトル学習装置で学習された各単語の前記単語ベクトルを用いて、前記単語ベクトルに基づく単語間の意味的な類似度に基づく自然言語処理を行う自然言語処理部、を含んで構成されている。   A natural language processing device according to a second invention uses the word vector of each word learned by the word vector learning device according to claim 1 or 2 as an input document, to the word vector. A natural language processing unit that performs natural language processing based on the semantic similarity between the words based on.

第3の発明に係る単語ベクトル学習方法は、文書データに基づいて、単語の各々について、前記単語に関するD次元の単語ベクトル、及び前記単語が他の単語の文脈として出現することを表すD次元の文脈ベクトルを学習する単語ベクトル学習装置における単語ベクトル学習方法であって、学習部が、前記単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、前記文書データにおいて単語ペアについて一方の単語が他方の単語の文脈として出現した回数とに基づいて、前記単語ベクトル及び文脈ベクトルの各々の各ブロックが、前記S種類の実数ベクトルの何れかとなる制約の下で、前記単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、前記単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定するステップ、を含んで実行することを特徴とする。   A word vector learning method according to a third aspect of the present invention is based on document data, and for each word, a D-dimensional word vector related to the word, and a D-dimensional representing that the word appears as the context of another word. A word vector learning method in a word vector learning device for learning a context vector, wherein the learning unit divides each of the word vector and the context vector into B blocks having a dimension number F, and S types having a dimension number F. Each block of the word vector and the context vector is the S types of real numbers, based on the set of real vectors and the number of times one word appears as the context of the other word in the document data. An objective function representing the likelihood of each block of each of the word vector and the context vector under the constraint of any of the vectors As optimization, and executes comprising the step of estimating a real-valued vector of each block of word vectors and the context vector for each of the words.

また、第1の発明に係る単語ベクトル学習装置において、前記学習部が推定するステップは、更新部が、以下の式により表される、前記目的関数を最適化するように、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新するステップと、反復判定部が、予め定められた反復終了条件を満たすまで、前記更新部による更新を繰り返させるステップと、を含むようにしてもよい。
ただし、Dは、文書データで出現する、前記単語と、前記単語の文脈として出現する単語とのペアの集合を表し、αi,b、βi,bは、ラグランジュ未定乗数であり、ui,b、vj,bは、次元数Fの実数ベクトルである補助パラメタであり、ρは、定数であり、ζは、次元数FのS種類の実数ベクトルの集合を表し、Xi,jは単語iに対して単語jが文脈として出現した回数を表す。
Also, in the word vector learning device according to the first invention, the step of estimating by the learning unit is performed for each word i so that the update unit optimizes the objective function represented by the following equation: Updating the real vector of each block c j, b of the context vector for each block r i, b and word j of the word vector until the iteration determination unit satisfies a predetermined iteration termination condition And repeating the updating by the updating unit.
Here, D represents a set of pairs of the word appearing in the document data and a word appearing as the context of the word, α i, b and β i, b are Lagrange undetermined multipliers, and u i , b , v j, b are auxiliary parameters that are real vectors of dimension F, ρ is a constant, ζ represents a set of S types of real vectors of dimension F, and X i, j Represents the number of times word j appears as context with respect to word i.

第4の発明に係る自然言語処理装置は、自然言語処理部が、入力された入力文書に対して、請求項4又は5記載の単語ベクトル学習装置で学習された各単語の前記単語ベクトルを用いて、前記単語ベクトルに基づく単語間の意味的な類似度に基づく自然言語処理を行うステップを含んで実行することを特徴とする。   In the natural language processing device according to the fourth invention, the natural language processing unit uses the word vector of each word learned by the word vector learning device according to claim 4 or 5 for the inputted input document. And performing a natural language process based on a semantic similarity between words based on the word vector.

また、第5の発明に係るプログラムは、コンピュータを、第1の発明に係る単語ベクトル学習装置、又は第2の発明に係る自然言語処理装置を構成する各部として機能させるためのプログラムである。   A program according to the fifth invention is a program for causing a computer to function as each part constituting the word vector learning device according to the first invention or the natural language processing device according to the second invention.

本発明の単語ベクトル学習装置、方法、及びプログラムによれば、単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、一方の単語が他方の単語の文脈として出現した回数とに基づいて、各ブロックが、S種類の実数ベクトルの何れかとなる制約の下で、単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定することにより、必要なメモリ容量を削減することができる単語ベクトルを学習することができる、という効果が得られる。   According to the word vector learning device, method, and program of the present invention, each of the word vector and the context vector is divided into B blocks having the dimension number F, and a set of S kinds of real vectors having the dimension number F; Based on the number of times one word has appeared as the context of the other word, the likelihood of each block of each of the word vector and the context vector is determined under the constraint that each block is one of S types of real vectors. Learning word vectors that can reduce the required memory capacity by estimating the real-valued vector of each block of word vectors and context vectors for each word so as to optimize the objective function to represent The effect of being able to be obtained is obtained.

また、本発明の自然言語処理装置、及びプログラムによれば、学習された単語ベクトルを用いて、単語の意味的な類似度に基づく自然言語処理を行うことができる、という効果が得られる。   In addition, according to the natural language processing apparatus and the program of the present invention, it is possible to perform natural language processing based on the semantic similarity of words using a learned word vector.

単語リスト及び文脈の共起情報の例を示す図である。It is a figure which shows the example of the word list and context co-occurrence information. 単語ベクトルの一例を示す図である。It is a figure which shows an example of a word vector. 本発明の実施の形態に係る単語ベクトル学習装置の構成を示すブロック図である。It is a block diagram which shows the structure of the word vector learning apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係る単語ベクトル学習装置の構成を示すブロック図である。It is a block diagram which shows the structure of the word vector learning apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係る単語ベクトル学習装置における単語ベクトル学習処理ルーチンを示すフローチャートである。It is a flowchart which shows the word vector learning process routine in the word vector learning apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係る単語ベクトル学習装置におけるベクトル更新処理ルーチンを示すフローチャートである。It is a flowchart which shows the vector update process routine in the word vector learning apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係る自然言語装置における自然言語処理ルーチンを示すフローチャートである。It is a flowchart which shows the natural language processing routine in the natural language apparatus which concerns on embodiment of this invention. 分散意味表現による単語間の類似度の概要を示す図である。It is a figure which shows the outline | summary of the similarity between words by a distributed semantic expression.

以下、図面を参照して本発明の実施の形態を詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

<本発明の実施の形態に係る概要> <Outline according to Embodiment of the Present Invention>

まず、本発明の実施の形態における概要を説明する。   First, an outline of the embodiment of the present invention will be described.

本発明では、本質的に、必要リソース量(ファイルサイズ、メモリ専有量など)は、どのような計算環境であれ少ないほうがよりよい、という一般的な考えに基づいて、単語ベクトルのサイズを圧縮するという課題に取り組む。   In essence, the present invention compresses the size of a word vector based on the general idea that the amount of required resources (file size, memory occupancy, etc.) is better in any computing environment. Tackle the problem.

本発明の実施の形態では、上記(3)式の単語間の類似度はコサイン類似度によって計算されることから、コサイン類似度の値をなるべく変化させずに単語ベクトルが保持する情報量を削減することで、全体として容量を削減した単語ベクトルを得る、という考えに基づく。   In the embodiment of the present invention, the similarity between words in the above equation (3) is calculated by the cosine similarity, so that the amount of information held by the word vector is reduced without changing the value of the cosine similarity as much as possible. This is based on the idea of obtaining a word vector with a reduced capacity as a whole.

まず、次元数Dの単語ベクトルを幾つかのブロックで分割する。例えば、単語ベクトルの「ブロック内の要素数」をF、「ブロック数」をBとすると、D=BFの関係が成り立つ。例えば、D=256、F=32、なら、B=8となる。次に、各ブロックが取ることができる値集合の種類数を事前に決定する。例えば、「値集合の種類数」をSとおく。   First, a word vector having a dimension number D is divided into several blocks. For example, if the “number of elements in a block” of the word vector is F and the “number of blocks” is B, the relationship of D = BF holds. For example, if D = 256 and F = 32, B = 8. Next, the number of types of value sets that each block can take is determined in advance. For example, S is the “number of value set types”.

このとき、単語ベクトル内の個々のブロックは、値集合Sの中の一つを選択することとする。つまり、一つの単語ベクトルは、B個のブロックが個々に一つ選択した値集合の組み合わせによって表現されることになる。このとき、単語ベクトルが取り得る種類数はSB個であり、その中の一つが単語ベクトルに割り当てられる問題に相当する。例えば、先ほどの例で16種類の値集合を用意した場合は、一つの単語ベクトルは、168=4,294,967,296通りの値を取ることができる。一般的に単語数は数百万規模、どんなに多くても数千万程度なので、43億種類程度あれば、十分に単語の分散表現を表現できると考えられる。よって、上記(2)式や(3)式で示したような最適化問題を解くことによって、縮約された単語分散意味表現をデータから獲得する方法を用いる。   At this time, one block in the value set S is selected as each block in the word vector. That is, one word vector is expressed by a combination of value sets in which B blocks are individually selected one by one. At this time, the number of types that the word vector can take is SB, and one of them corresponds to the problem of being assigned to the word vector. For example, when 16 types of value sets are prepared in the previous example, one word vector can take 168 = 4,294,967,296 values. In general, the number of words is in the millions, and no more than tens of millions. Therefore, if there are about 4.3 billion types, it is considered that the distributed expression of words can be expressed sufficiently. Therefore, a method of acquiring a reduced word distribution semantic expression from the data by solving the optimization problem as shown in the above formulas (2) and (3) is used.

本発明の実施の形態では、web上に存在する自然言語で記述された電子化文章を使って単語の分散意味表現を獲得する問題を題材として適用した単語ベクトル学習装置を例に説明する。   In the embodiment of the present invention, a word vector learning apparatus to which the problem of acquiring a distributed semantic expression of a word using an electronic text described in a natural language existing on a web is applied as an example will be described.

まず最初に、ある一日のSNSサイト等へ投稿される一般ユーザが生成する文章を獲得し単語ベクトルを生成することを想定する。この時、用いる語彙数Vは、獲得したデータに出現する全ての単語の種類数とする。或いは、ある頻度以上出現した単語を対象として語彙を決定してもよい。   First, it is assumed that a sentence generated by a general user posted to an SNS site on a certain day is acquired and a word vector is generated. At this time, the vocabulary number V to be used is the number of types of all words appearing in the acquired data. Alternatively, the vocabulary may be determined for words that appear more than a certain frequency.

図1に単語リスト及び文脈の共起情報の例を示す。なお、ここで示す例では簡単のため、単語区切りなどは、一般的によく用いられるツール等を用いて容易に獲得可能であることを前提とする。日本語の場合は、フリーで利用できるツールが存在するし、英語であれば、空白区切りを単語の区切りとして利用すれば良い。ここでは日本語の例で述べる。   FIG. 1 shows an example of word list and context co-occurrence information. For the sake of simplicity in the example shown here, it is assumed that word breaks and the like can be easily obtained using a commonly used tool or the like. In the case of Japanese, there are tools that can be used for free, and in the case of English, a blank separator can be used as a word separator. Here, I will give an example in Japanese.

単語ベクトルの次元数Dを例えば256に設定する。また、語彙数Vが100万語だったと仮定する。単語ベクトルの一例を図2に示す。   The dimension number D of the word vector is set to 256, for example. Further, it is assumed that the vocabulary number V is 1 million words. An example of a word vector is shown in FIG.

この設定で従来法を用いた場合は、256次元の単語ベクトルが100万本構築されることになる。   When the conventional method is used with this setting, 1 million 256-dimensional word vectors are constructed.

また、この単語ベクトルは、上記(2)式の最適化問題を解くことによって獲得できる。   This word vector can be obtained by solving the optimization problem of the above equation (2).

次に、本発明の実施の形態に適用した場合を考える。まず、i番目の単語ベクトルrをブロック毎に分割した際のb番目の部分ベクトルをri,bと記述する。このとき、ブロック数をBとすると、ri,bのb=1からb=Bまでのベクトルを連結するとrと一致する。 Next, consider a case where the present invention is applied to an embodiment of the present invention. First, the b-th partial vector when the i-th word vector r i is divided for each block is described as r i, b . At this time, assuming that the number of blocks is B, the vectors from b = 1 to b = B of r i, b match r.

本発明の実施の形態では、上記(3)式の代わりに以下(4)式の最適化問題を解くことで単語ベクトルを獲得する。   In the embodiment of the present invention, a word vector is obtained by solving the optimization problem of the following equation (4) instead of the above equation (3).

ここで、ζは、次元数FのS種類の実数ベクトルの集合を表す。   Here, ζ represents a set of S kinds of real vectors having a dimension number F.

従来法との大きな違いは、各単語ベクトルをブロック毎に分割し、ブロック単位のベクトルに対して、最適化を行うような形式になる点である。また各ブロックの値集合の種類がS種類となるように制約をかけながら学習が行われる点が大きな特徴となる。   A major difference from the conventional method is that each word vector is divided into blocks, and a block-type vector is optimized. Another significant feature is that learning is performed while restricting the value set of each block to S types.

次に、処理を簡単化するために、(4)式を以下のように変形する。   Next, in order to simplify the processing, the equation (4) is modified as follows.

(4)式と(5)式は等価である。単純に、最適化中の処理として、ベクトルrとu、cとvに分解して処理を行うための式変形である。r=u、c=vの等式制約を拡張ラグランジュ緩和法を用いて緩和すると以下(6)式を得る(参考文献1:Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers. Foundations and Trends in Machine Learning, 2011.)。   Equations (4) and (5) are equivalent. It is simply an equation modification for performing processing by decomposing into vectors r and u and c and v as processing during optimization. When the equality constraint of r = u, c = v is relaxed using the extended Lagrangian relaxation method, the following equation (6) is obtained (Reference 1: Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed). Optimization and Statistical Learning via the Alternating Direction Method of Multipliers. Foundations and Trends in Machine Learning, 2011.).

本発明の実施の形態では、(6)式を目的関数として用いる。なお、A=(αi=1 ,B=(βj=1 である。 In the embodiment of the present invention, equation (6) is used as an objective function. Note that A = (α i ) i = 1 V and B = (β j ) j = 1 V.

本発明の実施の形態の処理の流れを以下に示す。   The processing flow of the embodiment of the present invention is shown below.

(入力)
学習用データD、人手により決定するチューニングパラメタD,B,F,Tを入力する。
(input)
The learning data D and the tuning parameters D, B, F, and T determined manually are input.

(初期化)
最適化変数R,Cを乱数で初期化し、繰り返しを管理する変数t=0と初期化する。
(Initialization)
The optimization variables R and C are initialized with random numbers, and the variable t = 0 for managing repetition is initialized.

(処理1:更新)
勾配法などを用いて制約なしの状態で最適化パラメタR,Cを更新する。
(Process 1: Update)
The optimization parameters R and C are updated without restriction using a gradient method or the like.

(処理2:パラメタ調整)
全ての単語ベクトルのブロックで、値集合の種類数がS個になるように最適化パラメタR;Cを調整する。
(Process 2: Parameter adjustment)
The optimization parameter R; C is adjusted so that the number of types of value sets is S in all word vector blocks.

(処理3)
ラグランジュ乗数を更新する。
(Process 3)
Update the Lagrange multiplier.

(処理4:終了判定)
最適化が収束したか、或いは、事前に設定した規定回数Tに達したか判定終了判定が満たされていれば次の処理へ移行する。していなかったらt=t+1として処理1へ戻る。
(Process 4: End determination)
If the optimization has converged or if the predetermined number of times T set in advance has been reached or if the determination end determination is satisfied, the process proceeds to the next process. If not, t = t + 1 and return to processing 1.

(処理5:縮約)
獲得された^wに対してデータの保持方法を最適化する。
(Process 5: Reduction)
The data holding method is optimized for the obtained ^ w.

<本発明の実施の形態に係る単語ベクトル学習装置の構成> <Configuration of Word Vector Learning Device According to Embodiment of the Present Invention>

次に、本発明の実施の形態に係る単語ベクトル学習装置の構成について説明する。図3に示すように、本発明の実施の形態に係る単語ベクトル学習装置100は、CPUと、RAMと、後述する単語ベクトル学習処理ルーチンを実行するためのプログラムや各種データを記憶したROMと、を含むコンピュータで構成することが出来る。この単語ベクトル学習装置100は、機能的には図3に示すように入力部10と、演算部20と、出力部50とを備えている。 Next, the configuration of the word vector learning device according to the embodiment of the present invention will be described. As shown in FIG. 3, the word vector learning device 100 according to the embodiment of the present invention includes a CPU, a RAM, a ROM for storing a program and various data for executing a word vector learning processing routine described later, Can be configured with a computer including Functionally, the word vector learning device 100 includes an input unit 10, a calculation unit 20, and an output unit 50 as shown in FIG.

入力部10は、学習用データ   The input unit 10 is learning data.

(以下、文書データと称する)を受け付ける。文書データは、単語と、単語の文脈として出現する単語とのペア(w,w)の集合である。w,wは、対象となる単語wと、その文脈となる単語wである。また、入力部10は、人手により決定されたチューニングパラメタD,B,F,Tをそれぞれ受け付ける。これらの値は、以降の処理中で値が変化することはない。 (Hereinafter referred to as document data). The document data is a set of pairs (w i , w j ) of words and words that appear as the word context. w i and w j are a target word w i and a context word w j . The input unit 10 receives tuning parameters D, B, F, and T determined manually. These values do not change during the subsequent processing.

演算部20は、学習部30と、ベクトル記憶部40とを含んで構成されている。   The calculation unit 20 includes a learning unit 30 and a vector storage unit 40.

学習部30は、文書データにおける単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、文書データにおいて単語ペアについて一方の単語が他方の単語の文脈として出現した回数Xi,jとに基づいて、単語ベクトル及び文脈ベクトルの各々の各ブロックが、S種類の実数ベクトルの何れかとなる制約の下で、単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定する。 The learning unit 30 divides each of the word vector and the context vector in the document data into B blocks having a dimension number F, and sets one of the S types of real vectors having the dimension number F and one word pair in the document data. Based on the number of times X i, j that the word has appeared as the context of the other word, each block of the word vector and the context vector is subject to the restriction that the word vector and the context are any one of the S real vectors. Estimate a word vector for each word and a real value vector for each block of the context vector to optimize the objective function representing the likelihood of each block of each vector.

学習部30は、更新部32と、反復判定部34とを備えている。   The learning unit 30 includes an update unit 32 and an iterative determination unit 34.

更新部32は、上記(6)式により表される、目的関数を最適化するように、文書データで出現する、単語と、単語の文脈として出現する単語とのペアの集合   The updating unit 32 represents a set of pairs of words that appear in the document data and words that appear as the context of the word, so as to optimize the objective function, expressed by the above equation (6).

と、次元数Fの実数ベクトルである各ブロックの補助パラメタui,b、vj,bと、各ブロックについてのラグランジュ未定乗数αi,b、βi,bとに基づいて、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新する。 And the auxiliary parameters u i, b , v j, b of each block, which is a real vector of dimension F , and Lagrange undetermined multipliers α i, b , β i, b for each block, Update the real vector of each block c j, b of the context vector for each block r i, b and word j for each word vector.

反復判定部34は、予め定められた反復終了条件を満たすまで、更新部32による更新を繰り返させる。ここで反復終了条件は、繰り返し数Tの回数だけ更新部32の更新を繰り返すこととする。   The iterative determination unit 34 causes the updating unit 32 to repeat the update until a predetermined iteration end condition is satisfied. Here, the iteration end condition is that the updating of the updating unit 32 is repeated the number of repetitions T.

更新部32の具体的な処理について以下に説明する。   Specific processing of the updating unit 32 will be described below.

更新部32は、まず最適化変数R,C,U,Vを乱数で初期化する。また、繰り返し数を管理する変数tをt=0で初期化する。α、βも同様にα=0、β=0と初期化する。   The update unit 32 first initializes the optimization variables R, C, U, and V with random numbers. Also, a variable t for managing the number of repetitions is initialized with t = 0. Similarly, α and β are initialized as α = 0 and β = 0.

このとき、単語ベクトル集合R、及び文脈ベクトル集合Cのみを最適化変数と考え、補助パラメタ集合のU,Vを固定した場合の目的関数は以下(7)式のようになる。   At this time, only the word vector set R and the context vector set C are considered as optimization variables, and the objective function when U and V of the auxiliary parameter set are fixed is expressed by the following equation (7).

上記(7)式の単語ベクトルのブロックri,bと文脈ベクトルのブロックcj,bとの勾配は以下(8)式及び(9)式のように書ける。 The gradient between the word vector block r i, b and the context vector block c j, b in the equation (7) can be written as the following equations (8) and (9).

よって、勾配法を用いて、上記(8)式、(9)式に従って、単語ベクトルのブロックri,bと文脈ベクトルのブロックcj,bとを更新していく。 Therefore, the gradient vector is used to update the word vector block r i, b and the context vector block c j, b according to the above equations (8) and (9).

次に、補助パラメタu,vを更新する。(6)式に関して、補助パラメタu,vのみを最適化変数と考え、u,vを固定した場合の目的関数は以下(10)式のようになる。   Next, the auxiliary parameters u and v are updated. Regarding equation (6), only the auxiliary parameters u and v are considered as optimization variables, and the objective function when u and v are fixed is as shown in equation (10) below.

ただし、   However,

とする。 And

この問題は、ユークリッド距離に基づくk平均クラスタリング問題と等価になる。よって、例えば、一般的なk平均クラスタリング法を用いて(10)式を解くことにより、補助パラメータui,b,vj,bを更新する。 This problem is equivalent to the k-means clustering problem based on Euclidean distance. Therefore, for example, the auxiliary parameters u i, b , v j, b are updated by solving equation (10) using a general k-means clustering method.

次に、R,C,U,Vを固定し、ラグランジュ未定乗数αi,b及びβi,bを最適化変数として更新する。 Next, R, C, U, and V are fixed, and Lagrange undetermined multipliers α i, b and β i, b are updated as optimization variables.

この関係から以下の更新式を得る。勾配法を用いて、(13)(14)式に従って、ラグランジュ未定乗数αi,b及びβi,bを更新する。
ただし、ηは学習率を表す。
From this relationship, the following update formula is obtained. Using the gradient method, Lagrange undetermined multipliers α i, b and β i, b are updated in accordance with equations (13) and (14).
Here, η represents a learning rate.

次に、反復判定部34による終了判定を行う。基本的に、終了判定は、事前に設定した繰り返し数Tに達したかどうかで判定する。t=Tの時、終了と判定し単語ベクトルの保存へ進む。t<Tの時には、t=t+1として更新部32の最初の処理へ戻る。   Next, the end determination by the repetition determination unit 34 is performed. Basically, the end determination is made based on whether or not a preset number of repetitions T has been reached. When t = T, it is determined that the process is finished, and the process proceeds to save the word vector. When t <T, t = t + 1 and the process returns to the first process of the updating unit 32.

学習部30は、最後に、更新部32で更新された学習後の単語ベクトル及び文脈ベクトルの実数値ベクトルを適切な形式でベクトル記憶部40に保存する。単語ベクトルの各ブロックは、S種類の値集合の中一つを取るので[logS]bitで記述できる。よって、一つの単語ベクトルはB[logS]bitとなる。結果、全語彙の単語ベクトルでは、VB[logS]bitになる。同様に、全語彙の文脈ベクトルもVB[logS]bitで保存できる。また、一つの値集合は、倍精度浮動小数点(64bit)がF個で構成されるので、S個の値集合全体は、64SFbitで表現できる。   Finally, the learning unit 30 stores the learned word vector and the real value vector of the context vector updated by the update unit 32 in the vector storage unit 40 in an appropriate format. Since each block of the word vector takes one of S types of value sets, it can be described by [logS] bit. Therefore, one word vector is B [logS] bit. As a result, the word vector of all vocabularies is VB [logS] bit. Similarly, context vectors for all vocabularies can also be stored with VB [logS] bit. Also, since one value set is composed of F double-precision floating point numbers (64 bits), the entire S value set can be expressed by 64 SF bits.

最終的に、2VB[logS]+64SFbitで全語彙の単語ベクトルおよび文脈ベクトルが格納可能である。よって、V=1,0000,00、B=8、S=16、F=32のとき、最終的に、2×1,0000,00×8×4+64×16×32=64,032,768bit(約8MB)で全語彙の単語ベクトルおよび文脈ベクトルが格納可能である。   Finally, the word vectors and context vectors of all vocabularies can be stored with 2VB [logS] + 64SF bits. Therefore, when V = 1,0000,00, B = 8, S = 16, and F = 32, 2 × 1,0000,00 × 8 × 4 + 64 × 16 × 32 = 64,032,768 bits ( In about 8 MB), word vectors and context vectors of all vocabularies can be stored.

<本発明の実施の形態に係る自然言語処理装置の構成>   <Configuration of Natural Language Processing Device According to Embodiment of the Present Invention>

次に、本発明の実施の形態に係る自然言語処理装置の構成について説明する。図4に示すように、本発明の実施の形態に係る自然言語処理装置200は、CPUと、RAMと、後述する自然言語処理ルーチンを実行するためのプログラムや各種データを記憶したROMと、を含むコンピュータで構成することが出来る。この自然言語処理装置200は、機能的には図4に示すように入力部210と、演算部220と、出力部250とを備えている。本実施の形態では、自然言語処理装置200では、単語ベクトル学習装置100により学習された単語ベクトルに基づいて、未知の単語を類似度の高い単語に置き換えて翻訳を行う場合を例に説明するが、これに限定されるものではなく、置き換えた単語を用いて要約、文書校正などを行ってもよい。   Next, the configuration of the natural language processing apparatus according to the embodiment of the present invention will be described. As shown in FIG. 4, the natural language processing apparatus 200 according to the embodiment of the present invention includes a CPU, a RAM, and a ROM that stores a program and various data for executing a natural language processing routine described later. It can be configured with a computer including. Functionally, the natural language processing apparatus 200 includes an input unit 210, a calculation unit 220, and an output unit 250 as shown in FIG. In the present embodiment, the natural language processing device 200 will be described by taking as an example a case where an unknown word is replaced with a word having a high similarity based on the word vector learned by the word vector learning device 100. However, the present invention is not limited to this, and summarization, document proofreading, and the like may be performed using the replaced word.

入力部210は、翻訳対象のテキストを受け付ける。   The input unit 210 receives text to be translated.

演算部220は、自然言語処理部230と、ベクトル記憶部240とを備えている。   The calculation unit 220 includes a natural language processing unit 230 and a vector storage unit 240.

ベクトル記憶部240には、ベクトル記憶部40と同じものが記憶されている。   The vector storage unit 240 stores the same as the vector storage unit 40.

自然言語処理部230は、置換部232と、翻訳部234とを備えている。   The natural language processing unit 230 includes a replacement unit 232 and a translation unit 234.

置換部232は、入力部210で受け付けたテキストの単語のうち、単語を格納した既存の辞書(図示省略)にない未知の単語を抽出し、ベクトル記憶部40に記憶されている単語に対する文脈ベクトルに基づいて、未知の単語に対して最も類似度が高い、辞書中の単語を推定する。そして、未知の単語を、推定された辞書中の単語に置き換えたテキストを生成する。   The replacement unit 232 extracts an unknown word that is not in an existing dictionary (not shown) that stores the word from the words of the text received by the input unit 210, and a context vector for the word stored in the vector storage unit 40 Based on the above, the word in the dictionary having the highest similarity to the unknown word is estimated. And the text which replaced the unknown word with the word in the estimated dictionary is produced | generated.

翻訳部234は、置換部232により単語が置き換えられたテキストを既存の手法により翻訳し、出力部250に出力して処理を終了する。   The translation unit 234 translates the text in which the word is replaced by the replacement unit 232 using an existing method, outputs the translated text to the output unit 250, and ends the processing.

なお、自然言語処理装置200において、他の自然言語処理を行う際に、特定の文書中に出現する単語と類似する単語を辞書から抽出して、処理対象に含めることで、情報を増やして精度を向上させることが可能である。この際、出現した各単語に対して、上記(1)式を計算して類似度が高い単語を処理に含めるといったことを行う。   In the natural language processing apparatus 200, when performing other natural language processing, a word similar to a word appearing in a specific document is extracted from the dictionary and included in the processing target, thereby increasing information and accuracy. It is possible to improve. At this time, for each word that appears, the above formula (1) is calculated and a word having a high similarity is included in the process.

<本発明の実施の形態に係る単語ベクトル学習装置の作用> <Operation of the word vector learning device according to the embodiment of the present invention>

次に、本発明の実施の形態に係る単語ベクトル学習装置100の作用について説明する。入力部10において文書データ、及びチューニングパラメタD,B,F,Tを受け付けると、単語ベクトル学習装置100は、図5に示す単語ベクトル学習処理ルーチンを実行する。   Next, the operation of the word vector learning device 100 according to the embodiment of the present invention will be described. When the document data and the tuning parameters D, B, F, and T are received by the input unit 10, the word vector learning device 100 executes a word vector learning processing routine shown in FIG.

まず、ステップS100では、最適化変数R,C,U,Vを乱数で初期化する。また、繰り返し数を管理する変数tをt=0で初期化する。α、βも同様にα=0、β=0と初期化する。   First, in step S100, the optimization variables R, C, U, and V are initialized with random numbers. Also, a variable t for managing the number of repetitions is initialized with t = 0. Similarly, α and β are initialized as α = 0 and β = 0.

次に、ステップS102では、上記(6)式により表される、目的関数を最適化するように、文書データで出現する、単語と、単語の文脈として出現する単語とのペアの集合   Next, in step S102, a set of pairs of a word that appears in the document data and a word that appears as the context of the word so as to optimize the objective function represented by the above equation (6).

と、次元数Fの実数ベクトルである各ブロックの補助パラメタui,b、vj,bと、各ブロックについてのラグランジュ未定乗数αi,b、βi,bとに基づいて、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新する。 And the auxiliary parameters u i, b , v j, b of each block, which is a real vector of dimension F , and Lagrange undetermined multipliers α i, b , β i, b for each block, Update the real vector of each block c j, b of the context vector for each block r i, b and word j for each word vector.

上記ステップS102は具体的には、図6に示す以下のステップS120〜S124により行われる。   Specifically, step S102 is performed by the following steps S120 to S124 shown in FIG.

ステップS120では、勾配法を用いて、上記(8)式、(9)式に従って、単語ベクトルのブロックri,bと文脈ベクトルのブロックcj,bとを更新する。 In step S120, the word vector block r i, b and the context vector block c j, b are updated according to the above equations (8) and (9) using the gradient method.

ステップS122では、(10)式に従って、補助パラメタu,vを更新する。   In step S122, the auxiliary parameters u and v are updated according to the equation (10).

ステップS124では、R,C,U,Vを固定し、上記(13)式、(14)式に従って、ラグランジュ未定乗数αi,b及びβi,bを最適化変数として更新する。 In step S124, R, C, U, and V are fixed, and Lagrange undetermined multipliers α i, b and β i, b are updated as optimization variables according to the equations (13) and (14).

ステップS104では、反復終了条件を満たすかを判定する。t=Tの時、終了と判定しステップS110の単語ベクトルの保存へ進み、t<Tの時には、ステップS106でt=t+1としてステップS102の処理へ戻る。   In step S104, it is determined whether the iteration end condition is satisfied. When t = T, it is determined that the process is finished, and the process proceeds to the storage of the word vector in step S110. When t <T, t = t + 1 is set in step S106, and the process returns to step S102.

ステップS108では、ステップS102で更新された学習後の単語ベクトル及び文脈ベクトルの実数値ベクトルを適切な形式でベクトル記憶部40に保存し、処理を終了する。   In step S108, the learned word vector and the real value vector of the context vector updated in step S102 are stored in an appropriate format in the vector storage unit 40, and the process ends.

以上説明したように、本発明の実施の形態に係る単語ベクトル学習装置によれば、単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、一方の単語が他方の単語の文脈として出現した回数とに基づいて、各ブロックが、S種類の実数ベクトルの何れかとなる制約の下で、単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定することにより、必要なメモリ容量を削減することができる単語ベクトルを学習することができる。   As described above, according to the word vector learning device according to the embodiment of the present invention, each of the word vector and the context vector is divided into B blocks having the dimensionality F, and S types having the dimensionality F are selected. Based on the set of real vectors and the number of times one word has appeared as the context of the other word, each block can be either of the S types of real vectors, with the constraint that each of the word vectors and context vectors. A word that can reduce the required memory capacity by estimating the word vector for each word and the real value vector of each block of the context vector so as to optimize the objective function representing the likelihood of each block Can learn vectors.

<本発明の実施の形態に係る自然言語処理装置の作用> <Operation of Natural Language Processing Device According to Embodiment of the Present Invention>

次に、本発明の実施の形態に係る自然言語処理装置200の作用について説明する。入力部210において翻訳対象のテキストを受け付けると、自然言語処理装置200は、図7に示す自然言語処理ルーチンを実行する。   Next, the operation of the natural language processing apparatus 200 according to the embodiment of the present invention will be described. When the input unit 210 accepts a text to be translated, the natural language processing apparatus 200 executes a natural language processing routine shown in FIG.

ステップS200では、入力部210で受け付けた翻訳対象のテキストから未知の単語を抽出する。   In step S200, an unknown word is extracted from the text to be translated received by the input unit 210.

ステップS202では、ベクトル記憶部240に記憶されている各単語の単語ベクトルに基づいて、ステップS200で抽出された未知の単語に対して最も類似度が高い、辞書中の単語を推定し、翻訳対象のテキストについて、未知の単語を、推定された辞書中の単語に置き換えたテキストを生成する。   In step S202, based on the word vector of each word stored in the vector storage unit 240, the word in the dictionary having the highest similarity to the unknown word extracted in step S200 is estimated, and the translation target Is generated by replacing an unknown word with a word in the estimated dictionary.

ステップS204では、ステップS202で生成されたテキストに基づいて翻訳し、出力部250に出力して処理を終了する。   In step S204, translation is performed based on the text generated in step S202, and the text is output to the output unit 250 and the process is terminated.

以上説明したように、本発明の実施の形態に係る自然言語処理装置によれば、学習された単語ベクトルを用いて、単語の意味的な類似度に基づく翻訳処理を行うことができる。   As described above, according to the natural language processing apparatus of the embodiment of the present invention, it is possible to perform translation processing based on the semantic similarity of words using learned word vectors.

なお、本発明は、上述した実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。   The present invention is not limited to the above-described embodiment, and various modifications and applications can be made without departing from the gist of the present invention.

10、210 入力部
20、220 演算部
30 学習部
32 更新部
34 反復判定部
40 ベクトル記憶部
50、250 出力部
100 単語ベクトル学習装置
200 自然言語処理装置
230 自然言語処理部
232 置換部
234 翻訳部
240 ベクトル記憶部
10, 210 Input unit 20, 220 Arithmetic unit 30 Learning unit 32 Update unit 34 Repetition determination unit 40 Vector storage unit 50, 250 Output unit 100 Word vector learning device 200 Natural language processing device 230 Natural language processing unit 232 Replacement unit 234 Translation unit 240 Vector storage

Claims (8)

文書データに基づいて、単語の各々について、前記単語に関するD次元の単語ベクトル、及び前記単語が他の単語の文脈として出現することを表すD次元の文脈ベクトルを学習する単語ベクトル学習装置であって、
前記単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、前記文書データにおいて単語ペアについて一方の単語が他方の単語の文脈として出現した回数とに基づいて、前記単語ベクトル及び文脈ベクトルの各々の各ブロックが、前記S種類の実数ベクトルの何れかとなる制約の下で、前記単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、前記単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定する学習部
を含む単語ベクトル学習装置。
A word vector learning device that learns, for each word, a D-dimensional word vector related to the word and a D-dimensional context vector indicating that the word appears as a context of another word based on document data. ,
Each of the word vector and the context vector is divided into B blocks of dimension F, and a set of S types of real vectors of dimension F and one word for the word pair in the document data Based on the number of occurrences of the context, each block of each of the word vector and context vector is subject to a constraint that each block of the word vector and context vector is one of the S kinds of real vectors. A word vector learning apparatus including a learning unit that estimates a word vector and a real value vector of each block of a context vector for each of the words so as to optimize an objective function representing likelihood.
前記学習部は、
以下の式により表される、前記目的関数を最適化するように、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新する更新部と、
予め定められた反復終了条件を満たすまで、前記更新部による更新を繰り返させる反復判定部と、を含む請求項1記載の単語ベクトル学習装置。

ただし、Dは、文書データで出現する、前記単語と、前記単語の文脈として出現する単語とのペアの集合を表し、αi,b、βi,bは、ラグランジュ未定乗数であり、ui,b、vj,bは、次元数Fの実数ベクトルである補助パラメタであり、ρは、定数であり、ζは、次元数FのS種類の実数ベクトルの集合を表し、Xi,jは単語iに対して単語jが文脈として出現した回数を表す。
The learning unit
For each word vector block r i, b for each word i and for each block c j, b for the context vector for each word j, so as to optimize the objective function represented by An updater for updating a real vector;
The word vector learning device according to claim 1, further comprising: an iterative determination unit that repeats updating by the updating unit until a predetermined iterative termination condition is satisfied.

Here, D represents a set of pairs of the word appearing in the document data and a word appearing as the context of the word, α i, b and β i, b are Lagrange undetermined multipliers, and u i , b , v j, b are auxiliary parameters that are real vectors of dimension F, ρ is a constant, ζ represents a set of S types of real vectors of dimension F, and X i, j Represents the number of times word j appears as context with respect to word i.
入力された入力文書に対して、請求項1又は2記載の単語ベクトル学習装置で学習された各単語の前記単語ベクトルを用いて、前記単語ベクトルに基づく単語間の意味的な類似度に基づく自然言語処理を行う自然言語処理部
を含む自然言語処理装置。
A natural based on semantic similarity between words based on the word vector using the word vector of each word learned by the word vector learning device according to claim 1 or 2 with respect to the input document. A natural language processing apparatus including a natural language processing unit that performs language processing.
文書データに基づいて、単語の各々について、前記単語に関するD次元の単語ベクトル、及び前記単語が他の単語の文脈として出現することを表すD次元の文脈ベクトルを学習する単語ベクトル学習装置における単語ベクトル学習方法であって、
学習部が、前記単語ベクトル及び文脈ベクトルの各々を、次元数FのB個のブロックに分割し、次元数FのS種類の実数ベクトルの集合と、前記文書データにおいて単語ペアについて一方の単語が他方の単語の文脈として出現した回数とに基づいて、前記単語ベクトル及び文脈ベクトルの各々の各ブロックが、前記S種類の実数ベクトルの何れかとなる制約の下で、前記単語ベクトル及び文脈ベクトルの各々の各ブロックの尤もらしさを表す目的関数を最適化するように、前記単語の各々についての単語ベクトル及び文脈ベクトルの各ブロックの実数値ベクトルを推定するステップ
を含む単語ベクトル学習方法。
A word vector in a word vector learning device that learns, for each word, a D-dimensional word vector related to the word and a D-dimensional context vector indicating that the word appears as a context of another word based on document data A learning method,
The learning unit divides each of the word vector and the context vector into B blocks having a dimension number F, and one word for a word pair in the document data and a set of S kinds of real vectors having the dimension number F. Based on the number of times the word vector and context vector appear as contexts of the other word, each block of the word vector and context vector is subject to any of the S types of real vectors. A word vector learning method comprising: estimating a word vector for each of the words and a real value vector of each block of the context vector so as to optimize an objective function representing the likelihood of each block.
前記学習部が推定するステップは、
更新部が、以下の式により表される、前記目的関数を最適化するように、単語iの各々についての単語ベクトルの各ブロックri,b及び単語jの各々についての文脈ベクトルの各ブロックcj,bの実数ベクトルを更新するステップと、
反復判定部が、予め定められた反復終了条件を満たすまで、前記更新部による更新を繰り返させるステップと、を含む請求項4記載の単語ベクトル学習方法。

ただし、Dは、文書データで出現する、前記単語と、前記単語の文脈として出現する単語とのペアの集合を表し、αi,b、βi,bは、ラグランジュ未定乗数であり、ui,b、vj,bは、次元数Fの実数ベクトルである補助パラメタであり、ρは、定数であり、ζは、次元数FのS種類の実数ベクトルの集合を表し、Xi,jは単語iに対して単語jが文脈として出現した回数を表す。
The step of estimating by the learning unit includes:
Each block r i, b of the word vector for each word i and each block c of the context vector for each word j so that the updating unit optimizes the objective function represented by updating j, b real vectors;
5. The word vector learning method according to claim 4, further comprising: a step of repeating the update by the update unit until a repetition determination unit satisfies a predetermined repetition end condition.

Here, D represents a set of pairs of the word appearing in the document data and a word appearing as the context of the word, α i, b and β i, b are Lagrange undetermined multipliers, and u i , b , v j, b are auxiliary parameters that are real vectors of dimension F, ρ is a constant, ζ represents a set of S types of real vectors of dimension F, and X i, j Represents the number of times word j appears as context with respect to word i.
自然言語処理部が、入力された入力文書に対して、請求項4又は5記載の単語ベクトル学習装置で学習された各単語の前記単語ベクトルを用いて、前記単語ベクトルに基づく単語間の意味的な類似度に基づく自然言語処理を行うステップ
を含む自然言語処理方法。
The natural language processing unit uses the word vector of each word learned by the word vector learning device according to claim 4 or 5 for the inputted input document, and makes semantics between words based on the word vector. A natural language processing method including a step of performing natural language processing based on a similar degree of similarity.
コンピュータを、請求項1又は請求項2に記載の単語ベクトル学習装置を構成する各部として機能させるためのプログラム。 The computer program to function as each unit constituting the word vectors learning equipment according to claim 1 or claim 2. コンピュータを、請求項3に記載の自然言語処理装置を構成する各部として機能させるためのプログラム。The program for functioning a computer as each part which comprises the natural language processing apparatus of Claim 3.
JP2016025130A 2016-02-12 2016-02-12 Word vector learning device, natural language processing device, method, and program Active JP6586026B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016025130A JP6586026B2 (en) 2016-02-12 2016-02-12 Word vector learning device, natural language processing device, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016025130A JP6586026B2 (en) 2016-02-12 2016-02-12 Word vector learning device, natural language processing device, method, and program

Publications (2)

Publication Number Publication Date
JP2017142746A JP2017142746A (en) 2017-08-17
JP6586026B2 true JP6586026B2 (en) 2019-10-02

Family

ID=59628528

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016025130A Active JP6586026B2 (en) 2016-02-12 2016-02-12 Word vector learning device, natural language processing device, method, and program

Country Status (1)

Country Link
JP (1) JP6586026B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102024300B1 (en) * 2017-09-28 2019-09-24 한국과학기술원 System and method for embedding named-entity
WO2020213757A1 (en) 2019-04-17 2020-10-22 엘지전자 주식회사 Word similarity determination method
WO2021124490A1 (en) 2019-12-18 2021-06-24 富士通株式会社 Information processing program, information processing method, and information processing device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4066600B2 (en) * 2000-12-20 2008-03-26 富士ゼロックス株式会社 Multilingual document search system
WO2013046590A1 (en) * 2011-09-26 2013-04-04 日本電気株式会社 Information processing device, information processing method, and program
JP6188147B2 (en) * 2013-10-15 2017-08-30 国立大学法人広島大学 Recognition system

Also Published As

Publication number Publication date
JP2017142746A (en) 2017-08-17

Similar Documents

Publication Publication Date Title
WO2020062770A1 (en) Method and apparatus for constructing domain dictionary, and device and storage medium
CN109948149B (en) Text classification method and device
CN110705294A (en) Named entity recognition model training method, named entity recognition method and device
CN106557563B (en) Query statement recommendation method and device based on artificial intelligence
JP6517537B2 (en) Word vector learning device, natural language processing device, method and program
CN111444320A (en) Text retrieval method and device, computer equipment and storage medium
CN108475262A (en) Electronic equipment and method for text-processing
CN107437417B (en) Voice data enhancement method and device based on recurrent neural network voice recognition
CN108733647B (en) Word vector generation method based on Gaussian distribution
JP6291443B2 (en) Connection relationship estimation apparatus, method, and program
CN112418320B (en) Enterprise association relation identification method, device and storage medium
CN111160000B (en) Composition automatic scoring method, device terminal equipment and storage medium
CN111274790A (en) Chapter-level event embedding method and device based on syntactic dependency graph
JP6586026B2 (en) Word vector learning device, natural language processing device, method, and program
WO2014073206A1 (en) Information-processing device and information-processing method
CN108038105B (en) Method and device for generating simulated word vector for unknown words
CN113505583A (en) Sentiment reason clause pair extraction method based on semantic decision diagram neural network
WO2020100738A1 (en) Processing device, processing method, and processing program
CN114490926A (en) Method and device for determining similar problems, storage medium and terminal
CN116680575B (en) Model processing method, device, equipment and storage medium
US20190266482A1 (en) Distance based deep learning
JP2017010249A (en) Parameter learning device, sentence similarity calculation device, method, and program
CN114757310B (en) Emotion recognition model and training method, device, equipment and readable storage medium thereof
CN111666770B (en) Semantic matching method and device
CN110633363B (en) Text entity recommendation method based on NLP and fuzzy multi-criterion decision

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180220

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190205

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190403

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190903

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190906

R150 Certificate of patent or registration of utility model

Ref document number: 6586026

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150