Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7705314B2 - Document processing device, document processing method, and document processing program - Google Patents
[go: Go Back, main page]

JP7705314B2 - Document processing device, document processing method, and document processing program - Google Patents

Document processing device, document processing method, and document processing program Download PDF

Info

Publication number
JP7705314B2
JP7705314B2 JP2021144245A JP2021144245A JP7705314B2 JP 7705314 B2 JP7705314 B2 JP 7705314B2 JP 2021144245 A JP2021144245 A JP 2021144245A JP 2021144245 A JP2021144245 A JP 2021144245A JP 7705314 B2 JP7705314 B2 JP 7705314B2
Authority
JP
Japan
Prior art keywords
word
low
representation
frequency
vector
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
JP2021144245A
Other languages
Japanese (ja)
Other versions
JP2023037468A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2021144245A priority Critical patent/JP7705314B2/en
Publication of JP2023037468A publication Critical patent/JP2023037468A/en
Application granted granted Critical
Publication of JP7705314B2 publication Critical patent/JP7705314B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Machine Translation (AREA)

Description

本発明は、文書処理装置、文書処理方法、及び、文書処理プログラムに関し、単語の分散表現を生成する文書処理装置、文書処理方法、及び、文書処理プログラムに適用して好適なものである。 The present invention relates to a document processing device, a document processing method, and a document processing program, and is suitable for use in a document processing device, a document processing method, and a document processing program that generate distributed representations of words.

従来、自然言語処理の分野では、単語を複数の連続値で構成されるベクトルで表し、単語間の特徴を表現できる分散表現の技術が知られている。 Traditionally, in the field of natural language processing, a technique called distributed representation is known that represents words as vectors consisting of multiple continuous values and can express characteristics between words.

この技術分野に関連する文献として、例えば特許文献1が挙げられる。特許文献1には、「単語の特徴を多次元ベクトルで表現する単語ベクトルの値を、簡便な方法で補正すること」を課題として、「単語のカテゴリーを記憶するシソーラス記憶部166と、単語の特徴を多次元ベクトルで表現する単語ベクトルを含む分散表現モデルを記憶する第1単語ベクトル記憶部164と、を備え、カテゴリーベクトル算出部144において同じカテゴリーに属する単語の単語ベクトルを代表するカテゴリーベクトルを算出し、単語ベクトル補正部146において単語ベクトルを、当該単語が属するカテゴリーベクトルに近づける補正を施す」自然言語装置が開示されている。 For example, Patent Document 1 is an example of a document related to this technical field. Patent Document 1 discloses a natural language device that aims to "correct, in a simple manner, the values of word vectors that express the features of words with multidimensional vectors" and that "includes a thesaurus storage unit 166 that stores word categories and a first word vector storage unit 164 that stores a distributed representation model including word vectors that express the features of words with multidimensional vectors, and calculates a category vector that represents the word vectors of words that belong to the same category in a category vector calculation unit 144, and corrects the word vector in a word vector correction unit 146 to bring the word vector closer to the category vector to which the word belongs."

ここで、分散表現は、大規模コーパスを用いて単語ごとにその前後の文脈から特徴を学習することで、単語の特徴や別の単語との関連性を表すベクトルを獲得することができる。しかし、学習対象のコーパスにおいて出現頻度の少ない単語や単語が現れる文脈が偏っている場合は、その単語の正確な特徴を獲得することができないという課題があった。 Distributed representations use a large-scale corpus to learn the features of each word from its surrounding context, making it possible to acquire vectors that represent the features of a word and its associations with other words. However, when the learning corpus contains words that appear infrequently or when the contexts in which a word appears are biased, there is an issue in that it is not possible to acquire accurate features of the word.

上記課題に対し、特許文献1では、外部知識としてシソーラスを用いて、各単語の分散表現に対し、その単語が属するカテゴリーに応じて、カテゴリーを代表するカテゴリーベクトルに近づける補正を施す仕組みが記載されている。 To address the above-mentioned issues, Patent Document 1 describes a mechanism that uses a thesaurus as external knowledge to correct the distributed representation of each word according to the category to which the word belongs, so that the vector approaches a category vector that represents the category.

特開2021-009538号公報JP 2021-009538 A

しかし、特許文献1に開示された技術は、学習済みの分散表現空間で表されている単語に対して補正を加えるのみであり、当該分散表現空間に含まれていない単語(例えば、部分文字列に分割されたサブワードや未知の単語等、それ自体では十分な意味が表されない単語)に対する扱いが開示されていない。したがって、特許文献1に開示された自然言語装置は、シソーラスに含まれている単語であっても、学習済みの分散表現空間に含まれない単語については、分散表現を作ることができないという問題があった。 However, the technology disclosed in Patent Document 1 only applies corrections to words represented in the trained distributed representation space, and does not disclose how to handle words that are not included in the trained distributed representation space (for example, subwords split into partial strings, unknown words, and other words that do not fully express meaning by themselves). Therefore, the natural language device disclosed in Patent Document 1 has the problem that it cannot create distributed representations for words that are not included in the trained distributed representation space, even if the words are included in the thesaurus.

本発明は以上の点を考慮してなされたもので、事前学習済みの分散表現空間において十分に意味を表すことができていない単語に対して、追加学習を行うことなしに、単語の意味を適切に埋め込むことが可能な文書処理装置、文書処理方法、及び、文書処理プログラムを提案しようとするものである。 The present invention has been made in consideration of the above points, and aims to propose a document processing device, document processing method, and document processing program that can appropriately embed the meaning of words whose meaning cannot be adequately represented in a pre-trained distributed representation space, without additional learning.

かかる課題を解決するため本発明においては、外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置であって、単語の種別ごとの基準ベクトルであるクラスベクトルを記憶するクラスベクトル記憶部と、前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析部と、前記形態素解析部よって分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成部と、記単語分散表現生成部によって生成された分散表現を修正する単語分散表現修正部と、を備え、前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合に、前記形態素解析部が、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、前記単語分散表現生成部が、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、前記単語分散表現修正部が、前記単語分散表現生成部によって生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する、文書処理装置が提供される。 In order to solve the above problem, the present invention provides a document processing device that generates embedded representations of words included in text input from outside, the document processing device comprising: a class vector storage unit that stores class vectors which are reference vectors for each type of word; a morphological analysis unit that divides the text into word strings by morphological analysis and assigns information indicating the type to which each word string belongs; a word embedded representation generation unit that converts the word strings divided by the morphological analysis unit into embedded representations for each word included in the word strings; and a word embedded representation correction unit that corrects the embedded representations generated by the word embedded representation generation unit, In this case, the morphological analysis unit divides the text into word strings by morphological analysis, and then further divides the low-frequency words included in the word strings into sub-words of partial strings, the word variance representation generation unit converts the low-frequency words into a plurality of variance representations consisting of variance representations for each of the sub-words included in the low-frequency words, and the word variance representation correction unit combines the plurality of variance representations of the low-frequency words generated by the word variance representation generation unit with a position vector that fixes the order of the sub-words in the low-frequency word, and then combines it with the class vector of the type to which the low-frequency word belongs, and replaces the variance representation after the combination as the variance representation of the low-frequency word .

また、かかる課題を解決するため本発明においては、外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置による文書制御方法であって、前記文書処理装置は、単語の種別ごとの基準ベクトルであるクラスベクトルを記憶しており、前記文書処理装置が、前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析ステップと、前記文書処理装置が、前記形態素解析ステップで分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成ステップと、前記文書処理装置が、前記単語分散表現生成ステップで生成された分散表現を修正する単語分散表現修正ステップと、を備え、前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合に、前記形態素解析ステップにおいて、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、前記単語分散表現生成ステップにおいて、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、前記単語分散表現修正ステップにおいて、前記単語分散表現生成ステップで生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する、文書処理方法が提供される。 In addition, in order to solve the above problem, the present invention provides a document control method by a document processing device that generates embedded representations of words included in text input from outside, the document processing device storing a class vector that is a reference vector for each type of word, the document processing device comprising: a morphological analysis step in which the document processing device divides the text into word strings by morphological analysis and assigns information indicating a type to which each word string belongs; a word embedded representation generation step in which the document processing device converts the word strings divided in the morphological analysis step into embedded representations for each word included in the word strings; and a word embedded representation correction step in which the document processing device corrects the embedded representations generated in the word embedded representation generation step, In a document processing method, when a low-frequency word having a frequency lower than a certain level is included, in the morphological analysis step, the text is divided into a word string by morphological analysis, and the low-frequency word included in the word string is further divided into sub-words of partial strings, in the word variance generation step, the low-frequency word is converted into a plurality of variance representations consisting of variance representations for each of the sub-words included in the low-frequency word, and in the word variance representation correction step, a position vector that fixes the order of the sub-words in the low-frequency word is combined with the plurality of variance representations of the low-frequency word generated in the word variance generation step, and then combined with the class vector of the type to which the low-frequency word belongs, and the variance representation after the combination is replaced as the variance representation of the low-frequency word .

また、かかる課題を解決するため本発明においては、外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置を構成する計算機に実行させる文書制御プログラムであって、前記文書処理装置には、単語の種別ごとの基準ベクトルであるクラスベクトルが記憶され、前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析処理と、前記形態素解析処理で分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成処理と、記単語分散表現生成処理で生成され分散表現を修正する単語分散表現修正処理と、を前記計算機に実行させ、前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合には、前記形態素解析処理において、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、前記単語分散表現生成処理において、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、前記単語分散表現修正処理において、前記単語分散表現生成処理で生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する、文書処理プログラムが提供される。
In order to solve the above problem, the present invention provides a document control program to be executed by a computer constituting a document processing device that generates embedded representations of words included in externally input text, the document processing device storing a class vector that is a reference vector for each type of word, and the document processing device causes the computer to execute a morphological analysis process that divides the text into word strings by morphological analysis and assigns information indicating the type to which each word string belongs, a word embedded representation generation process that converts the word strings divided by the morphological analysis process into embedded representations for each word included in the word strings, and a word embedded representation correction process that corrects the embedded representations generated by the word embedded representation generation process, and the document processing device causes the computer to execute a morphological analysis process that converts the word strings divided by the morphological analysis process into embedded representations for each word included in the word strings, and When a low-frequency word is included, in the morphological analysis process, the text is divided into a word string by morphological analysis, and the low-frequency word included in the word string is further divided into subwords of partial strings, in the word variance generation process, the low-frequency word is converted into a plurality of variance representations consisting of variance representations for each of the subwords included in the low-frequency word, and in the word variance correction process, a position vector that fixes the order of the subwords in the low-frequency word is combined with the plurality of variance representations of the low-frequency word generated in the word variance generation process, and then combined with the class vector of the type to which the low-frequency word belongs, and the variance representation after the combination is replaced as the variance representation of the low-frequency word.

本発明によれば、事前学習済みの分散表現空間において十分に意味を表すことができない単語に対して、追加学習を行うことなしに、単語の意味を適切に埋め込むことができる。上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。 According to the present invention, for words whose meaning cannot be adequately expressed in a pre-trained distributed representation space, the meaning of the word can be appropriately embedded without additional training. Problems, configurations, and effects other than those described above will become clear from the description of the embodiments below.

本発明の第1の実施形態に係る文書処理装置100の機能構成例を示すブロック図である。1 is a block diagram showing an example of a functional configuration of a document processing apparatus 100 according to a first embodiment of the present invention. 文書処理装置100を含む文書処理システム200の構成例を示す図である。FIG. 1 is a diagram showing an example of the configuration of a document processing system 200 including a document processing device 100. 文書処理装置100のハードウェア構成例を示すブロック図である。1 is a block diagram showing an example of a hardware configuration of a document processing apparatus 100. FIG. クラスベクトル作成処理の処理手順例を示すフローチャートである。13 is a flowchart illustrating an example of a processing procedure for class vector creation processing. 固有名詞の単語分散表現の散布図の画面表示例を示す図である。FIG. 13 is a diagram showing an example of a screen display of a scatter diagram of word variances of proper nouns. クラスベクトル候補の補正時の画面表示例を示す図である。13A and 13B are diagrams illustrating an example of a screen display when correcting class vector candidates. 分散表現生成処理の処理手順例を示すフローチャートである。13 is a flowchart showing an example of a processing procedure for distributed representation generation processing. 単語分散表現修正処理の処理手順例を示すフローチャートである。13 is a flowchart illustrating an example of a processing procedure for a word embedded expression correction process. 分散表現生成処理による入力文の処理過程の一例を説明する図である。11 is a diagram illustrating an example of a process of processing an input sentence by the distributed representation generation process. FIG. 本発明の第2の実施形態に係る文書処理装置1000の機能構成例を示すブロック図である。FIG. 11 is a block diagram showing an example of a functional configuration of a document processing apparatus 1000 according to a second embodiment of the present invention. 拡張単語ベクトル作成処理の処理手順例を示すフローチャートである。13 is a flowchart illustrating an example of a processing procedure for an extended word vector creation process. 第2の実施形態における単語分散表現修正処理の処理手順例を示すフローチャートである。13 is a flowchart illustrating an example of a processing procedure for a word embedded expression correction process according to the second embodiment. 第2の実施形態における分散表現生成処理による入力文の処理過程の一例を説明する図である。13 is a diagram illustrating an example of a process of processing an input sentence by a distributed representation generation process in the second embodiment. FIG. 絵文字の説明文の一例を示す図である。FIG. 13 is a diagram showing an example of an explanation of a pictogram.

以下、図面を参照して、本発明の実施形態を詳述する。 The following describes an embodiment of the present invention in detail with reference to the drawings.

(1)第1の実施形態
第1の実施形態では、固有名詞の分散表現について、固有名詞の種別ごとにその種別を代表する基準ベクトル(クラスベクトル)を生成し、固有名詞を構成する単語の分散表現とクラスベクトルを合成して、意味を埋め込んだ固有名詞の分散表現を生成する文書処理装置の例を説明する。本実施形態で扱う固有名詞は、事前学習済みの分散表現空間において十分に意味を表すことができない学習不足単語であって、これまでの学習における出現頻度が低く、十分な精度が得られていない低頻度語の一例に相当する。
(1) First embodiment In the first embodiment, an example of a document processing device will be described that generates a reference vector (class vector) representing each type of proper noun for each type of proper noun and combines the class vector with the distributed representations of the words that make up the proper noun to generate a distributed representation of the proper noun with embedded meaning. The proper nouns used in this embodiment are under-learned words whose meaning cannot be adequately expressed in a pre-trained distributed representation space, and correspond to an example of a low-frequency word that has appeared infrequently in previous learning and has not been able to achieve sufficient accuracy.

(1-1)構成
図1は、本発明の第1の実施形態に係る文書処理装置100の機能構成例を示すブロック図である。文書処理装置100は、文書処理プログラムがインストールされたコンピュータ(情報処理装置)であって、図1に示したように、入力部101、形態素解析部102、形態素解析辞書103、事前学習済みニューラル言語モデル104(単語分散表現生成部105,文分散表現生成部106)、出力部107、対象単語抽出部108、単語分散表現修正部109、クラスベクトル確認部110、位置ベクトル記憶部111、クラスベクトル記憶部112、及びクラスベクトル生成部113を備えて構成される。上記の各部については、図2,図3を説明した後に詳しく説明する。なお、図1に示した構成間の接続関係は、代表的な接続例のみを表したものであり、全ての接続関係を表したものではない。
(1-1) Configuration FIG. 1 is a block diagram showing an example of a functional configuration of a document processing device 100 according to a first embodiment of the present invention. The document processing device 100 is a computer (information processing device) in which a document processing program is installed, and as shown in FIG. 1, includes an input unit 101, a morphological analysis unit 102, a morphological analysis dictionary 103, a pre-trained neural language model 104 (a word variance generation unit 105, a sentence variance generation unit 106), an output unit 107, a target word extraction unit 108, a word variance correction unit 109, a class vector confirmation unit 110, a position vector storage unit 111, a class vector storage unit 112, and a class vector generation unit 113. Each of the above units will be described in detail after the description of FIG. 2 and FIG. 3. Note that the connection relationships between the components shown in FIG. 1 are only representative connection examples, and do not represent all connection relationships.

図2は、文書処理装置100を含む文書処理システム200の構成例を示す図である。文書処理システム200は、例えばクライアントサーバシステムで実現されるとき、図2に示すように、クライアントサーバであるサーバ201とユーザが使用する複数のユーザ端末203とが、ネットワーク202を介して通信可能に接続される。ユーザ端末203は、例えばパーソナルコンピュータ(PC)やスマートフォン等の情報処理装置である。ネットワーク202は、インターネット、LAN(Local Area Network)、またはWAN(Wide Area Network)等の任意のネットワークであってよい。 Fig. 2 is a diagram showing an example of the configuration of a document processing system 200 including a document processing device 100. When the document processing system 200 is realized, for example, as a client-server system, as shown in Fig. 2, a server 201, which is a client server, and multiple user terminals 203 used by users are communicatively connected via a network 202. The user terminals 203 are, for example, information processing devices such as personal computers (PCs) and smartphones. The network 202 may be any network such as the Internet, a LAN (Local Area Network), or a WAN (Wide Area Network).

文書処理システム200がクライアントサーバシステムで実現される場合、文書処理装置100で実行される文書処理プログラムは、サーバ201にインストールされる。したがって、サーバ201が文書処理装置100として、形態素解析、分散表現の生成、クラスベクトルの生成、及び拡張単語ベクトルの生成等を実行する。この場合、ユーザ端末203は、処理対象の文書の入力、処理対象の文書のサーバ201への送信、及びサーバ201からの処理結果の受信を実行するインタフェースとなる。 When the document processing system 200 is realized as a client-server system, the document processing program executed by the document processing device 100 is installed on the server 201. Therefore, the server 201 performs morphological analysis, generation of distributed representations, generation of class vectors, generation of extended word vectors, etc. as the document processing device 100. In this case, the user terminal 203 becomes an interface that inputs the document to be processed, transmits the document to be processed to the server 201, and receives the processing results from the server 201.

なお、本実施形態において、文書処理システム200は、スタンドアロン型で実現することもできる。この場合、文書処理装置100で実行される文書処理プログラムは、ユーザ端末203にインストールされ、サーバ201及びネットワーク202は必須ではない。したがって、ユーザ端末203が文書処理装置100として、処理対象の文書の入力、入力した文書のデータ変換、及び処理結果の出力等を実行する。 In this embodiment, the document processing system 200 can also be realized as a standalone system. In this case, the document processing program executed by the document processing device 100 is installed in the user terminal 203, and the server 201 and the network 202 are not required. Therefore, the user terminal 203 functions as the document processing device 100 and performs input of documents to be processed, data conversion of the input documents, output of the processing results, etc.

図3は、文書処理装置100のハードウェア構成例を示すブロック図である。図3に示した情報処理装置300は、文書処理装置100を実現する情報処理装置であって、図2に示したサーバ201やユーザ端末203に相当する。 Figure 3 is a block diagram showing an example of the hardware configuration of the document processing device 100. The information processing device 300 shown in Figure 3 is an information processing device that realizes the document processing device 100, and corresponds to the server 201 and the user terminal 203 shown in Figure 2.

図3に示すように、情報処理装置300は、プロセッサ301と、記憶デバイス302と、入力デバイス303と、出力デバイス304と、通信インタフェース(通信IF)305と、を有する。プロセッサ301、記憶デバイス302、入力デバイス303、出力デバイス304、および通信IF305は、内部通信線であるバス306により接続される。 As shown in FIG. 3, the information processing device 300 has a processor 301, a storage device 302, an input device 303, an output device 304, and a communication interface (communication IF) 305. The processor 301, the storage device 302, the input device 303, the output device 304, and the communication IF 305 are connected by a bus 306, which is an internal communication line.

プロセッサ301は、情報処理装置300を制御するプロセッサであり、例えばCPU(Central Processing Unit)やGPU(Graphics Processing Unit)である。記憶デバイス302は、プロセッサ301の作業エリアを提供するデバイスであり、各種プログラムやデータを記憶する非一時的なまたは一時的な記録媒体である。記憶デバイス302は、具体的には例えば、ROM(Read Only Memory)、RAM(Random Access Memory)、HDD(Hard Disk Drive)、またはフラッシュメモリ等である。なお、記憶デバイス302は、必ずしも情報処理装置300の内部に搭載された記録媒体である必要はなく、各種プログラム及びデータの一部またはその全てが、情報処理装置300に接続される外部(外部記憶媒体やクラウド等)に記憶される構成であってもよい。図1に示した文書処理装置100の各処理部は、主に、プロセッサ301が所定の各種プログラムを読み出して実行することによって実現される。また、図1に示した文書処理装置100の各記憶部(形態素解析辞書103を含む)は、記憶デバイス302によって実現される。入力デバイス303は、データを入力するためのデバイスであり、具体的には例えば、キーボード、マウス、タッチパネル、テンキー、スキャナ、マイク、または生体センサ等である。出力デバイス304は、データを出力するためのデバイスであり、具体的には例えば、ディスプレイ、プリンタ、またはスピーカ等である。通信IF305は、ネットワーク202に接続し、情報処理装置300の外部とデータを送受信するインタフェースであって、具体的には例えば、NIC(Network Interface Card)である。 The processor 301 is a processor that controls the information processing device 300, and is, for example, a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit). The storage device 302 is a device that provides a working area for the processor 301, and is a non-temporary or temporary recording medium that stores various programs and data. Specifically, the storage device 302 is, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a HDD (Hard Disk Drive), or a flash memory. Note that the storage device 302 does not necessarily have to be a recording medium installed inside the information processing device 300, and some or all of the various programs and data may be stored outside (external storage medium, cloud, etc.) connected to the information processing device 300. Each processing unit of the document processing device 100 shown in FIG. 1 is mainly realized by the processor 301 reading and executing various predetermined programs. In addition, each storage unit (including the morphological analysis dictionary 103) of the document processing device 100 shown in FIG. 1 is realized by the storage device 302. The input device 303 is a device for inputting data, and specifically includes, for example, a keyboard, a mouse, a touch panel, a numeric keypad, a scanner, a microphone, or a biosensor. The output device 304 is a device for outputting data, and specifically includes, for example, a display, a printer, or a speaker. The communication IF 305 is an interface that connects to the network 202 and transmits and receives data to and from outside the information processing device 300, and specifically includes, for example, a network interface card (NIC).

図1に示した文書処理装置100の機能構成について説明する。 The functional configuration of the document processing device 100 shown in FIG. 1 will be described.

入力部101は、テキストデータを読み込むモジュールであり、テキストデータの加工及び登録は、すべて入力部101を介して行われる。以後の説明では、入力部101が読み込んだテキストデータに含まれるテキストを、単にテキストと表記することがある。 The input unit 101 is a module that reads text data, and all processing and registration of text data is performed via the input unit 101. In the following explanation, the text contained in the text data read by the input unit 101 may be referred to simply as text.

形態素解析部102は、入力部101から入力されたテキストの形態素解析を行い、その結果を事前学習済みニューラル言語モデル104の単語分散表現生成部105と、対象単語抽出部108とに出力する。なお、形態素解析部102は、形態素解析の前処理として、英数字記号やカタカナの全角文字への統一、及び、漢字については旧字体などの異字体を常用漢字に変換する処理等を行い、文字単位で可能な正規化を行う。 The morphological analysis unit 102 performs morphological analysis of the text input from the input unit 101, and outputs the results to the word distributed representation generation unit 105 of the pre-trained neural language model 104 and the target word extraction unit 108. As pre-processing for the morphological analysis, the morphological analysis unit 102 performs normalization possible on a character-by-character basis by standardizing alphanumeric symbols and katakana to full-width characters, and converting different characters such as old characters into commonly used kanji.

形態素解析では、形態素解析辞書103を用いてテキストを単語列に分割し、読みと品詞情報を付与する処理である。形態素解析辞書103は、単語ごとの読み・品詞情報と、大量のテキストコーパスから学習された単語の生起コストと単語間の連接コストを持つデータベースである。したがって、形態素解析部102による形態素解析処理では、形態素解析辞書103の情報をもとに、テキストデータのテキストを日本語として適切な位置で区切って単語列に分割する。 Morphological analysis is a process in which text is divided into word strings using the morphological analysis dictionary 103 and reading and part-of-speech information is assigned. The morphological analysis dictionary 103 is a database that contains reading and part-of-speech information for each word, as well as the word occurrence cost and inter-word connection cost learned from a large text corpus. Therefore, in the morphological analysis process by the morphological analysis unit 102, the text of the text data is divided into word strings at appropriate positions in Japanese based on the information in the morphological analysis dictionary 103.

形態素解析辞書103は、予めシステム側に用意された読み込み専用の辞書であるシステム辞書と、ユーザが任意に登録及び修正を行う読み書き可能な辞書であるユーザ辞書とで構成される。ユーザ辞書を編集することにより、ユーザは新たに固有名詞を形態素解析辞書103に登録することができる。なお、一部の固有名詞は、予めシステム辞書に登録されていてもよい。また、形態素解析辞書103のシステム辞書は、後述の事前学習済みニューラル言語モデル104を作成する際に使われた形態素解析辞書と同じ辞書とする。 The morphological analysis dictionary 103 is composed of a system dictionary, which is a read-only dictionary prepared in advance on the system side, and a user dictionary, which is a readable and writable dictionary that the user can register and modify at will. By editing the user dictionary, the user can register new proper nouns in the morphological analysis dictionary 103. Note that some proper nouns may be registered in the system dictionary in advance. The system dictionary of the morphological analysis dictionary 103 is the same dictionary as the morphological analysis dictionary used when creating the pre-trained neural language model 104 described below.

形態素解析部102は、さらに、後述の事前学習済みニューラル言語モデル104から語彙リストを取得し、語彙リストに合わせた単語の加工を行う。語彙リストは、事前学習済みニューラル言語モデル104に含まれる語彙のリストである。ニューラル言語モデルは、その仕組み上、語彙数を制限する必要があるため、通常の形態素解析によって分割された単語をさらに小さい部分文字列のサブワードに分割するサブワード分割や、低頻度語(それまでの学習における出現頻度が低い語)を未知語(十分に学習済みの単語として扱わない語)を示す特殊トークンに置換する未知語処理を行うことにより、全体の語彙数を削減している。 The morphological analysis unit 102 further obtains a vocabulary list from the pre-trained neural language model 104 described below, and processes words to match the vocabulary list. The vocabulary list is a list of vocabulary included in the pre-trained neural language model 104. Due to the structure of the neural language model, it is necessary to limit the number of vocabulary words, so the total number of vocabulary words is reduced by performing subword division, which divides words divided by normal morphological analysis into subwords of smaller partial strings, and unknown word processing, which replaces low-frequency words (words that have a low frequency of occurrence in previous learning) with special tokens that indicate unknown words (words that are not treated as sufficiently learned words).

したがって、形態素解析部102は、形態素解析辞書103を用いて形態素解析した結果を語彙リストに定義されたサブワード単位に再分割し、また、語彙リストに存在しない場合は未知語を示す特殊トークンに置換する。 Therefore, the morphological analysis unit 102 re-divides the results of morphological analysis using the morphological analysis dictionary 103 into subword units defined in the vocabulary list, and if a word does not exist in the vocabulary list, it replaces it with a special token indicating an unknown word.

事前学習済みニューラル言語モデル104は、ニューラルネットワークを有し、大規模コーパスで学習された言語モデルであって、形態素解析部102が出力した単語列を多次元の実数ベクトルである分散表現に変換する。事前学習済みニューラル言語モデル104は、単語分散表現生成部105と文分散表現生成部106とを有する。 The pre-trained neural language model 104 is a language model that has a neural network and is trained on a large-scale corpus, and converts the word strings output by the morphological analysis unit 102 into distributed representations that are multidimensional real vectors. The pre-trained neural language model 104 has a word distributed representation generation unit 105 and a sentence distributed representation generation unit 106.

単語分散表現生成部105と文分散表現生成部106とを有する事前学習済みニューラル言語モデル104としては、例えば、BERT(Bidirectional Encoder Representations from Transformers)がある。このとき、BERTにおけるエンベディング層が単語分散表現生成部105に相当し、エンコーダ層が文分散表現生成部106に相当する。 An example of a pre-trained neural language model 104 having a word distributed representation generation unit 105 and a sentence distributed representation generation unit 106 is BERT (Bidirectional Encoder Representations from Transformers). In this case, the embedding layer in BERT corresponds to the word distributed representation generation unit 105, and the encoder layer corresponds to the sentence distributed representation generation unit 106.

単語分散表現生成部105は、形態素解析部102が出力した単語列をニューラルネットワークを介して単語ごとに多次元の実数ベクトルである分散表現(単語分散表現)に変換する。より具体的には、単語分散表現生成部105は、単語を単語IDに変換し、さらにこれをワンホットベクトルに変換した後、ワンホットベクトルをニューラルネットワークに入力することで、単語ごとの分散表現(単語分散表現)を得る。単語IDは、語彙リストの単語にユニークに与えられた連続する整数である。 The word distributed representation generation unit 105 converts the word string output by the morphological analysis unit 102 into a distributed representation (word distributed representation) which is a multidimensional real vector for each word via a neural network. More specifically, the word distributed representation generation unit 105 converts the words into word IDs, further converts these into one-hot vectors, and then inputs the one-hot vectors into the neural network to obtain a distributed representation (word distributed representation) for each word. The word IDs are consecutive integers that are uniquely assigned to words in the vocabulary list.

ワンホットベクトルは、1つの成分が「1」で、残りの成分がすべて「0」であるベクトルである。ワンホットベクトルは、単語IDの数と同じ次元のベクトルであり、単語IDが「n」の単語はn番目の要素が「1」であるワンホットベクトルに変換される。単語分散表現生成部105は、上記のように変換したワンホットベクトルをニューラルネットワークに入力し、実数ベクトルである単語分散表現に変換する。 A one-hot vector is a vector in which one component is "1" and the remaining components are all "0". A one-hot vector is a vector with the same dimension as the number of word IDs, and a word with a word ID of "n" is converted into a one-hot vector in which the nth element is "1". The word distributed representation generation unit 105 inputs the one-hot vector converted as described above into a neural network and converts it into a word distributed representation, which is a real vector.

文分散表現生成部106は、単語分散表現生成部105が出力した(あるいは、後述する単語分散表現修正部109によって置換された)単語分散表現を合成し、文(または単語列)全体の分散表現を生成する。なお、事前学習済みニューラル言語モデル104は、BERTに限定するものではなく、単語列を単語ごとの分散表現と文全体の分散表現へ変換できればよく、BERTに類似したアーキテクチャの言語モデルを用いてもよい。また、単語分散表現生成部105にWord2Vecを用い、文分散表現生成部106として、単語分散表現生成部105が出力した単語分散表現の平均を取って文分散表現とする、といった構成としてもよい。 The sentence variance generating unit 106 synthesizes the word variances output by the word variance generating unit 105 (or replaced by the word variance correction unit 109 described below) to generate a variance for the entire sentence (or word string). Note that the pre-trained neural language model 104 is not limited to BERT, and any language model with an architecture similar to BERT may be used as long as it can convert a word string into a variance for each word and a variance for the entire sentence. Also, the word variance generating unit 105 may use Word2Vec, and the sentence variance generating unit 106 may be configured to take the average of the word variances output by the word variance generating unit 105 to generate the sentence variance.

出力部107は、文分散表現生成部106が生成した文(または単語列)全体の分散表現を、出力デバイス304によって所定の出力手段で出力する(ディスプレイへの表示出力や出力ファイルへのデータ出力等)。このとき、出力部107は、文全体で分散表現(分散ベクトル)を出力してもよいし、単語ごとに分散ベクトルを出力してもよい。 The output unit 107 outputs the distributed representation of the entire sentence (or word string) generated by the sentence distributed representation generation unit 106 via a predetermined output means via the output device 304 (such as display output to a display or data output to an output file). At this time, the output unit 107 may output the distributed representation (distributed vector) for the entire sentence, or may output the distributed vector for each word.

対象単語抽出部108は、形態素解析部102が出力した単語列から、クラスベクトル記憶部112に格納されたクラスベクトルと対応する所定の品詞種別(例えば、地名、人名、レストラン名などの固有名詞)の単語を抽出する。なお、ここで抽出する単語は、前述した事前学習済みニューラル言語モデル104の語彙に合わせたサブワード分割や未知語処理を行う前の単語である。また、対象単語抽出部108は、併せて、単語分散表現生成部105が出力した単語分散表現の中から、抽出した固有名詞に相当する単語列の単語分散表現を抽出する。 The target word extraction unit 108 extracts words of a predetermined part of speech (e.g., proper nouns such as place names, personal names, and restaurant names) that correspond to the class vectors stored in the class vector storage unit 112 from the word string output by the morphological analysis unit 102. Note that the words extracted here are words before subword division and unknown word processing are performed according to the vocabulary of the pre-trained neural language model 104 described above. The target word extraction unit 108 also extracts word variances of word strings that correspond to the extracted proper nouns from the word variances output by the word variance generation unit 105.

単語分散表現修正部109は、対象単語抽出部108が出力した固有名詞を構成する複数の単語の単語分散表現とクラスベクトル記憶部112に格納されたクラスベクトルと位置ベクトル記憶部111に格納された位置ベクトルとを合成して、固有名詞の単語分散表現を生成する。そして、単語分散表現修正部109は、生成した固有名詞の単語分散表現を単語分散表現生成部105に出力し、単語分散表現生成部105における当該固有名詞の単語分散表現群を上記生成した単語分散表現に置換し、置換後の単語分散表現を文分散表現生成部106に入力する。 The word variance correction unit 109 generates word variances for the proper noun by combining the word variances for the multiple words constituting the proper noun output by the target word extraction unit 108 with the class vector stored in the class vector storage unit 112 and the position vector stored in the position vector storage unit 111. The word variance correction unit 109 then outputs the generated word variances for the proper noun to the word variance generation unit 105, replaces the word variances for the proper noun in the word variance generation unit 105 with the generated word variances, and inputs the replaced word variances to the sentence variance generation unit 106.

クラスベクトル確認部110は、後述するクラスベクトル生成部113によって生成されたクラスベクトルをクラスベクトル候補として出力デバイス304によって出力し、入力デバイス303によってユーザからクラスベクトル候補への手動補正を受け付ける機能を有する。クラスベクトル確認部110は、クラスベクトル候補への手動補正を受け付けると、手動補正後のクラスベクトル候補をクラスベクトル生成部113に転送し、当該クラスベクトル候補をクラスベクトルとしてクラスベクトル記憶部112に登録する(あるいは、クラスベクトル確認部110から直接、クラスベクトル記憶部112に登録するとしてもよい)。 The class vector confirmation unit 110 has a function of outputting the class vector generated by the class vector generation unit 113 described below as a class vector candidate via the output device 304, and accepting manual correction of the class vector candidate from the user via the input device 303. When the class vector confirmation unit 110 accepts manual correction of the class vector candidate, it transfers the class vector candidate after manual correction to the class vector generation unit 113, and registers the class vector candidate as a class vector in the class vector storage unit 112 (alternatively, it may be registered in the class vector storage unit 112 directly from the class vector confirmation unit 110).

位置ベクトル記憶部111は、単語分散表現修正部109が単語分散表現に合成する位置ベクトルを格納する。位置ベクトルは、固有名詞を構成する各単語の分散表現に対して、その位置に対応した絶対的な値を足し合わせることで位置情報を与える役割を果たす。位置ベクトルを実現する技術には、例えば、Transformerの位置エンコーディングがある。 The position vector storage unit 111 stores the position vectors that the word embedded representation correction unit 109 synthesizes into the word embedded representations. The position vectors provide position information for the embedded representations of each word that constitutes a proper noun by adding up absolute values corresponding to their positions. One technique for realizing position vectors is, for example, the position encoding of the Transformer.

クラスベクトル記憶部112は、単語分散表現修正部109が単語分散表現に合成するクラスベクトルを格納する。クラスベクトル記憶部112には、クラスベクトル生成部113による後述のクラスベクトル作成処理によって固有名詞の種別ごとに作成されたクラスベクトルが格納される。 The class vector storage unit 112 stores the class vectors that the word variance correction unit 109 synthesizes into the word variances. The class vector storage unit 112 stores class vectors created for each type of proper noun by the class vector creation process described below by the class vector generation unit 113.

クラスベクトル生成部113は、単語分散表現修正部109が単語分散表現に合成するクラスベクトルを生成し、クラスベクトル記憶部112に格納する。クラスベクトルの生成は、文書処理装置100が文書処理を行う前に実行される。 The class vector generation unit 113 generates class vectors that the word variance correction unit 109 synthesizes into word variances, and stores them in the class vector storage unit 112. The generation of class vectors is performed before the document processing device 100 performs document processing.

(1-2)クラスベクトル作成処理
図4は、クラスベクトル作成処理の処理手順例を示すフローチャートである。図4に示すクラスベクトル作成処理は、後述する分散表現生成処理が実行されるよりも前の任意のタイミングで実行される処理であって、図1に示した文書処理装置100がクラスベクトルを作成しクラスベクトル記憶部112に登録する処理である。
(1-2) Class Vector Creation Process Fig. 4 is a flowchart showing an example of the processing procedure of the class vector creation process. The class vector creation process shown in Fig. 4 is a process executed at any timing before the execution of the distributed representation generation process described later, in which the document processing device 100 shown in Fig. 1 creates a class vector and registers it in the class vector storage unit 112.

図4によればまず、クラスベクトル生成部113が、入力部101を介して事前学習済みニューラル言語モデル104の語彙リストを読み込む(ステップS401)。語彙リストは、事前学習済みニューラル言語モデル104に含まれる全語彙(単語分散表現生成部105が保持する全ての語彙)のリストであり、事前学習済みニューラル言語モデル104から取得することができる。また、ステップS401で読み込んだ語彙リストにサブワードが含まれている場合、対象単語抽出部108が、サブワードを除外し、サブワードに分割されていない単語のみを抽出する(ステップS402)。語彙リストには、サブワードか否かの情報が含まれており、対象単語抽出部108は、この情報に基づいてサブワードの除外を行う。語彙リストにサブワードが含まれていない場合、ステップS402の処理は省略される。 According to FIG. 4, first, the class vector generation unit 113 reads the vocabulary list of the pre-trained neural language model 104 via the input unit 101 (step S401). The vocabulary list is a list of all vocabulary words (all vocabulary words held by the word variance generation unit 105) included in the pre-trained neural language model 104, and can be acquired from the pre-trained neural language model 104. If the vocabulary list read in step S401 includes subwords, the target word extraction unit 108 excludes the subwords and extracts only words that are not divided into subwords (step S402). The vocabulary list includes information on whether a word is a subword, and the target word extraction unit 108 excludes the subwords based on this information. If the vocabulary list does not include subwords, the process of step S402 is omitted.

次に、形態素解析部102が、ステップS402で抽出されたサブワード以外の、ステップS401で読み込まれた語彙リストに含まれる単語に対して、形態素解析辞書103を参照して単語の品詞を調べ、固有名詞を抽出する(ステップS403)。そして、クラスベクトル生成部113が、単語分散表現生成部105を介して、ステップS403で形態素解析部102が抽出した固有名詞の単語を単語分散表現に変換する(ステップS404)。 Next, the morphological analysis unit 102 refers to the morphological analysis dictionary 103 to check the part of speech of the words included in the vocabulary list loaded in step S401 other than the subwords extracted in step S402, and extracts proper nouns (step S403). Then, the class vector generation unit 113 converts the proper noun words extracted by the morphological analysis unit 102 in step S403 into word variance representations via the word variance representation generation unit 105 (step S404).

形態素解析部102が抽出したすべての固有名詞がステップS404で単語分散表現変換されると、クラスベクトル生成部113は、単語分散表現生成部105において固有名詞種別ごとの分散表現の平均をとって分散表現を作成し、これを各固有名詞種別のクラスベクトルとする(ステップS405)。なお、ステップS405でクラスベクトル生成部113が作成したクラスベクトルは、後述するステップS407においてユーザによる補正が可能である(すなわち、最終的にクラスベクトル記憶部112に登録されるクラスベクトルであるとは限らない)ことから、クラスベクトル候補と呼ぶこともできる。 When all proper nouns extracted by the morphological analysis unit 102 are converted into word variance representations in step S404, the class vector generation unit 113 creates variance representations by averaging the variance representations for each proper noun type in the word variance representation generation unit 105, and sets these as class vectors for each proper noun type (step S405). Note that the class vectors created by the class vector generation unit 113 in step S405 can be corrected by the user in step S407 described below (i.e., they are not necessarily the class vectors that are ultimately registered in the class vector storage unit 112), and therefore can also be called class vector candidates.

さらに、クラスベクトル生成部113は、ステップS405で作成した固有名詞の単語分散表現及びクラスベクトルの可視化を行うために、単語に分散表現の次元削減を行い、2次元の散布図を作成する(ステップS406)。次元削減には、例えば、主成分分析を用いることができるが、各固有名詞の分散表現の違いを表す特徴に集約できる方法であれば、別の方法であってもよい。 Furthermore, in order to visualize the word distributed representations and class vectors of the proper nouns created in step S405, the class vector generation unit 113 performs dimensionality reduction on the distributed representations of the words and creates a two-dimensional scatter plot (step S406). For example, principal component analysis can be used for dimensionality reduction, but any other method can be used as long as it can summarize the features that represent the differences in the distributed representations of each proper noun.

次に、クラスベクトル生成部113は、ステップS406で作成した散布図をクラスベクトル確認部110に送信し、クラスベクトル確認部110が、出力デバイス304(ディスプレイ等の表示装置)を用いて出力する(ステップS407)。 Next, the class vector generation unit 113 transmits the scatter plot created in step S406 to the class vector confirmation unit 110, which outputs it using the output device 304 (a display device such as a monitor) (step S407).

図5は、固有名詞の単語分散表現の散布図の画面表示例を示す図である。図5に示した散布図500は、図4のステップS407で出力される散布図の具体例である。散布図500には、「東京」や「大阪」といった地名の分散表現群501と、「○×カフェ」、「○△食堂」といったレストラン名の分散表現群502とが示されている。また、図5に示した×印503,504は、地名及びレストラン名(図中ではレストラン)のそれぞれの固有名詞の分散表現から生成された、クラスベクトル候補の分散表現を表している。 Figure 5 shows an example of a screen display of a scatter plot of word distributed representations of proper nouns. Scatter plot 500 shown in Figure 5 is a specific example of a scatter plot output in step S407 of Figure 4. Scatter plot 500 shows a group of distributed representations 501 of place names such as "Tokyo" and "Osaka", and a group of distributed representations 502 of restaurant names such as "○× Cafe" and "○△ Shokudo". Furthermore, cross marks 503 and 504 shown in Figure 5 represent the distributed representations of class vector candidates generated from the distributed representations of the proper nouns of place names and restaurant names (restaurants in the figure).

ここで、それぞれの固有名詞の分散表現群において、大多数の分散表現から大きく外れた値を有する分散表現が含まれている場合、分散表現群の平均がクラスベクトルとして適切とは限らない。そこで、クラスベクトル確認部110は、ステップS407において、出力した散布図に示すクラスベクトル候補(例えば図5の散布図500における×印503,504)について、入力デバイス303(マウスやキーボード等)を用いてユーザによる手動補正を受け付けるようにしてもよい。 Here, if the group of distributed representations of each proper noun contains a distributed representation with a value that is significantly different from the majority of distributed representations, the average of the group of distributed representations is not necessarily appropriate as a class vector. Therefore, in step S407, the class vector confirmation unit 110 may accept manual corrections by the user using the input device 303 (mouse, keyboard, etc.) for the class vector candidates shown in the output scatter plot (for example, the x marks 503 and 504 in the scatter plot 500 in FIG. 5).

図6は、クラスベクトル候補の補正時の画面表示例を示す図である。図6に示した散布図600は、大部分は図5の散布図500と同じで、×印601が追加されている。×印601は、ユーザが適正と考える地名のクラスベクトルの位置であり、ユーザが所定の操作を行って散布図600上で×印601を選択することにより、地名のクラスベクトル候補を×印503から×印601に補正することが決定される。なお、クラスベクトル候補の適正な位置は、ユーザが任意に決定することができ、具体的には例えば、それぞれの固有名詞の分散表現群におけるベクトルの平均を基に決定されるものでもよいし、何れかの分散表現を基に決定されるものでもよいし、その他の決定方法によるものでもよい。そして、クラスベクトル候補の補正が決定された場合は、クラスベクトル確認部110(あるいは、クラスベクトル確認部110から情報を受信したクラスベクトル生成部113)が、上記決定に従って、新たにクラスベクトル候補を作成する。また、各分散表現群のクラスベクトル候補についてユーザが補正の必要がないと判断した場合は、確認を示す所定の操作が行われることにより、ステップS407で散布図500(または散布図600)に表示したクラスベクトル候補の確認が終了する。 Figure 6 is a diagram showing an example of a screen display when correcting a class vector candidate. The scatter diagram 600 shown in Figure 6 is mostly the same as the scatter diagram 500 in Figure 5, with the addition of a cross mark 601. The cross mark 601 is the position of the place name class vector that the user considers appropriate, and the user performs a predetermined operation to select the cross mark 601 on the scatter diagram 600, and it is determined that the place name class vector candidate is corrected from the cross mark 503 to the cross mark 601. The appropriate position of the class vector candidate can be determined arbitrarily by the user, and specifically, for example, it may be determined based on the average of the vectors in the distributed representation group of each proper noun, or may be determined based on any distributed representation, or may be determined by other determination methods. Then, when the correction of the class vector candidate is determined, the class vector confirmation unit 110 (or the class vector generation unit 113 that receives information from the class vector confirmation unit 110) creates a new class vector candidate according to the above determination. Furthermore, if the user determines that no correction is required for the class vector candidates of each distributed representation group, a predetermined operation indicating confirmation is performed, and confirmation of the class vector candidates displayed in the scatter plot 500 (or scatter plot 600) in step S407 is terminated.

そして、クラスベクトル生成部113は、ステップS407におけるクラスベクトル候補の補正または確認の結果に応じて、最終的に確認された各クラスベクトル候補を、クラスベクトルとしてクラスベクトル記憶部112に登録し(ステップS408)、クラスベクトル生成処理を完了する。なお、ステップS408において、クラスベクトルは、固有名詞種別と対のデータとしてクラスベクトル記憶部112に登録される。この結果、単語分散表現修正部109が、例えば「レストラン」や「地名」といった固有名詞種別をキーとしてクラスベクトル記憶部112を参照することにより、当該固有名詞種別のクラスベクトルを取得できるようになる。 Then, depending on the result of the correction or confirmation of the class vector candidates in step S407, the class vector generation unit 113 registers each of the finally confirmed class vector candidates as a class vector in the class vector storage unit 112 (step S408), and completes the class vector generation process. Note that in step S408, the class vector is registered in the class vector storage unit 112 as data paired with the proper noun type. As a result, the word distributed representation correction unit 109 can obtain the class vector of the proper noun type by referring to the class vector storage unit 112 using the proper noun type, such as "restaurant" or "place name", as a key.

(1-3)分散表現修正処理
図7は、分散表現生成処理の処理手順例を示すフローチャートである。図7に示す分散表現生成処理は、図1に示した文書処理装置100がテキストデータに含まれるテキストを文分散表現に変換する処理である。分散表現生成処理は、図4に示したクラスベクトル作成処理が完了した後の文書処理装置100の運用中に、例えば入力部101にテキストによる入力文(テキストデータ)が入力されるときに実行される。
(1-3) Distributed Representation Modification Processing Fig. 7 is a flowchart showing an example of the processing procedure of the distributed representation generation processing. The distributed representation generation processing shown in Fig. 7 is processing in which the document processing device 100 shown in Fig. 1 converts text included in text data into sentence distributed representations. The distributed representation generation processing is executed, for example, when a text input sentence (text data) is input to the input unit 101 during operation of the document processing device 100 after the class vector creation processing shown in Fig. 4 is completed.

図8は、単語分散表現修正処理の処理手順例を示すフローチャートである。図8に示す単語分散表現修正処理は、図7に示す分散表現生成処理のステップS705の処理に相当し、対象単語抽出部108及び単語分散表現修正部109によって実行される。また、図9は、分散表現生成処理による入力文の処理過程の一例を説明する図である。 Figure 8 is a flowchart showing an example of the processing procedure of the word dispersed representation correction process. The word dispersed representation correction process shown in Figure 8 corresponds to the processing of step S705 of the dispersed representation generation process shown in Figure 7, and is executed by the target word extraction unit 108 and the word dispersed representation correction unit 109. Also, Figure 9 is a diagram explaining an example of the processing process of an input sentence by the dispersed representation generation process.

以下、本実施形態における分散表現生成処理について、図7及び図8のフローチャートに沿って、適宜、図9の具体例を参照しながら詳しく説明する。 The distributed representation generation process in this embodiment will be described in detail below with reference to the flowcharts in Figures 7 and 8, and also with reference to the specific example in Figure 9 as appropriate.

図7によればまず、入力部101がテキストデータである入力文901を読み込む(ステップS701)。図9には、入力文901が「○×△カフェはどこ」というテキストであることが示されている。 According to FIG. 7, first, the input unit 101 reads the input sentence 901, which is text data (step S701). FIG. 9 shows that the input sentence 901 is the text "Where is the ○×△ cafe?"

次に、形態素解析部102が、ステップS701で入力された入力文901の形態素解析を行う(ステップS702)。図9によれば、入力文901は、形態素解析によって、「○×△カフェ」、「は」、「どこ」という3つの形態素(単語)902~904に分割される。また、各形態素902~904には、品詞情報905~907が付与される。具体的には、「○×△カフェ」の形態素902には「固有名詞-レストラン」の品詞情報905が付与され、「は」の形態素903には「助詞」の品詞情報906が付与され、「どこ」の形態素904には「代名詞」の品詞情報907が付与される。 Next, the morpheme analysis unit 102 performs a morpheme analysis on the input sentence 901 input in step S701 (step S702). As shown in FIG. 9, the input sentence 901 is divided by the morpheme analysis into three morphemes (words) 902-904, namely, "○×△ cafe", "wa", and "doko". In addition, part-of-speech information 905-907 is assigned to each morpheme 902-904. Specifically, the morpheme 902 of "○×△ cafe" is assigned part-of-speech information 905 of "proper noun-restaurant", the morpheme 903 of "wa" is assigned part-of-speech information 906 of "particle", and the morpheme 904 of "doko" is assigned part-of-speech information 907 of "pronoun".

次に、形態素解析部102は、事前学習済みニューラル言語モデル104の語彙リストを参照して、形態素902~904をサブワードに分割する(ステップS703)。図9の場合、具体的には、固有名詞の「〇×△カフェ」(形態素902)は、「〇」、「×」、「△」、「カフェ」の4つのトークン908~911にサブワード分割される。また、助詞の「は」(形態素903)及び代名詞の「どこ」(形態素904)は、事前学習済みニューラル言語モデル104の語彙リストに登録されている事前学習済みの単語であって、現状より細かく分割する必要がない単語であるとした場合、サブワードへの分割は行われずに2つのトークン912,913が生成される。 Next, the morpheme analysis unit 102 refers to the vocabulary list of the pre-trained neural language model 104 and divides the morphemes 902 to 904 into subwords (step S703). In the case of FIG. 9, specifically, the proper noun "O x △ cafe" (morpheme 902) is divided into four subword tokens 908 to 911: "O", "X", "△", and "cafe". In addition, if the particle "wa" (morpheme 903) and the pronoun "doko" (morpheme 904) are pre-trained words registered in the vocabulary list of the pre-trained neural language model 104 and do not need to be divided more finely than they are currently, two tokens 912 and 913 are generated without division into subwords.

なお、事前学習済みニューラル言語モデル104の語彙リストは、事前学習済みニューラル言語モデル104の事前学習時に、学習コーパスの出現頻度から学習される。したがって、ステップS703においては、固有名詞であってもサブワードに分割されない場合もあれば、普通名詞であってもサブワードに分割される場合もある。すなわち、事前学習において高頻度で出現した固有名詞であれば、十分な精度が得られていることからサブワードへの分割が不要とされる一方、事前学習における出現頻度が低い普通名詞であれば、十分な精度が得られていないことからサブワードへの分割が行われる。 The vocabulary list of the pre-trained neural language model 104 is learned from the frequency of occurrence in the training corpus during pre-training of the pre-trained neural language model 104. Therefore, in step S703, even proper nouns may not be divided into subwords, and even common nouns may be divided into subwords. That is, if a proper noun appears frequently in pre-training, sufficient accuracy has been obtained and therefore division into subwords is not necessary, whereas if a common noun appears infrequently in pre-training, sufficient accuracy has not been obtained and therefore division into subwords is performed.

次に、単語分散表現生成部105が、ステップS703の処理後のトークン(単語列)908~913をそれぞれ、単語分散表現914~919に変換する(ステップS704)。 Next, the word embedding generation unit 105 converts the tokens (word strings) 908 to 913 after processing in step S703 into word embedding expressions 914 to 919, respectively (step S704).

次に、対象単語抽出部108及び単語分散表現修正部109が、単語分散表現修正処理を実行する(ステップS705)。ステップS705で実行される単語分散表現修正処理は、ステップS702で出力された形態素(単語)902~904のうち、ステップS703で意味をなさないサブワードに分割された単語(本例では固有名詞の単語902)の分散表現を修正し、1つの単語による分散表現を生成する処理であって、前述したように図8にその詳細な処理手順例が示される。以下、図8を参照しながら、単語分散表現修正処理について詳しく説明する。 Next, the target word extraction unit 108 and the word dispersed representation correction unit 109 execute a word dispersed representation correction process (step S705). The word dispersed representation correction process executed in step S705 is a process of correcting the dispersed representation of a word (proper noun word 902 in this example) that was divided into meaningless subwords in step S703, among the morphemes (words) 902 to 904 output in step S702, to generate an dispersed representation of a single word, and as mentioned above, an example of the detailed processing procedure is shown in FIG. 8. The word dispersed representation correction process will be described in detail below with reference to FIG. 8.

図8によれば、まず、対象単語抽出部108が、ステップS702で形態素解析部102が出力した単語902~904のうち、最初の単語902に着目する(ステップS801)。 As shown in FIG. 8, first, the target word extraction unit 108 focuses on the first word 902 among the words 902 to 904 output by the morphological analysis unit 102 in step S702 (step S801).

次に、対象単語抽出部108は、着目した単語902の品詞情報905を参照し、処理対象の固有名詞であるか否かを判定する(ステップS802)。ステップS802の処理は、着目した単語902が、後述するステップS803~S807で行われる単語の分散表現の変換処理の対象とされる単語であるか否かを判定するものであり、この場合、図7のステップS703でサブワードに分割された固有名詞の単語902は、処理対象の単語に相当する。ステップS802において、処理対象の固有名詞である場合は(ステップS802のYES)、ステップS803に進み、処理対象の固有名詞ではない場合は(ステップS802のNO)、後述するステップS808に進む。 Next, the target word extraction unit 108 refers to the part-of-speech information 905 of the focused word 902 and determines whether it is a proper noun to be processed (step S802). The process of step S802 is to determine whether the focused word 902 is a word to be targeted for the word embedding conversion process performed in steps S803 to S807 described below. In this case, the proper noun word 902 divided into subwords in step S703 of FIG. 7 corresponds to the word to be processed. In step S802, if it is a proper noun to be processed (YES in step S802), the process proceeds to step S803, and if it is not a proper noun to be processed (NO in step S802), the process proceeds to step S808 described below.

図9を参照すると、「固有名詞-レストラン」の品詞情報905は固有名詞であることから、ステップS802では「YES」と判定され、ステップS803に進む。ステップS803では、単語分散表現修正部109が、着目した単語902を構成する単語の単語分散表現914~917を単語分散表現生成部105から取得する。前述したように、単語分散表現914~917は、図7のステップS704において、単語分散表現生成部105によって生成されている。 Referring to FIG. 9, since the part of speech information 905 of "proper noun-restaurant" is a proper noun, the result of step S802 is "YES", and the process proceeds to step S803. In step S803, the word hull correction unit 109 obtains word hulls 914 to 917 of the words that make up the focused word 902 from the word hull generation unit 105. As described above, the word hulls 914 to 917 were generated by the word hull generation unit 105 in step S704 of FIG. 7.

次に、単語分散表現修正部109は、ステップS803で取得した単語分散表現914~917に対して、位置ベクトルを合成する(ステップS804)。 Next, the word ambiguity correction unit 109 synthesizes position vectors for the word ambiguities 914 to 917 obtained in step S803 (step S804).

ステップS804の処理を詳しく説明する。まず、単語分散表現修正部109は、位置ベクトル記憶部111から、単語分散表現914~917の各単語に合成する位置ベクトル(図9に示す位置ベクトル920~923)を取得する。図9によれば、位置ベクトル920~923は、順に「P1」、「P2」、「P3」、「P4」と表記されているが、これらは位置の順番を表している。すなわち、位置ベクトル920「P1」は、1番目を示すベクトルであり、位置ベクトル921~923は、それぞれ、2番目、3番目、4番目を示すベクトルである。 The processing of step S804 will be described in detail. First, the word shared expression correction unit 109 obtains from the position vector storage unit 111 the position vectors (position vectors 920 to 923 shown in FIG. 9) to be synthesized with each word of the word shared expressions 914 to 917. In FIG. 9, the position vectors 920 to 923 are written as "P1", "P2", "P3", and "P4" in order, which indicate the order of positions. That is, the position vector 920 "P1" is the vector indicating the first position, and the position vectors 921 to 923 are vectors indicating the second, third, and fourth positions, respectively.

さらにステップS804において、単語分散表現修正部109は、取得した位置ベクトル920~923を単語分散表現914~917に足し合わせる。具体的には、1番目の単語「○」の単語分散表現914には、1番目を示す「P1」の位置ベクトル920が合成され、2番目の単語「×」の単語分散表現915には、2番目を示す「P2」の位置ベクトル921が合成され、3番目、4番目も同様に合成される。上記合成処理は、一意のベクトルを生成するために必要な処理であって、単語分散表現914~917と位置ベクトル920~923との合成を行うことにより、単語902におけるサブワードの語順を維持することができる。 Furthermore, in step S804, the word hull correction unit 109 adds the acquired position vectors 920-923 to the word hulls 914-917. Specifically, the word hull 914 of the first word "○" is synthesized with the position vector 920 of "P1" indicating the first word, and the word hull 915 of the second word "×" is synthesized with the position vector 921 of "P2" indicating the second word, and similarly for the third and fourth words. The above synthesis process is necessary to generate a unique vector, and by synthesizing the word hulls 914-917 with the position vectors 920-923, the word order of the subwords in word 902 can be maintained.

そして、ステップS804においてすべての単語の単語分散表現914~917に位置ベクトル920~923を合成した後、単語分散表現修正部109は、位置ベクトルを合成したこれらの単語分散表現の相加平均を取り、1つの分散表現に合成する(ステップS805)。 Then, after combining the position vectors 920-923 with the word embedded representations 914-917 of all words in step S804, the word embedded representation correction unit 109 takes the arithmetic mean of these word embedded representations with the combined position vectors, and combines them into one embedded representation (step S805).

次に、単語分散表現修正部109は、ステップS805で合成した1つの分散表現と、当該分散表現に対応するクラスベクトル(図9に示すクラスベクトル924)との合成を行う(ステップS806)。 Next, the word distributed representation correction unit 109 combines one distributed representation combined in step S805 with a class vector corresponding to the distributed representation (class vector 924 shown in FIG. 9) (step S806).

ステップS806の処理を詳しく説明すると、まず、単語分散表現修正部109は、品詞情報905をキーとしてクラスベクトル記憶部112を参照し、品詞情報905に対応する「固有名詞-レストラン」のクラスベクトル924を取得する。 To explain the process of step S806 in more detail, first, the word distributed representation correction unit 109 refers to the class vector storage unit 112 using the part-of-speech information 905 as a key, and obtains the class vector 924 of "proper noun-restaurant" that corresponds to the part-of-speech information 905.

さらにステップS806において、単語分散表現修正部109は、ステップS805で生成した分散表現に所定の係数を積算してクラスベクトル924に足しこむ。この所定の係数は、合成した固有名詞の分散表現がクラスベクトルの近傍となるよう調整するためのものである。合成した固有名詞の分散表現がクラスベクトルの近傍となることで、当該クラスの意味を含みながら固有名詞ごとにユニークな分散表現を生成することができる。上記所定の係数は、例えば、次のような方法で決定することができる。まず、図4のクラスベクトル作成処理において、予め、クラスベクトルとクラスベクトルの基となった固有名詞の分散表現とのユークリッド距離の最大値αを求めておく。さらに、クラスごとにすべての固有名詞について図8のステップS803~S805の処理を行って分散表現を求める。そして、それらの平均を算出したうえで、この平均と各分散表現とのユークリッド距離の最大値βを求める。そして、求めたαとβの比率(α/β)を所定の係数とする。 Furthermore, in step S806, the word shared representation correction unit 109 multiplies the shared representation generated in step S805 by a predetermined coefficient and adds the result to the class vector 924. This predetermined coefficient is for adjusting the shared representation of the synthesized proper noun so that it is close to the class vector. By making the shared representation of the synthesized proper noun close to the class vector, it is possible to generate a unique shared representation for each proper noun while including the meaning of the class. For example, the above-mentioned predetermined coefficient can be determined by the following method. First, in the class vector creation process of FIG. 4, the maximum value α of the Euclidean distance between the class vector and the shared representation of the proper noun that is the basis of the class vector is obtained in advance. Furthermore, the processes of steps S803 to S805 of FIG. 8 are performed for all proper nouns for each class to obtain shared representations. Then, the average of these is calculated, and the maximum value β of the Euclidean distance between this average and each shared representation is obtained. Then, the ratio (α/β) of the obtained α and β is set as the predetermined coefficient.

以上のようにして、ステップS806では、単語分散表現修正部109によって合成された分散表現922が生成される。図9に示したように、分散表現922は、「○△×カフェ」という1つの固有名詞の分散表現を表すものとなる。 In this manner, in step S806, the word embedded expression correction unit 109 generates an embedded expression 922 that is synthesized. As shown in FIG. 9, the embedded expression 922 represents an embedded expression of a single proper noun, "○△× cafe."

次に、単語分散表現修正部109は、単語分散表現生成部105が有する単語分散表現914~917を、ステップS806で新たに生成した単語分散表現925に置換し、単語902に対するステップS802以降の処理を完了する(ステップS807)。 Next, the word hull correction unit 109 replaces the word hulls 914 to 917 held by the word hull generation unit 105 with the word hull 925 newly generated in step S806, and completes the processing from step S802 onwards for the word 902 (step S807).

次に、単語分散表現修正部109(あるいは対象単語抽出部108)は、図7のステップS702で形態素解析部102が出力した単語902~904のうちに、未処理の単語(すなわち、ステップS801またはステップS809で着目していない単語)が存在するかを確認する(ステップS808)。未処理の単語が存在する場合には(ステップS808のYES)、そのうちの1つの単語に着目して(ステップS809)、ステップS802以降の処理を繰り返す。一方、未処理の単語が存在しない場合には(ステップS808のNO)、単語分散表現修正処理を終了する。 Next, the word variance correction unit 109 (or the target word extraction unit 108) checks whether there are any unprocessed words (i.e., words not focused on in step S801 or step S809) among the words 902 to 904 output by the morphological analysis unit 102 in step S702 of FIG. 7 (step S808). If there are any unprocessed words (YES in step S808), the processing in steps S802 and after is repeated, focusing on one of the words (step S809). On the other hand, if there are no unprocessed words (NO in step S808), the word variance correction processing is terminated.

具体的には例えば、単語902についてステップS802~S807の処理が終了した後のステップS808では、単語903,904について未処理(未着目)であることから、ステップS809で例えば単語903に着目し、ステップS802の処理が行われる。しかし、単語903の品詞情報906は「助詞」であることから、ステップS802において処理対象の固有名詞ではないと判定され(ステップS802のNO)、特段の変換処理が行われることなく、ステップS808に進む。この結果、図9の例では、ステップS704で単語903から変換された単語分散表現918が単語分散表現926となる。次のステップS808では、単語904が未処理であることから、ステップS809において単語904に着目して、再びステップS802の処理が行われる。但し、単語904もまた、処理対象の固有名詞ではないため、ステップS802でNOと判定され、特段の変換処理が行われることなくステップS808に進む。この結果、図9の例では、ステップS704で単語904から変換された単語分散表現919が単語分散表現927となる。以上の処理を経たステップS808では、未処理の単語が存在しなくなる(すなわち、全ての単語902~904の処理が完了している)ため、ステップS808でNOと判定されて、単語分散表現修正処理は終了する。 Specifically, for example, in step S808 after the processing of steps S802 to S807 for word 902 is completed, since words 903 and 904 have not been processed (not been focused on), the focus is on word 903 in step S809, for example, and the processing of step S802 is performed. However, since the part of speech information 906 of word 903 is "particle," it is determined in step S802 that it is not the proper noun to be processed (NO in step S802), and no special conversion processing is performed, and the process proceeds to step S808. As a result, in the example of FIG. 9, word hull 918 converted from word 903 in step S704 becomes word hull 926. In the next step S808, since word 904 has not been processed, the focus is on word 904 in step S809, and the processing of step S802 is performed again. However, since word 904 is also not a proper noun to be processed, step S802 returns NO, and the process proceeds to step S808 without any special conversion processing being performed. As a result, in the example of FIG. 9, word hull 919 converted from word 904 in step S704 becomes word hull 927. In step S808 after the above processing, there are no more unprocessed words (i.e., processing of all words 902 to 904 has been completed), so step S808 returns NO, and the word hull correction processing ends.

図7の説明に戻る。ステップS705の単語分散表現修正処理が行われた後、文分散表現生成部106が、ステップS705で単語分散表現修正部109によって修正された後の単語分散表現(例えば図9に示した単語分散表現925~927)を合成して、入力文901全体の文分散表現を生成し(ステップS706)、分散表現生成処理を終了する。 Returning to the explanation of FIG. 7, after the word dispersed representation correction process of step S705 has been performed, the sentence dispersed representation generation unit 106 synthesizes the word dispersed representations (e.g., word dispersed representations 925 to 927 shown in FIG. 9) corrected by the word dispersed representation correction unit 109 in step S705 to generate a sentence dispersed representation of the entire input sentence 901 (step S706), and ends the dispersed representation generation process.

以上に説明したように、本実施形態に係る文書処理装置100によれば、図4のクラスベクトル作成処理により、事前学習において十分な意味の精度が得られていない低頻度語(例えば固有名詞)の分散表現について、低頻度語の種別ごとにその種別を代表するクラスベクトルを生成することができる。そして、図7の分散表現生成処理のなかで行われる図8の単語分散修正処理により、入力文に含まれる低頻度語について、低頻度語の分散表現にサブワードの順番を固定する位置ベクトルを合成したうえで上記クラスベクトルと合成することで、低頻度語に十分な意味を付与して低頻度語の単語分散表現を修正(置換)することができる。かくして、文書処理装置100は、図4のクラスベクトル作成処理を経て図7の分散表現生成処理を実行することにより、事前学習において十分な精度が得られていない低頻度語(例えば固有名詞)を含む文に対して、追加学習を行うことなしに、低頻度語の意味を適切に埋め込んだ一意な文分散表現を生成することができる。 As described above, according to the document processing device 100 of this embodiment, the class vector creation process of FIG. 4 can generate a class vector representing each type of low-frequency word for the distributed representation of the low-frequency word (e.g., a proper noun) for which sufficient semantic accuracy has not been obtained in the pre-learning. Then, the word distributed correction process of FIG. 8 performed in the distributed representation generation process of FIG. 7 can correct (replace) the word distributed representation of the low-frequency word by adding sufficient meaning to the low-frequency word by synthesizing a position vector that fixes the order of subwords with the distributed representation of the low-frequency word included in the input sentence and synthesizing it with the class vector. Thus, the document processing device 100 can generate a unique sentence distributed representation in which the meaning of the low-frequency word is appropriately embedded for a sentence including a low-frequency word (e.g., a proper noun) for which sufficient semantic accuracy has not been obtained in the pre-learning, without performing additional learning, by performing the class vector creation process of FIG. 4 and then executing the distributed representation generation process of FIG. 7.

(2)第2の実施形態
第2の実施形態では、絵文字の記号の分散表現について、記号を代表する基準ベクトル(クラスベクトル)を生成し、絵文字の説明文の分散表現とクラスベクトルとを合成して、意味を埋め込んだ記号の分散表現を生成する文書処理装置の例を説明する。本実施形態で扱う絵文字は、事前学習済みの分散表現空間において十分に意味を表すことができない学習不足単語であって、事前学習されていない未知語の一例に相当する。
(2) Second embodiment In the second embodiment, an example of a document processing device will be described in which a reference vector (class vector) representing a symbol is generated for a distributed representation of an emoji symbol, and the distributed representation of an explanation of the emoji and the class vector are combined to generate a distributed representation of the symbol with embedded meaning. The emojis used in this embodiment are under-learned words whose meaning cannot be adequately expressed in a pre-trained distributed representation space, and correspond to an example of an unknown word that has not been pre-trained.

(2-1)構成
図10は、本発明の第2の実施形態に係る文書処理装置1000の機能構成例を示すブロック図である。文書処理装置1000は、第1の実施形態に係る文書処理装置100の構成に、拡張単語ベクトル生成部1003及び拡張単語ベクトル記憶部1004を加えて構成される。なお、文書処理装置1000における対象単語抽出部1001及び単語分散表現修正部1002は、文書処理装置100における対象単語抽出部108及び単語分散表現修正部109に対応する処理部であるが、一部で異なる処理を行うため、新たな符号を付している。
(2-1) Configuration Fig. 10 is a block diagram showing an example of a functional configuration of a document processing device 1000 according to the second embodiment of the present invention. The document processing device 1000 is configured by adding an extended word vector generation unit 1003 and an extended word vector storage unit 1004 to the configuration of the document processing device 100 according to the first embodiment. Note that a target word extraction unit 1001 and a word sparse expression correction unit 1002 in the document processing device 1000 are processing units corresponding to the target word extraction unit 108 and the word sparse expression correction unit 109 in the document processing device 100, but new reference numerals are assigned to them because they perform some different processing.

文書処理装置1000は、第1の実施形態に係る文書処理装置100と同様に、図2に示した文書処理システム200に含まれることができる。また、文書処理装置1000は、第1の実施形態に係る文書処理装置100と同様に、図3に示したハードウェア構成例を有する情報処理装置300で実現される。具体的には、拡張単語ベクトル生成部1003は、プロセッサ301が所定の各種プログラムを読み出して実行することによって実現され、拡張単語ベクトル記憶部1004は、記憶デバイス302によって実現される。 The document processing device 1000 can be included in the document processing system 200 shown in FIG. 2, similar to the document processing device 100 according to the first embodiment. Also, the document processing device 1000 is realized by an information processing device 300 having the hardware configuration example shown in FIG. 3, similar to the document processing device 100 according to the first embodiment. Specifically, the extended word vector generation unit 1003 is realized by the processor 301 reading and executing various predetermined programs, and the extended word vector storage unit 1004 is realized by the storage device 302.

拡張単語ベクトル生成部1003は、拡張単語ベクトルのもととなる単語(未知語であり、本例では絵文字を表す記号)の説明文の文分散表現を文分散表現生成部106を介して取得し、記号としての意味を付与した分散表現(拡張単語ベクトル)を生成して拡張単語ベクトル記憶部1004に登録する。拡張単語ベクトル記憶部1004は、拡張単語ベクトル生成部1003によって生成された拡張単語ベクトルを格納する。拡張単語ベクトルの生成については、後述する図11に示す拡張単語ベクトル作成処理のなかで詳しく説明する。 The extended word vector generation unit 1003 acquires, via the sentence dispersed representation generation unit 106, the sentence explanatory text of the word (an unknown word, in this example, a symbol representing an emoji) that is the basis of the extended word vector, generates dispersed representations (extended word vectors) to which a symbolic meaning is assigned, and registers the generated dispersed representations in the extended word vector storage unit 1004. The extended word vector storage unit 1004 stores the extended word vectors generated by the extended word vector generation unit 1003. The generation of extended word vectors will be described in detail in the extended word vector creation process shown in FIG. 11, which will be described later.

図14は、絵文字の説明文の一例を示す図である。図14には、複数の絵文字1401と各絵文字1401の説明文1402とが、紐付けて示されている。絵文字1401がUNICODEに規定されている絵文字の記号である場合、説明文1402には、対応する記号のUNICODEの説明文が記載される。UNICODEに規定されている絵文字の記号及び説明文は、形態素解析辞書103のシステム辞書に登録されているとする。但し、説明文1402の記載はこれに限定されるものではなく、ユーザが独自に作成してもよい。また、UNICODEに規定された記号以外の記号でも、形態素解析辞書103のユーザ辞書に登録される等により、拡張単語ベクトルの生成対象とすることができる。 Figure 14 is a diagram showing an example of an explanation of an emoji. In Figure 14, multiple emojis 1401 and explanations 1402 for each emoji 1401 are shown linked to each other. If the emoji 1401 is an emoji symbol defined in UNICODE, the explanation 1402 contains the UNICODE explanation of the corresponding symbol. The emoji symbol and explanation defined in UNICODE are registered in the system dictionary of the morphological analysis dictionary 103. However, the description of the explanation 1402 is not limited to this, and the user may create it independently. Furthermore, symbols other than those defined in UNICODE can also be used as targets for generating extended word vectors by being registered in the user dictionary of the morphological analysis dictionary 103, for example.

前述したように、本実施形態では絵文字の記号を拡張単語(未知語)の一例とし、拡張単語ベクトル生成部1003は、事前処理で拡張単語ベクトル作成処理を実行することにより、それぞれの絵文字1401の拡張単語ベクトルを生成し、拡張単語ベクトル記憶部1004に登録する。 As described above, in this embodiment, emoji symbols are used as an example of extended words (unknown words), and the extended word vector generation unit 1003 generates extended word vectors for each emoji 1401 by performing an extended word vector creation process in pre-processing, and registers the generated extended word vectors in the extended word vector storage unit 1004.

(2-2)拡張単語ベクトル作成処理
図11は、拡張単語ベクトル作成処理の処理手順例を示すフローチャートである。図11に示す拡張単語ベクトル作成処理は、第1の実施形態で図4に示したクラスベクトル作成処理と同様に、分散表現生成処理が実行されるよりも前の任意のタイミングで実行される処理であり、文書処理装置1000が拡張単語ベクトルを作成し拡張単語ベクトル記憶部1004に登録する処理である。
(2-2) Extended word vector creation process Fig. 11 is a flowchart showing an example of the processing procedure of the extended word vector creation process. The extended word vector creation process shown in Fig. 11 is a process executed at an arbitrary timing before the execution of the distributed representation generation process, similar to the class vector creation process shown in Fig. 4 in the first embodiment, in which the document processing device 1000 creates extended word vectors and registers them in the extended word vector storage unit 1004.

図11によればまず、クラスベクトル生成部113が、複数の記号(図14の絵文字1401)を代表するクラスベクトルを生成する(ステップS1101)。ステップS1101におけるクラスベクトルの生成手順は、図4に示したクラスベクトル作成処理の処理手順とほぼ同様であり、図4のステップS403では固有名詞の代わりに記号を抽出する。ステップS1101で生成された記号のクラスベクトルは、クラスベクトル記憶部112に登録される。 According to FIG. 11, first, the class vector generation unit 113 generates a class vector representing multiple symbols (emoticons 1401 in FIG. 14) (step S1101). The procedure for generating the class vector in step S1101 is almost the same as the procedure for the class vector creation process shown in FIG. 4, and in step S403 in FIG. 4, symbols are extracted instead of proper nouns. The class vectors of the symbols generated in step S1101 are registered in the class vector storage unit 112.

次に、クラスベクトル生成部113が、ステップS1101で生成した記号のクラスベクトルと各記号の分散表現とのユークリッド距離を算出し、ユークリッド距離の最大値を求める(ステップS1102)。 Next, the class vector generation unit 113 calculates the Euclidean distance between the class vector of the symbol generated in step S1101 and the distributed representation of each symbol, and finds the maximum Euclidean distance (step S1102).

次に、拡張単語ベクトル生成部1003が、入力部101、形態素解析部102、単語分散表現生成部105、及び文分散表現生成部106を介して、絵文字のすべての説明文1402を文分散表現に変換する(ステップS1103)。ステップS1103では、対象とする全ての絵文字1401の説明文1402について、文分散表現への変換を行う。ステップS1103における文分散表現の生成手順は、図7に示した分散表現生成処理と同様である(但し、ステップS705における単語分散表現の修正は行わない)。 Next, the extended word vector generation unit 1003 converts all the explanatory sentences 1402 of the emojis into sentence dispersed representations via the input unit 101, the morphological analysis unit 102, the word dispersed representation generation unit 105, and the sentence dispersed representation generation unit 106 (step S1103). In step S1103, the explanatory sentences 1402 of all the target emojis 1401 are converted into sentence dispersed representations. The procedure for generating sentence dispersed representations in step S1103 is the same as the dispersed representation generation process shown in FIG. 7 (however, the word dispersed representations are not modified in step S705).

次に、拡張単語ベクトル生成部1003は、ステップS1103で作成したすべての説明文の文分散表現の平均を算出する(ステップS1104)。そして、算出したすべての説明文の文分散表現の平均と各説明文の分散表現との間のユークリッド距離を算出し、ユークリッド距離の最大値を求める(ステップS1105)。 Next, the extended word vector generation unit 1003 calculates the average of the sentence variances of all the explanatory sentences created in step S1103 (step S1104). Then, the Euclidean distance between the calculated average of the sentence variances of all the explanatory sentences and the variances of each explanatory sentence is calculated, and the maximum value of the Euclidean distance is obtained (step S1105).

次に、拡張単語ベクトル生成部1003は、ステップS1102で算出した記号分散表現のユークリッド距離の最大値とステップS1105で算出した説明文の文分散表現のユークリッド距離の最大値とを用いて、前者の最大値に対する後者の最大値の比率を求める(ステップS1106)。 Next, the extended word vector generation unit 1003 uses the maximum Euclidean distance of the symbol embedded representation calculated in step S1102 and the maximum Euclidean distance of the sentence embedded representation of the explanatory sentence calculated in step S1105 to calculate the ratio of the latter maximum value to the former maximum value (step S1106).

次に、拡張単語ベクトル生成部1003は、説明文の文分散表現に対して、すべての説明文の分散表現の平均を減算し、ステップS1106で求めたユークリッド距離の比率を積算することにより、各説明文に対応する絵文字の分散表現(拡張単語ベクトル)を生成する(ステップS1107)。 Next, the extended word vector generation unit 1003 subtracts the average of the distributed representations of all the explanatory sentences from the sentence distributed representation of the explanatory sentence, and multiplies the ratio of the Euclidean distances calculated in step S1106 to generate a distributed representation (extended word vector) of the emoji corresponding to each explanatory sentence (step S1107).

最後に、拡張単語ベクトル生成部1003は、ステップS1107で生成した拡張単語ベクトルを拡張単語ベクトル記憶部1004に登録し(ステップS1108)、拡張単語ベクトル作成処理を終了する。 Finally, the extended word vector generation unit 1003 registers the extended word vector generated in step S1107 in the extended word vector storage unit 1004 (step S1108), and ends the extended word vector creation process.

以上のように拡張単語ベクトル作成処理を実行することにより、拡張単語ベクトル生成部1003は、記号としての性質を含みながら、説明文ごと(言い換えれば、説明文に対応する絵文字ごと)にユニークな分散表現(拡張単語ベクトル)を生成することができる。 By executing the extended word vector creation process as described above, the extended word vector generation unit 1003 can generate a unique distributed representation (extended word vector) for each explanatory sentence (in other words, for each emoji corresponding to the explanatory sentence) while incorporating the properties of a symbol.

(2-3)単語分散表現生成処理
第2の実施形態において実行される分散表現生成処理について説明する。本実施形態における分散表現生成処理は、図10に示した文書処理装置1000がテキストデータに含まれるテキストを文分散表現に変換する処理である。本実施形態における分散表現生成処理は、図4に示したクラスベクトル作成処理及び図11に示した拡張単語ベクトル作成処理が完了した後の文書処理装置1000の運用中に、例えば入力部101にテキストによる入力文(テキストデータ)が入力されるときに実行される。なお、第2の実施形態における分散表現生成処理は、大部分は第1の実施形態で図7に示した分散表現生成処理と同様の処理手順で実行され、ステップS705の単語分散表現修正処理が第2の実施形態固有の処理手順で実行される。
(2-3) Word Distributed Representation Generation Process The dispersed representation generation process executed in the second embodiment will be described. The dispersed representation generation process in this embodiment is a process in which the document processing device 1000 shown in FIG. 10 converts text included in text data into sentence dispersed representations. The dispersed representation generation process in this embodiment is executed, for example, when a text input sentence (text data) is input to the input unit 101 during operation of the document processing device 1000 after the class vector creation process shown in FIG. 4 and the extended word vector creation process shown in FIG. 11 are completed. Note that the dispersed representation generation process in the second embodiment is mostly executed in the same processing procedure as the dispersed representation generation process shown in FIG. 7 in the first embodiment, and the word dispersed representation correction process in step S705 is executed in a processing procedure specific to the second embodiment.

図12は、第2の実施形態における単語分散表現修正処理の処理手順例を示すフローチャートである。図12に示す単語分散表現修正処理は、第2の実施形態において図7に示す分散表現生成処理のステップS705の処理に相当し、対象単語抽出部1001及び単語分散表現修正部1002によって実行される。また、図13は、第2の実施形態における分散表現生成処理による入力文の処理過程の一例を説明する図である。 Fig. 12 is a flowchart showing an example of the processing procedure of the word dispersed representation correction process in the second embodiment. The word dispersed representation correction process shown in Fig. 12 corresponds to the processing of step S705 of the dispersed representation generation process shown in Fig. 7 in the second embodiment, and is executed by the target word extraction unit 1001 and the word dispersed representation correction unit 1002. Fig. 13 is a diagram explaining an example of the processing process of an input sentence by the dispersed representation generation process in the second embodiment.

以下、本実施形態における分散表現生成処理について、図7及び図12のフローチャートに沿って、適宜、図13の具体例を参照しながら詳しく説明する。なお、第1の実施形態と共通する図7の処理については、詳細な説明を省略することがある。 The distributed representation generation process in this embodiment will be described in detail below in accordance with the flowcharts in Figs. 7 and 12, with reference to the specific example in Fig. 13 as appropriate. Note that detailed description of the process in Fig. 7 that is common to the first embodiment may be omitted.

分散表現生成処理ではまず、入力部101がテキストデータである入力文1301を読み込む(ステップS701)。図13には、絵文字1302を含むテキストの入力文1301が例示されている。なお、絵文字1302は、図14において「微笑んでいる顔」という説明文1402が付けられた絵文字である。 In the distributed representation generation process, the input unit 101 first reads the input sentence 1301, which is text data (step S701). FIG. 13 shows an example of the input sentence 1301, which is text including an emoji 1302. Note that the emoji 1302 is an emoji to which the description 1402, "smiling face," is added in FIG. 14.

次に、形態素解析部102が、ステップS701で入力された入力文1301の形態素解析を行う(ステップS702)。図13によれば、入力文1301は、形態素解析によって2つの形態素(単語)1303,1304に分割される。また、各形態素1303,1304には、品詞情報1305,1306が付与される。具体的には、形態素1303には「感動詞」の品詞情報1305が付与され、形態素1304には「記号-絵文字」の品詞情報1306が付与される。 Next, the morpheme analysis unit 102 performs a morpheme analysis on the input sentence 1301 input in step S701 (step S702). As shown in FIG. 13, the input sentence 1301 is divided into two morphemes (words) 1303 and 1304 by the morpheme analysis. In addition, part-of-speech information 1305 and 1306 are assigned to each morpheme 1303 and 1304. Specifically, part-of-speech information 1305 of "interjection" is assigned to morpheme 1303, and part-of-speech information 1306 of "symbol-emoji" is assigned to morpheme 1304.

次に、形態素解析部102は、事前学習済みニューラル言語モデル104の語彙リストを参照して、形態素1303,1304をサブワードに分割する(ステップS703)。具体的には、感動詞である形態素1303は、語彙リストに存在することから、サブワードに分割されずに「ありがとう」というトークン1307に変換される。一方、絵文字の記号である形態素1304は、語彙リストに存在しないため、事前学習済みニューラル言語モデル104において未知語を表す特殊トークン「UNK」(トークン1308)に変換される。 Next, the morpheme analysis unit 102 refers to the vocabulary list of the pre-trained neural language model 104 and divides the morphemes 1303 and 1304 into subwords (step S703). Specifically, since the morpheme 1303, which is an interjection, exists in the vocabulary list, it is converted into the token 1307 "thank you" without being divided into subwords. On the other hand, the morpheme 1304, which is an emoji symbol, does not exist in the vocabulary list, so it is converted into the special token "UNK" (token 1308) that represents an unknown word in the pre-trained neural language model 104.

次に、単語分散表現生成部105が、ステップS703の処理後のトークン(単語列)1307,1308をそれぞれ、単語分散表現1309.1310に変換する(ステップS704)。 Next, the word embedding generation unit 105 converts the tokens (word strings) 1307 and 1308 after processing in step S703 into word embedding expressions 1309 and 1310, respectively (step S704).

次に、図12に示す単語分散表現修正処理の処理が実行される(ステップS705)。本実施形態のステップS705で実行される単語分散表現修正処理は、ステップS702で出力された形態素(単語)1303,1304のうち、意味をなさないサブワードに分割された単語(本例では絵文字の単語1304)の分散表現を修正し、1つの単語による分散表現を生成する処理であって、前述したように図12にその詳細な処理手順例が示される。以下、図12を参照しながら、単語分散表現修正処理について詳しく説明する。 Next, the word embedded representation correction process shown in FIG. 12 is executed (step S705). The word embedded representation correction process executed in step S705 in this embodiment is a process of correcting the embedded representation of a word (in this example, the emoji word 1304) that has been divided into meaningless subwords among the morphemes (words) 1303 and 1304 output in step S702, and generating an embedded representation of a single word, and as described above, an example of the detailed processing procedure is shown in FIG. 12. The word embedded representation correction process will be described in detail below with reference to FIG. 12.

図12によれば、まず、対象単語抽出部1001が、ステップS702で出力された単語1303,1304のうち、最初の単語1303に着目する(ステップ1201)。そして、対象単語抽出部1001は、着目した単語1303の品詞情報1305に基づいて、拡張単語ベクトル記憶部1004を参照し、処理対象の単語であるか否かを判定する(ステップS1202)。ステップS1202では、着目した単語1303の拡張単語ベクトルが拡張単語ベクトル記憶部1004に登録されている場合に、処理対象の単語であると判定することができる。ステップS1202において、処理対象の絵文字である場合は(ステップS1202のYES)、ステップS1203に進み、処理対象の絵文字ではない場合は(ステップS1202のNO)、ステップS1207に進む。 According to FIG. 12, first, the target word extraction unit 1001 focuses on the first word 1303 of the words 1303 and 1304 output in step S702 (step 1201). Then, based on the part-of-speech information 1305 of the focused word 1303, the target word extraction unit 1001 refers to the extended word vector storage unit 1004 and determines whether or not the focused word 1303 is a word to be processed (step S1202). In step S1202, if the extended word vector of the focused word 1303 is registered in the extended word vector storage unit 1004, it can be determined that the focused word 1303 is a word to be processed. In step S1202, if the focused word 1303 is an emoji to be processed (YES in step S1202), the process proceeds to step S1203, and if the focused word 1303 is not an emoji to be processed (NO in step S1202), the process proceeds to step S1207.

具体的には、単語1303の場合、品詞情報1305は「感動詞」であることから、ステップS1202では処理対象外と判定され(ステップS1202のNO)、ステップS1207に進む。 Specifically, in the case of word 1303, since the part of speech information 1305 is "interjection", it is determined in step S1202 that it is not to be processed (NO in step S1202), and the process proceeds to step S1207.

ステップS1207では、単語分散表現修正部1002(あるいは対象単語抽出部1001)が、ステップS702で出力された単語1303,1304のうちに、未処理の単語(すなわち、ステップS1201またはステップS1208で着目していない単語)が存在するかを確認する。未処理の単語が存在する場合には(ステップS1207のYES)、そのうちの1つの単語に着目して(ステップS1208)、ステップS1202以降の処理を繰り返す。一方、未処理の単語が存在しない場合には(ステップS1207のNO)、単語分散表現修正処理を終了する。 In step S1207, the word variance correction unit 1002 (or the target word extraction unit 1001) checks whether there are any unprocessed words (i.e., words not focused on in step S1201 or step S1208) among the words 1303, 1304 output in step S702. If there are any unprocessed words (YES in step S1207), the process focuses on one of the words (step S1208) and repeats the process from step S1202 onwards. On the other hand, if there are no unprocessed words (NO in step S1207), the word variance correction process ends.

具体的には、単語1303が着目されている場合には、単語1304に対して未処理であることから、ステップS1207で「NO」と判定され、ステップS1208で単語1304が着目されて、ステップS1202に進む。 Specifically, when word 1303 is the focus, word 1304 has not been processed, so the result of step S1207 is "NO," and word 1304 is focused on in step S1208, and the process proceeds to step S1202.

そして、単語1304が着目されたときのステップS1202では、品詞情報1306は「記号-絵文字」であり、拡張単語ベクトル記憶部1004にその拡張単語ベクトルが登録されていることから、処理対象と判定され(ステップS1202のYES)、ステップS1203に進む。 In step S1202, when word 1304 is focused on, the part-of-speech information 1306 is "symbol-emoji" and the extended word vector is registered in the extended word vector storage unit 1004, so it is determined to be a processing target (YES in step S1202) and the process proceeds to step S1203.

ステップS1203では、単語分散表現修正部1002が、クラスベクトル記憶部112を参照して、ステップS1202で着目した単語1304の記号のクラスベクトル1312を取得する。また、単語分散表現修正部1002は、拡張単語ベクトル記憶部1004を参照し、絵文字(記号)の単語1304に対応する拡張単語ベクトル1311を取得する(ステップS1204)。 In step S1203, the word variance correction unit 1002 refers to the class vector storage unit 112 to obtain the class vector 1312 of the symbol of the word 1304 focused on in step S1202. The word variance correction unit 1002 also refers to the extended word vector storage unit 1004 to obtain the extended word vector 1311 corresponding to the emoji (symbol) word 1304 (step S1204).

次に、単語分散表現修正部1002は、ステップS1204で取得した拡張単語ベクトル1311とステップS1203で取得したクラスベクトル1312とを足し合わせて、絵文字の単語1304の単語分散表現1314を生成する(ステップS1205)。 Next, the word embedded representation correction unit 1002 adds the extended word vector 1311 obtained in step S1204 and the class vector 1312 obtained in step S1203 to generate a word embedded representation 1314 for the emoji word 1304 (step S1205).

次に、単語分散表現修正部1002は、単語分散表現生成部105が有する単語分散表現1310を、ステップS1205で新たに生成した単語分散表現1314に置換する(ステップS1206)。 Next, the word hull correction unit 1002 replaces the word hull 1310 held by the word hull generation unit 105 with the word hull 1314 newly generated in step S1205 (step S1206).

ステップS1206の処理が終了すると、ステップS1207に進むが、この場合は、すべての単語1303,1304に対してステップS1202以降の処理が完了しているため、「NO」と判定され、単語分散表現修正処理は終了する。 When the processing of step S1206 is completed, the process proceeds to step S1207. In this case, however, since the processing from step S1202 onwards has been completed for all words 1303 and 1304, the result is determined to be "NO" and the word embedded expression correction process ends.

図7の説明に戻る。ステップS705の単語分散表現修正処理が行われた後、文分散表現生成部106が、ステップS705で単語分散表現修正部1002によって修正された後の単語分散表現(例えば図13に示した単語分散表現1313,1314)を合成して、入力文1301全体の文分散表現を生成し(ステップS706)、分散表現生成処理を終了する。 Returning to the explanation of FIG. 7, after the word dispersed representation correction process of step S705 has been performed, the sentence dispersed representation generation unit 106 synthesizes the word dispersed representations (e.g., the word dispersed representations 1313 and 1314 shown in FIG. 13) corrected by the word dispersed representation correction unit 1002 in step S705 to generate a sentence dispersed representation of the entire input sentence 1301 (step S706), and ends the dispersed representation generation process.

以上に説明したように、本実施形態に係る文書処理装置1000によれば、図11の拡張単語ベクトル作成処理により、事前学習において十分な意味の精度が得られていない未知語(例えば絵文字の記号)の分散表現について、複数の未知語を代表するクラスベクトルを生成するとともに、複数の未知語の説明文を用いて未知語ごとにユニークな分散表現(拡張単語ベクトル)を生成することができる。そして、図7の分散表現生成処理のなかで行われる図12の単語分散修正処理により、入力文に含まれる未知語について、未知語の分散表現(拡張単語ベクトル)とクラスベクトルとを合成することで、未知語に十分な意味を付与して未知語の単語分散表現を修正(置換)することができる。かくして、文書処理装置1000は、図11のクラスベクトル作成処理を経て図7の分散表現生成処理を実行することにより、事前学習において十分な精度が得られていない未知語(例えば絵文字の記号)を含む文に対して、追加学習を行うことなしに、未知語の意味を適切に埋め込んだ一意な文分散表現を生成することができる。なお、上記説明では絵文字の記号を例としたが、本実施形態に係る文書処理装置1000は、図14に示したように記号に対応する説明文があれば、記号で構成される顔文字などの未知語でも同様に処理を行うことができる。この場合、顔文字は形態素解析辞書103に登録しておくものとする。 As described above, according to the document processing device 1000 of this embodiment, the extended word vector creation process of FIG. 11 generates a class vector representing a plurality of unknown words for a distributed representation of an unknown word (e.g., an emoji symbol) for which sufficient semantic accuracy has not been obtained in pre-learning, and generates a unique distributed representation (extended word vector) for each unknown word using an explanatory text for the plurality of unknown words. Then, the word distributed correction process of FIG. 12 performed in the distributed representation generation process of FIG. 7 combines the distributed representation (extended word vector) of the unknown word and the class vector for the unknown word included in the input sentence, thereby giving sufficient meaning to the unknown word and correcting (replacing) the word distributed representation of the unknown word. Thus, the document processing device 1000 executes the distributed representation generation process of FIG. 7 through the class vector creation process of FIG. 11, and thereby generates a unique sentence distributed representation in which the meaning of the unknown word is appropriately embedded for a sentence including an unknown word (e.g., an emoji symbol) for which sufficient accuracy has not been obtained in pre-learning, without performing additional learning. In the above explanation, emoticon symbols are used as an example, but the document processing device 1000 according to this embodiment can also process unknown words such as emoticons composed of symbols in the same way if there is an explanatory text corresponding to the symbols as shown in FIG. 14. In this case, the emoticons are assumed to be registered in the morphological analysis dictionary 103.

なお、本発明は上記した実施形態に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施形態は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施形態の構成の一部を他の実施形態の構成に置き換えることが可能であり、また、ある実施形態の構成に他の実施形態の構成を加えることも可能である。また、各実施形態の構成の一部について、他の構成の追加・削除・置換をすることが可能である。 The present invention is not limited to the above-described embodiments, but includes various modified examples. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and are not necessarily limited to those having all of the configurations described. It is also possible to replace part of the configuration of one embodiment with the configuration of another embodiment, and it is also possible to add the configuration of another embodiment to the configuration of one embodiment. It is also possible to add, delete, or replace part of the configuration of each embodiment with other configurations.

また、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。 Furthermore, the above-mentioned configurations, functions, processing units, processing means, etc. may be realized in hardware, in part or in whole, for example by designing them as integrated circuits. Furthermore, the above-mentioned configurations, functions, etc. may be realized in software, by a processor interpreting and executing a program that realizes each function. Information on the programs, tables, files, etc. that realize each function can be stored in a memory, a recording device such as a hard disk or SSD (Solid State Drive), or a recording medium such as an IC card, SD card, or DVD.

また、図面において制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際にはほとんど全ての構成が相互に接続されていると考えてもよい。 In addition, the control lines and information lines shown in the drawings are those that are considered necessary for explanation, and do not necessarily show all control lines and information lines on the product. In reality, it can be assumed that almost all components are interconnected.

100,1000 文書処理装置
101 入力部
102 形態素解析部
103 形態素解析辞書
104 事前学習済みニューラル言語モデル
105 単語分散表現生成部
106 文分散表現生成部
107 出力部
108,1001 対象単語抽出部
109,1002 単語分散表現修正部
110 クラスベクトル確認部
111 位置ベクトル記憶部
112 クラスベクトル記憶部
113 クラスベクトル生成部
200 文書処理システム
201 サーバ
202 ネットワーク
203 ユーザ端末
300 情報処理装置
301 プロセッサ
302 記憶デバイス
303 入力デバイス
304 出力デバイス
305 通信インタフェース
306 バス
1003 拡張単語ベクトル生成部
1004 拡張単語ベクトル記憶部
100, 1000 Document processing device 101 Input unit 102 Morphological analysis unit 103 Morphological analysis dictionary 104 Pre-trained neural language model 105 Word distributed representation generation unit 106 Sentence distributed representation generation unit 107 Output unit 108, 1001 Target word extraction unit 109, 1002 Word distributed representation correction unit 110 Class vector confirmation unit 111 Position vector storage unit 112 Class vector storage unit 113 Class vector generation unit 200 Document processing system 201 Server 202 Network 203 User terminal 300 Information processing device 301 Processor 302 Storage device 303 Input device 304 Output device 305 Communication interface 306 Bus 1003 Extended word vector generation unit 1004 Extended word vector storage unit

Claims (9)

外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置であって、
単語の種別ごとの基準ベクトルであるクラスベクトルを記憶するクラスベクトル記憶部と、
前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析部と、
前記形態素解析部よって分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成部と、
前記単語分散表現生成部によって生成された分散表現を修正する単語分散表現修正部と、
を備え、
前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合に、
前記形態素解析部が、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、
前記単語分散表現生成部が、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、
前記単語分散表現修正部が、前記単語分散表現生成部によって生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する
ことを特徴とする文書処理装置。
A document processing device that generates embedded representations of words included in an externally input text,
a class vector storage unit that stores a class vector which is a reference vector for each type of word;
a morphological analysis unit that divides the text into word strings by morphological analysis and assigns information indicating a type to each word string;
a word embedding generation unit that converts the word string divided by the morphological analysis unit into an embedding representation of each word included in the word string;
a word embedding correction unit that corrects the embeddings generated by the word embedding generation unit;
Equipped with
When the text includes a low-frequency word whose occurrence frequency in pre-learning is lower than a predetermined level,
The morphological analysis unit divides the text into word strings by morphological analysis, and then further divides the low-frequency words included in the word strings into subwords of partial character strings;
The word embedding generation unit converts the low-frequency word into a plurality of embedding expressions including embedding expressions for the subwords included in the low-frequency word;
the word variance correction unit combines a position vector that fixes the order of the subwords in the low-frequency word with a plurality of variance expressions of the low-frequency word generated by the word variance generation unit, combines the position vector with the class vector of the type to which the low-frequency word belongs, and replaces the variance expression after the combination as the variance expression of the low-frequency word.
前記低頻度語が属する種別ごとに、同一種別に属する複数の前記低頻度語の分散表現に基づいて、各種別のクラスベクトルを生成し、当該生成したクラスベクトルを前記クラスベクトル記憶部に登録するクラスベクトル生成部を、さらに備える
ことを特徴とする請求項1に記載の文書処理装置。
2. The document processing device according to claim 1, further comprising a class vector generation unit that generates, for each type to which the low-frequency words belong, a class vector for each type based on a distributed representation of the low-frequency words belonging to the same type, and registers the generated class vector in the class vector storage unit.
前記クラスベクトル生成部は、
同一種別に属する複数の前記低頻度語のうちの1つの単語に対して前記単語分散表現生成部によって生成された分散表現、または同一種別に属する複数の前記低頻度語に対して前記単語分散表現生成部によってそれぞれ生成された分散表現の平均を、前記低頻度語が属する種別のクラスベクトルとして生成する
ことを特徴とする請求項2に記載の文書処理装置。
The class vector generation unit
The document processing device according to claim 2, characterized in that an average of a distributed representation generated by the word distributed representation generation unit for one word among a plurality of the low-frequency words belonging to the same type, or a distributed representation generated by the word distributed representation generation unit for a plurality of the low-frequency words belonging to the same type, is generated as a class vector of the type to which the low-frequency word belongs.
前記単語分散表現修正部は、
前記単語分散表現生成部が生成した前記低頻度語の分散表現に、合成後の分散表現が前記クラスベクトルの近傍となるように調整するための所定の係数を積算した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する
ことを特徴とする請求項3に記載の文書処理装置。
The word embedding correction unit,
The document processing device according to claim 3, characterized in that the distributed representation of the low-frequency word generated by the word distributed representation generation unit is multiplied by a predetermined coefficient for adjusting the distributed representation after synthesis so that the distributed representation after synthesis is in the vicinity of the class vector, and then synthesized with the class vector of the type to which the low-frequency word belongs, and the distributed representation after synthesis is replaced as the distributed representation of the low-frequency word.
前記クラスベクトル生成部によって生成された、前記低頻度語が属する種別のクラスベクトルをクラスベクトル候補として出力してユーザによる確認を要求し、ユーザから補正の要求がなされた場合には当該要求に従って前記クラスベクトル候補を補正するクラスベクトル確認部をさらに備え、
前記クラスベクトル生成部は、前記クラスベクトル確認部で補正または確認された前記クラスベクトル候補を、前記低頻度語が属する種別のクラスベクトルとして前記クラスベクトル記憶部に登録する
ことを特徴とする請求項2に記載の文書処理装置。
a class vector confirmation unit that outputs the class vector of the type to which the low-frequency word belongs, generated by the class vector generation unit, as a class vector candidate and requests a user to confirm it, and when a correction request is made by the user, corrects the class vector candidate in accordance with the request;
3 . The document processing device according to claim 2 , wherein the class vector generating unit registers the class vector candidate corrected or confirmed by the class vector confirming unit in the class vector storage unit as a class vector of a type to which the low-frequency word belongs.
前記テキストを構成する前記単語列に含まれる各単語に対して、前記単語分散表現生成部または前記単語分散表現修正部によって生成された前記分散表現を合成することにより、前記テキスト全体の分散表現を生成する文分散表現生成部と、
前記文分散表現生成部が生成した前記テキスト全体の分散表現を出力する出力部と、をさらに備える
ことを特徴とする請求項1に記載の文書処理装置。
a sentence embedded representation generation unit that generates an embedded representation of the entire text by synthesizing the embedded representations generated by the word embedded representation generation unit or the word embedded representation correction unit for each word included in the word string that constitutes the text; and
The document processing device according to claim 1 , further comprising: an output unit that outputs the distributed representations of the entire text generated by the sentence distributed representation generation unit.
前記低頻度語が属する種別ごとに、同一種別に属する複数の前記低頻度語の分散表現に基づいて、各種別のクラスベクトルを生成し、当該生成したクラスベクトルを前記クラスベクトル記憶部に登録するクラスベクトル生成部を、さらに備え、
事前学習されていない複数の未知語のそれぞれに対する説明文が保持され、
前記クラスベクトル生成部が、前記未知語が属する種別ごとに、同一種別に属する前記未知語の分散表現に基づいて、各種別のクラスベクトルを生成し、当該生成したクラスベクトルを前記クラスベクトル記憶部に登録し、
前記文分散表現生成部が、前記複数の未知語に対する複数の説明文を分散表現に変換し、
前記複数の説明文の分散表現と、各々の未知語に対する説明文の分散表現との比較に基づいて、各未知語の分散表現を生成する拡張単語ベクトル生成部と、
前記拡張単語ベクトル生成部によって生成された各未知語の分散表現を記憶する拡張単語ベクトル記憶部と、
をさらに備え、
前記テキストに何れかの前記未知語が含まれる場合に、
前記形態素解析部が、前記テキストを単語列に分割した後、前記単語列に含まれる前記未知語を所定のトークンに変換し、
前記単語分散表現生成部が、前記所定のトークンの分散表現を生成し、
前記単語分散表現修正部は、前記拡張単語ベクトル記憶部に記憶された前記未知語の前記分散表現と前記クラスベクトル記憶部に記憶された当該未知語が属する種別の前記クラスベクトルとを合成し、当該合成後の分散表現を、当該未知語の分散表現とする
ことを特徴とする請求項6に記載の文書処理装置。
a class vector generating unit that generates a class vector for each type to which the low-frequency words belong based on a distributed representation of a plurality of the low-frequency words belonging to the same type, and registers the generated class vector in the class vector storage unit;
An explanation for each of a plurality of unknown words that have not been pre-trained is maintained,
the class vector generation unit generates a class vector for each type to which the unknown words belong based on a distributed representation of the unknown words belonging to the same type, and registers the generated class vector in the class vector storage unit;
the sentence embedded representation generation unit converts a plurality of explanatory sentences for the plurality of unknown words into embedded representations;
an extended word vector generation unit that generates a distributed representation of each unknown word based on a comparison between the distributed representations of the plurality of explanatory sentences and a distributed representation of an explanatory sentence for each unknown word;
an extended word vector storage unit that stores the distributed representations of each unknown word generated by the extended word vector generation unit;
Further equipped with
If the text contains any of the unknown words,
the morphological analysis unit divides the text into word strings, and then converts the unknown words included in the word strings into predetermined tokens;
the word embedding generation unit generates embedding expressions of the predetermined tokens,
The document processing device according to claim 6, characterized in that the word embedded representation correction unit combines the embedded representation of the unknown word stored in the extended word vector storage unit with the class vector of the type to which the unknown word belongs stored in the class vector storage unit, and sets the embedded representation after the combination as the embedded representation of the unknown word.
外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置による文書制御方法であって、
前記文書処理装置は、単語の種別ごとの基準ベクトルであるクラスベクトルを記憶しており、
前記文書処理装置が、前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析ステップと、
前記文書処理装置が、前記形態素解析ステップで分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成ステップと、
前記文書処理装置が、前記単語分散表現生成ステップで生成された分散表現を修正する単語分散表現修正ステップと、
を備え、
前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合に、
前記形態素解析ステップにおいて、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、
前記単語分散表現生成ステップにおいて、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、
前記単語分散表現修正ステップにおいて、前記単語分散表現生成ステップで生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する
ことを特徴とする文書処理方法。
A document control method using a document processing device that generates embedded representations of words included in an externally input text, comprising:
The document processing device stores a class vector, which is a reference vector for each type of word,
a morphological analysis step in which the document processing device divides the text into word strings by morphological analysis and assigns information indicating a type to each word string;
a word embedding generation step of converting the word string divided in the morphological analysis step into an embedding representation of each word included in the word string;
a word embedding correction step of correcting the embeddings generated in the word embedding generation step by the document processing device;
Equipped with
When the text includes a low-frequency word whose occurrence frequency in pre-learning is lower than a predetermined level,
In the morphological analysis step, after dividing the text into word strings by morphological analysis, the low frequency words included in the word strings are further divided into subwords of partial strings;
In the word embedding step, the low-frequency word is converted into a plurality of embedding expressions each including an embedding expression for each of the subwords included in the low-frequency word;
a word variance correction step of generating a word variance representation for each low-frequency word, the word variance representation for each low-frequency word, and a position vector for fixing the order of the subwords in the low-frequency word are combined with the class vector of the type to which the low-frequency word belongs, and the combined variance representation is replaced as the variance representation of the low-frequency word.
外部から入力されたテキストに含まれる単語の分散表現を生成する文書処理装置を構成する計算機に実行させる文書制御プログラムであって、
前記文書処理装置には、単語の種別ごとの基準ベクトルであるクラスベクトルが記憶され、
前記テキストを形態素解析によって単語列に分割し、各単語列が属する種別を示す情報を付与する形態素解析処理と、
前記形態素解析処理で分割された前記単語列を当該単語列に含まれる単語ごとの分散表現に変換する単語分散表現生成処理と、
前記単語分散表現生成処理で生成された分散表現を修正する単語分散表現修正処理と、
を前記計算機に実行させ、
前記テキストに事前学習における出現頻度が所定程度よりも低い低頻度語が含まれる場合には、
前記形態素解析処理において、前記テキストを形態素解析によって単語列に分割した後、前記単語列に含まれる前記低頻度語を部分文字列のサブワードにさらに分割し、
前記単語分散表現生成処理において、前記低頻度語を、当該低頻度語に含まれる前記サブワードごとの分散表現からなる複数の分散表現に変換し、
前記単語分散表現修正処理において、前記単語分散表現生成処理で生成された前記低頻度語の複数の分散表現に、当該低頻度語における前記サブワードの順番を固定する位置ベクトルを合成した上で、当該低頻度語が属する種別の前記クラスベクトルと合成し、当該合成後の分散表現を、当該低頻度語の分散表現として置換する
ことを特徴とする文書処理プログラム。
A document control program to be executed by a computer constituting a document processing device that generates embedded representations of words included in an externally input text, the document control program comprising:
The document processing device stores a class vector, which is a reference vector for each type of word,
a morphological analysis process for dividing the text into word strings by morphological analysis and adding information indicating the type to which each word string belongs;
a word embedding generation process for converting the word string divided by the morphological analysis process into an embedding representation for each word included in the word string;
a word embedding correction process for correcting the embeddings generated in the word embedding generation process;
causing the computer to execute the
When the text includes a low-frequency word whose occurrence frequency in the pre-learning is lower than a predetermined level,
In the morphological analysis process, after dividing the text into word strings by morphological analysis, the low frequency words included in the word strings are further divided into subwords of partial strings;
In the word embedded representation generation process, the low-frequency word is converted into a plurality of embedded representations including embedded representations for each of the subwords included in the low-frequency word;
a position vector that fixes the order of the subwords in the low-frequency word is synthesized with the multiple embedded representations of the low-frequency word generated in the word embedded representation generation process, and then the position vector is synthesized with the class vector of the type to which the low-frequency word belongs, and the embedded representation after the synthesis is replaced as the embedded representation of the low-frequency word.
JP2021144245A 2021-09-03 2021-09-03 Document processing device, document processing method, and document processing program Active JP7705314B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021144245A JP7705314B2 (en) 2021-09-03 2021-09-03 Document processing device, document processing method, and document processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021144245A JP7705314B2 (en) 2021-09-03 2021-09-03 Document processing device, document processing method, and document processing program

Publications (2)

Publication Number Publication Date
JP2023037468A JP2023037468A (en) 2023-03-15
JP7705314B2 true JP7705314B2 (en) 2025-07-09

Family

ID=85509190

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021144245A Active JP7705314B2 (en) 2021-09-03 2021-09-03 Document processing device, document processing method, and document processing program

Country Status (1)

Country Link
JP (1) JP7705314B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021009538A (en) 2019-07-01 2021-01-28 株式会社野村総合研究所 Natural language processor and natural language processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021009538A (en) 2019-07-01 2021-01-28 株式会社野村総合研究所 Natural language processor and natural language processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
金田健太郎 他2名,単語,語義,概念:意味タスクにおける分散表現の適用性,一般社団法人人工知能学会第31回全国大会論文集DVD[DVD-ROM],一般社団法人人工知能学会,2017年05月23日

Also Published As

Publication number Publication date
JP2023037468A (en) 2023-03-15

Similar Documents

Publication Publication Date Title
Pakray et al. Natural language processing applications for low-resource languages
JP5128629B2 (en) Part-of-speech tagging system, part-of-speech tagging model training apparatus and method
JP7335300B2 (en) Knowledge pre-trained model training method, apparatus and electronic equipment
JP5513898B2 (en) Shared language model
JP7287062B2 (en) Translation method, translation program and learning method
JP7103264B2 (en) Generation device, learning device, generation method and program
CN115039171A (en) Language independent multi-lingual modeling using efficient text normalization
WO2003065245A1 (en) Translating method, translated sentence outputting method, recording medium, program, and computer device
KR102284903B1 (en) Mehtod and apparatus for input sequence
JP2010520531A (en) Integrated pinyin and image input
JP6778655B2 (en) Word concatenation discriminative model learning device, word concatenation detection device, method, and program
Kirov et al. Context-aware transliteration of romanized South Asian languages
KR102476104B1 (en) Construction device for pre-trained language model, expanding vocabulary method of pre-trained language model
CN113822044B (en) Grammar error correction data generating method, device, computer equipment and storage medium
Yasin et al. Transformer-based neural machine translation for post-OCR error correction in cursive text
Ohm et al. Study of Tokenization Strategies for the Santhali Language
JP2020030379A (en) Recognition result correction device, recognition result correction method, and program
JP6325789B2 (en) Translation apparatus and translation program
Jamro Sindhi language processing: A survey
JP7705314B2 (en) Document processing device, document processing method, and document processing program
JP2019159743A (en) Correspondence generation program, correspondence generation device, correspondence generation method, and translation program
Musaev et al. Text processing technology in Uzbek speech to sign language translation systems
Lauc et al. AyutthayaAlpha: A Thai-Latin script transliteration transformer
Gutkin et al. Extensions to Brahmic script processing within the Nisaba library: new scripts, languages and utilities
Melinamath Rule based methodology for recognition of Kannada named entities

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20240202

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240918

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20241001

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20241121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20250311

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20250327

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: 20250603

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20250627

R150 Certificate of patent or registration of utility model

Ref document number: 7705314

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150