JP6773585B2 - Document processing equipment, document processing methods and programs - Google Patents
Document processing equipment, document processing methods and programs Download PDFInfo
- Publication number
- JP6773585B2 JP6773585B2 JP2017031043A JP2017031043A JP6773585B2 JP 6773585 B2 JP6773585 B2 JP 6773585B2 JP 2017031043 A JP2017031043 A JP 2017031043A JP 2017031043 A JP2017031043 A JP 2017031043A JP 6773585 B2 JP6773585 B2 JP 6773585B2
- Authority
- JP
- Japan
- Prior art keywords
- document
- dependency relationship
- unit
- importance
- dependency
- 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
Links
Images
Landscapes
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、文書ベクトルを生成するための装置、方法及びプログラムに関する。 The present invention relates to devices, methods and programs for generating document vectors.
従来、自然言語処理の分野において、文書の内容を定量的に表す表現として文書ベクトルが知られている。例えば、非特許文献1には、文書検索技術として、検索対象となる各文書をTF−IDF法を用いて文書ベクトルとして表現し、質問文書の文書ベクトルとのコサイン類似度を算出することによって類似度の高い文書を検索するという方法が記載されている。文書ベクトルは、文書検索以外にも文書分類や質問応答等の他の自然言語処理技術においても利用されている。
Conventionally, in the field of natural language processing, a document vector is known as an expression that quantitatively expresses the contents of a document. For example, in
しかし、従来の文書ベクトルは、文書中に出現する個々の単語の頻度情報しか考慮しないことから、出現する単語が共通する文書間では、単語間の係り受け構造が異なっていたとしても同一の文書ベクトルになってしまうという問題があった。 However, since the conventional document vector considers only the frequency information of individual words appearing in the document, the same document is used even if the dependency structure between the words is different between the documents having the same appearing words. There was a problem that it became a vector.
本発明は、このような事情に鑑みてなされたものであり、文書中に出現する単語間の係り受け構造を反映した文書ベクトルを生成することを目的とする。 The present invention has been made in view of such circumstances, and an object of the present invention is to generate a document vector that reflects a dependency structure between words appearing in a document.
上記の課題を解決するため、本発明に係る文書処理装置は、文書集合を構成する各文書を解析して単語を抽出する解析部と、前記文書集合を構成する各文書について、前記解析部により抽出された各単語の係り受け関係を抽出する係り受け関係抽出部と、前記文書集合を構成する一の対象文書において、前記係り受け関係抽出部により抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出部により算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記出現頻度算出部により算出された頻度に、前記逆文書頻度算出部により算出された逆文書頻度を乗じて重要度を算出する重要度算出部と、前記解析部により抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出部により算出された重要度が割り当てられた行列を生成する重要度行列生成部と、前記重要度行列生成部により生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成部とを備える。 In order to solve the above problems, the document processing apparatus according to the present invention has an analysis unit that analyzes each document that constitutes the document set and extracts words, and the analysis unit that analyzes each document that constitutes the document set. In the dependency relationship extraction unit that extracts the dependency relations of each extracted word and the one target document that constitutes the document set, the frequency of occurrence of each dependency relation extracted by the dependency relation extraction unit appears. And the appearance frequency calculation unit that calculates the number of documents in which the dependency relationship appears in the document set for each dependency relationship extracted by the dependency relationship extraction unit for the target document. For each dependency relationship extracted by the dependency relationship extraction unit for the target document, the reverse document is obtained by dividing the number of documents constituting the document set by the number of documents calculated by the appearance document number calculation unit. For each dependency relationship extracted by the dependency relationship extraction unit for the target document and the inverse document frequency calculation unit for calculating the frequency, the frequency calculated by the appearance frequency calculation unit is added to the frequency calculated by the inverse document frequency calculation unit. The importance calculation unit that calculates the importance by multiplying the calculated inverse document frequency, and the matrix in which each word extracted by the analysis unit is associated with rows and columns, and the dependency on the target document. For each dependency relationship extracted by the relationship extraction unit, the importance of the dependency relationship as a component corresponding to one row and the other column of the original word and the destination word constituting the dependency relationship. A document vector of the target document is generated by concatenating each component of the matrix generated by the importance matrix generation unit and the importance matrix generation unit that generates the matrix to which the importance calculated by the calculation unit is assigned. It includes a document vector generator.
好ましい態様において、上記の文書処理装置は、前記重要度行列生成部により生成された行列の次元を、所定の次元圧縮方法を用いて圧縮する次元圧縮部をさらに備え、前記文書ベクトル生成部は、前記次元圧縮部により次元を圧縮された行列の各成分を連結して前記対象文書の文書ベクトルを生成する。 In a preferred embodiment, the document processing apparatus further comprises a dimension compression unit that compresses the dimensions of the matrix generated by the importance matrix generation unit using a predetermined dimension compression method, and the document vector generation unit A document vector of the target document is generated by concatenating each component of the matrix whose dimensions are compressed by the dimension compression unit.
さらに好ましい態様において、上記の文書処理装置は、前記文書ベクトル生成部により生成された前記対象文書の文書ベクトルと、他の文書について前記文書ベクトル生成部により生成された文書ベクトルとに基づいて、所定の類似度計算方法を用いて、前記対象文書と前記他の文書の類似度を判定する類似度判定部をさらに備える。 In a more preferred embodiment, the document processing apparatus determines the document vector of the target document generated by the document vector generation unit and the document vector generated by the document vector generation unit for other documents. A similarity determination unit for determining the similarity between the target document and the other document is further provided by using the similarity calculation method of.
また、本発明に係る文書処理方法は、文書処理装置により実行される文書処理方法であって、文書集合を構成する各文書を解析して単語を抽出する解析ステップと、前記文書集合を構成する各文書について、前記解析ステップにより抽出された各単語の係り受け関係を抽出する係り受け関係抽出ステップと、前記文書集合を構成する一の対象文書において、前記係り受け関係抽出ステップにより抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出ステップと、前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出ステップと、前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出ステップにより算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出ステップと、前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記出現頻度算出ステップにより算出された頻度に、前記逆文書頻度算出ステップにより算出された逆文書頻度を乗じて重要度を算出する重要度算出ステップと、前記解析ステップにより抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出ステップにより算出された重要度が割り当てられた行列を生成する重要度行列生成ステップと、前記重要度行列生成ステップにより生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成ステップとを備える。 Further, the document processing method according to the present invention is a document processing method executed by a document processing apparatus, and constitutes an analysis step of analyzing each document constituting the document set and extracting words, and the document set. For each document, each of the dependency relationship extraction step for extracting the dependency relationship of each word extracted by the analysis step and the dependency relationship extraction step for one target document constituting the document set. For the appearance frequency calculation step for calculating the appearance frequency at which the dependency relationship appears, and for each dependency relationship extracted by the dependency relationship extraction step for the target document, the number of documents in which the dependency relationship appears in the document set is calculated. For each dependency relationship extracted by the dependency relationship extraction step for the target document and the appearance document number calculation step to be calculated, the number of documents constituting the document set is calculated by the appearance document number calculation step. The reverse document frequency calculation step for calculating the reverse document frequency by dividing by the number of, and the frequency calculated by the appearance frequency calculation step for each dependency relationship extracted by the dependency relationship extraction step for the target document. , The importance calculation step of multiplying the reverse document frequency calculated by the reverse document frequency calculation step to calculate the importance, and the matrix in which each word extracted by the analysis step is associated with rows and columns. As a component corresponding to one row and the other column of the dependency word and the dependency word constituting the dependency relationship for each dependency relationship extracted by the dependency relationship extraction step for the target document. The importance matrix generation step for generating a matrix to which the importance calculated by the importance calculation step is assigned to the dependency relationship and each component of the matrix generated by the importance matrix generation step are connected to each other. It includes a document vector generation step for generating a document vector of the target document.
また、本発明に係るプログラムは、コンピュータを、文書集合を構成する各文書を解析して単語を抽出する解析部と、前記文書集合を構成する各文書について、前記解析部により抽出された各単語の係り受け関係を抽出する係り受け関係抽出部と、前記文書集合を構成する一の対象文書において、前記係り受け関係抽出部により抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出部により算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出部と、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記出現頻度算出部により算出された頻度に、前記逆文書頻度算出部により算出された逆文書頻度を乗じて重要度を算出する重要度算出部と、前記解析部により抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出部により算出された重要度が割り当てられた行列を生成する重要度行列生成部と、前記重要度行列生成部により生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成部として機能させる。 Further, in the program according to the present invention, the computer has an analysis unit that analyzes each document constituting the document set and extracts words, and each word extracted by the analysis unit for each document constituting the document set. Frequency of occurrence of calculating the frequency of appearance of each dependency extracted by the dependency extraction unit in the dependency relationship extraction unit that extracts the dependency relationship and one target document that constitutes the document set. Regarding the calculation unit, the appearance document number calculation unit that calculates the number of documents in which the dependency relationship appears in the document set, and the target document for each dependency relationship extracted by the dependency relationship extraction unit for the target document. For each dependency relationship extracted by the dependency relationship extraction unit, the inverse document frequency is calculated by dividing the number of documents constituting the document set by the number of documents calculated by the appearance document number calculation unit. For the document frequency calculation unit and each dependency relationship extracted by the dependency relationship extraction unit for the target document, the frequency calculated by the appearance frequency calculation unit is the reverse document calculated by the reverse document frequency calculation unit. An importance calculation unit that calculates the importance by multiplying the frequency, and a matrix in which each word extracted by the analysis unit is associated with rows and columns, and the target document is extracted by the dependency relationship extraction unit. For each of the dependency relationships, the importance calculation unit calculates the dependency relationships as components corresponding to one row and the other column of the original word and the destination word that make up the dependency relationship. As a document vector generation unit that generates a document vector of the target document by concatenating each component of the matrix generated by the importance matrix generation unit and the importance matrix generation unit that generates a matrix to which the importance is assigned. Make it work.
本発明によれば、文書中に出現する単語間の係り受け構造を反映した文書ベクトルを生成することができる。 According to the present invention, it is possible to generate a document vector that reflects the dependency structure between words appearing in the document.
1.実施形態
1−1.構成
図1は、本発明の一実施形態に係る文書処理装置1の構成の一例を示す図である。文書処理装置1は、CPU等の演算処理装置と、HDD等の記憶装置と、NIC等の通信装置を備え、文書データベース2からインターネット等の通信回線3を介して文書を取得して、当該文書について文書ベクトルを生成するためのコンピュータである。文書処理装置1は、文書入力部101と、形態素解析部102と、係り受け解析部103と、係り受け関係抽出部104と、係り受け関係記憶部105と、出現頻度算出部106と、出現文書数算出部107と、重要度算出部108と、重要度行列生成部109と、文書ベクトル生成部110と、文書ベクトル記憶部111という機能を備える。これらの機能のうち、文書入力部101は通信装置により実現され、係り受け関係記憶部105と文書ベクトル記憶部111は記憶装置により実現され、その他の機能は、記憶装置に記憶されるプログラムを演算処理装置が実行することにより実現される。なお、文書処理装置1は、通信回線3により相互に接続される複数のサーバ装置により構成されてもよい。
1. 1. Embodiment 1-1. Configuration FIG. 1 is a diagram showing an example of the configuration of the
文書処理装置1が備える機能のうち、文書入力部101は、文書データベース2に記憶される文書データを、通信回線3を介して取得する。
Among the functions provided in the
形態素解析部102は、文書入力部101により取得された文書データにより表される文書を形態素解析して、当該文書を構成する単語を抽出する。形態素解析には、例えば、MeCab(http://taku910.github.io/mecab/)や、KyTea(http://www.phontron.com/kytea/)等の周知の形態素解析器を使用してよい。形態素解析部102は、本発明に係る「解析部」の一例である。
The
係り受け解析部103は、形態素解析部102による解析結果に基づいて係り受け解析を行い、処理対象の文書を構成する各文節の係り受け構造(言い換えると係り受け木)を抽出する。係り受け解析には、例えば、CaboCha(https://taku910.github.io/cabocha/)や、KNP(http://nlp.ist.i.kyoto-u.ac.jp/index.php?KNP)等の周知の係り受け解析器を使用してよい。
The
係り受け関係抽出部104は、係り受け解析部103による解析結果を参照して、処理対象の文書について、特定の品詞の単語からなる係り受け関係を抽出する。ここで特定の品詞とは、名詞、形容詞又は動詞である。係り受け関係を抽出すると、当該係り受け関係を構成する各単語に単語IDを付与する。その際、同じ単語には同じ単語IDが付与される。各単語に単語IDを付与すると、係り受け関係を構成する係り元と係り先の単語と、それらの単語に付与された単語IDの組とを対応付けて係り受け関係記憶部105に記録する。
The dependency
出現頻度算出部106は、係り受け関係記憶部105を参照して、処理対象の文書において特定された各係り受け関係が当該文書において出現する出現頻度(言い換えると出現回数)を算出する。係り受け関係について出願頻度を算出すると、算出した出現頻度を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。なお、出現頻度の算出後、係り受け関係記憶部105に重複して登録されている係り受け関係については、そのレコードを削除してよい。
The appearance
出現文書数算出部107は、係り受け関係記憶部105を参照して、処理対象の文書において特定された各係り受け関係について、文書集合において係り受け関係が出現する文書数を算出する。係り受け関係について文書数を算出すると、算出した文書数を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。
The appearance document
重要度算出部108は、係り受け関係記憶部105を参照して、処理対象の文書において特定された各係り受け関係について、数1の式を用いて重要度を算出する。
数1の式において、Wは重要度を表し、mは、出現頻度算出部106により算出される出現頻度を表し、Nは文書集合を構成する文書数を表し、nは、出現文書数算出部107により算出される文書数を表す。なおここでlogは常用対数である。重要度算出部108は、数1の式に表されるように、文書集合を構成する文書数を、出現文書数算出部107により算出される文書数で除して逆文書頻度を算出し、この逆文書頻度に「1」を加算して対数をとって得た値に、出現頻度算出部106により算出される出現頻度を乗ずることで重要度を算出する。係り受け関係について重要度を算出すると、算出した重要度を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。重要度算出部108は、本発明に係る「逆文書頻度算出部」と「重要度算出部」の一例である。
In the formula of
重要度行列生成部109は、係り受け関係記憶部105を参照して、処理対象の文書について重要度行列を生成する。この重要度行列は、文書集合から抽出された係り受け関係を構成する各単語が行及び列に対応付けられた行列であって、処理対象の文書において特定された各係り受け関係について、係り受け関係を構成する係り元の単語の行と係り先の列に対応する成分として当該係り受け関係の重要度が割り当てられた行列である。重要度が割り当てられない要素には「0」が割り当てられる。
The importance
文書ベクトル生成部110は、重要度行列生成部109により生成された重要度行列の各行ベクトルを連結して文書ベクトルを生成する。文書ベクトルを生成すると、当該文書ベクトルが生成された文書の文書IDと対応付けて文書ベクトル記憶部111に記録する。
The document
1−2.動作
文書処理装置1により実行される文書処理方法について説明する。具体的には文書ベクトル生成処理について説明する。図2は、文書ベクトル生成処理の一例を示すフロー図である。なお、本動作例の説明では、20件の文書からなる文書集合Dを処理する場合を想定する。
1-2. The document processing method executed by the operation
文書入力部101により文書集合Dのデータが取得されると、形態素解析部102は、文書集合Dのうち、処理対象の文書を形態素解析して、当該文書を構成する単語を抽出する(S1)。図3は、処理対象の文書が、「季節に関係なく花が咲く植物を教えて。」という一文のみにより構成される文書(以下、「文書A」)であった場合に形態素解析部102により出力される解析結果の一例を示す図である。同図に示す解析結果の各行は、単語の表層形、品詞、品詞細分類1、品詞細分類2、品詞細分類3、活用型、活用形、原形、読み及び発音により構成される。アスタリスクは、その情報が辞書に登録されていないことを示している。
When the data of the document set D is acquired by the document input unit 101, the
次に、係り受け解析部103は、ステップS1による解析結果に基づいて係り受け解析を行い、処理対象の文書を構成する各文節の係り受け構造を抽出する(S2)。図4は、処理対象の文書が上記の文書Aであった場合に係り受け解析部103により出力される解析結果の一例を示す図である。同図に示す解析結果において、アスタリスクから始まる第1、4、6、8、11、13及び16行は、文節番号と、係り先の文節番号(係り先なしの場合は「−1」)とにより構成され、その他の行は、単語の表層形、品詞、品詞細分類1、品詞細分類2、品詞細分類3、活用型、活用形、原形、読み及び発音により構成される。その他の行におけるアスタリスクは、その情報が辞書に登録されていないことを示している。同図に示す解析結果は、例えば、文節「季節に」が文節「関係」に係っていることを示している。
Next, the
次に、係り受け関係抽出部104は、ステップS2の解析結果を参照して、処理対象の文書について、名詞、形容詞又は動詞の単語からなる係り受け関係を抽出する(S3)。係り受け関係を抽出すると、当該係り受け関係を構成する各単語に単語IDを付与し、係り受け関係を構成する係り元と係り先の単語と、それらの単語に付与された単語IDの組とを対応付けて係り受け関係記憶部105に記録する。図5は、処理対象の文書が上記の文書Aであった場合に係り受け関係記憶部105に記録されるテーブルの一例を示す図である。係り受け関係記憶部105に記録されるテーブルは文書ごとに作成され、同図に示すテーブルでは、例えば、係り受け関係「季節−関係」に対応付けて単語IDの組「1,3」が記録されている。なお、本動作例の説明では、文書集合Dを構成する各文書は、その文書に含まれる名詞、形容詞又は動詞の原形について、図6に例示する「季節」、「鉢植え」、「関係」、「ない」、「花」、「植物」、「咲く」、「花壇」、「枯れる」及び「教える」の10単語のうちの1以上の単語により構成されているものとする。また、これら10単語には、図6に例示するように、「1」〜「10」のうちのいずれかの単語IDが付与されるものとする。
Next, the dependency
上記のステップS1〜S3は、文書集合Dを構成するすべての文書について実行され、すべての文書について実行が完了すると(S4のYES)、出現頻度算出部106は、係り受け関係記憶部105を参照して、文書集合Dのうち、処理対象の文書において特定された各係り受け関係が当該文書において出現する出現頻度を算出する(S5)。係り受け関係について出願頻度を算出すると、算出した出現頻度を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。仮に処理対象の文書が上記の文書Aであったとすると、例えば、係り受け関係「季節−関係」は当該文書において1度しか出現しないため、図5に示す通り、当該係り受け関係に対応付けて出現頻度「1」が記録される。
The above steps S1 to S3 are executed for all the documents constituting the document set D, and when the execution is completed for all the documents (YES in S4), the occurrence
次に、出現文書数算出部107は、係り受け関係記憶部105を参照して、処理対象の文書において特定された各係り受け関係について、文書集合Dにおいて係り受け関係が出現する文書数を算出する(S6)。係り受け関係について文書数を算出すると、算出した文書数を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。仮に処理対象の文書が上記の文書Aであって、例えば、係り受け関係「季節−関係」が、文書集合Dを構成する20件の文書のうち3件に出現する場合には、図5に示す通り、当該係り受け関係「季節−関係」に対応付けて文書数「3」が記録される。
Next, the appearance document
次に、重要度算出部108は、係り受け関係記憶部105を参照して、処理対象の文書において特定された各係り受け関係について、上記の数1の式を用いて重要度を算出する(S7)。係り受け関係について重要度を算出すると、算出した重要度を当該係り受け関係と対応付けて係り受け関係記憶部105に記録する。仮に図5に示す係り受け関係「季節−関係」について重要度を算出したとすると、同図に示す通り、当該係り受け関係「季節−関係」に対応付けて重要度「0.88(=1*log(20/3+1))」が記録される。
Next, the
次に、重要度行列生成部109は、係り受け関係記憶部105を参照して、処理対象の文書について重要度行列を生成する(S8)。図7は、図5に示す各係り受け関係の重要度に基づいて重要度行列生成部109により生成される重要度行列の一例を示す図である。図7に示す重要度行列は、文書集合Dから抽出された各係り受け関係を構成する各単語(図6参照)が行及び列に対応付けられた正方行列であって、処理対象の文書において特定された各係り受け関係について、係り受け関係を構成する係り元の単語の行と係り先の列に対応する成分として当該係り受け関係の重要度が割り当てられた行列である。本重要度行列においては、例えば、係り受け関係「季節−関係」を構成する係り元の単語「季節」の行「1」と係り先の単語「関係」の列「3」に対応する成分として当該係り受け関係の重要度「0.88」が割り当てられている。
Next, the importance
次に、文書ベクトル生成部110は、ステップS8において生成された重要度行列の各行ベクトルを連結して文書ベクトルを生成する(S9)。文書ベクトルを生成すると、当該文書ベクトルが生成された文書の文書IDと対応付けて文書ベクトル記憶部111に記録する。仮に図7に示す重要度行列に基づいて文書ベクトルを生成したとすると、図8に例示するように10本の行ベクトルにより構成される当該重要度行列は、数2の式のように表現される。
上記のステップS5〜S9は、文書集合Dを構成するすべての文書について実行され、すべての文書について実行が完了すると(S10のYES)、本文書ベクトル生成処理は終了する。 The above steps S5 to S9 are executed for all the documents constituting the document set D, and when the execution is completed for all the documents (YES in S10), the document vector generation process ends.
以上説明した文書処理装置1によれば、文書中に出現する単語間の係り受け構造を反映した文書ベクトルを生成することができる。そのため、出現する単語が共通する文書同士であっても単語間の係り受け構造が相違していれば、その相違を文書ベクトルに表現することができる。
According to the
2.変形例
上記の実施形態は以下に記載するように変形してもよい。以下に記載する1以上の変形例は互いに組み合わせてもよい。
2. Modification Example The above embodiment may be modified as described below. One or more modifications described below may be combined with each other.
2−1.変形例1
係り受け関係抽出部104は、名詞、形容詞又は動詞以外の自立語からなる係り受け関係を抽出してもよい。例えば、名詞、形容詞又は動詞の単語だけでなく副詞の単語からなる係り受け関係を抽出してもよい。
2-1.
The dependency
また、係り受け関係抽出部104は、係り元と係り先の2つの単語からなる係り受け関係に代えて、3以上の単語からなる係り受け関係を抽出するようにしてもよい。例えば、3つの単語からなる係り受け関係を抽出する場合には、係り元の第1の単語と、係り先の第2の単語と、第2の単語の係り先である第3の単語からなる係り受け関係を抽出する。3以上の単語からなる係り受け関係が抽出された場合には、重要度行列生成部109は、行と列からなる2次元配列である行列に代えて、3次元以上の配列を生成する。例えば、3次元配列を生成する場合には、文書集合から抽出された係り受け関係を構成する各単語が行、列及び奥行(又はページ)に対応付けられた配列であって、処理対象の文書において特定された各係り受け関係について、係り受け関係を構成する係り元の第1の単語の行と、係り先の第2の単語の列と、第2の単語の係り先である第3の単語の奥行(又はページ)に対応する成分として当該係り受け関係の重要度が割り当てられた配列を生成する。重要度が割り当てられない要素には「0」が割り当てられる。
Further, the dependency
2−2.変形例2
係り受け関係の重要度を算出するための上記の数1の式では、(N/n+1)の常用対数をとっているが、自然対数をとってもよい。または、そもそも対数をとらなくてもよい。
2-2.
In the above equation of
2−3.変形例3
重要度算出部108が係り受け関係の重要度を算出する際に用いる上記の数1の式において、出現頻度mの乗算は省略されてもよい。この変形が採用される場合には、出現頻度算出部106は省略されてもよい。
2-3.
In the above equation of
また、係り受け関係の重要度を算出するための式は上記の数1の式に限定されるものではなく、出現頻度算出部106により算出される出現頻度と、文書集合を構成する文書数を出現文書数算出部107により算出される文書数で除した値とを乗じているものであればよい。例えば、数3〜数6の式のうちのいずれかの式であってもよい。
数3〜数6の式において、Wは重要度を表し、mは、出現頻度算出部106により算出される出現頻度を表し、Nは文書集合を構成する文書数を表し、nは、出現文書数算出部107により算出される文書数を表し、Mは、処理対象の文書において最も出現頻度の高い単語の出現頻度を表す。なおここでlogは常用対数である。
In the equations of
また、重要度算出部108は、係り受け関係の重要度を算出する際に、文書の長さ(総単語数)を考慮してもよい。具体的には、より短い文書において出現頻度が高い係り受け関係の重要度がより高くなるように重要度を算出するようにしてもよい。一例として数7の式を用いて重要度を算出してもよい。
数7の式において、Wは重要度を表し、mは、出現頻度算出部106により算出される出現頻度を表し、k及びbは、任意に設定される定数を表し、Len(d)は、処理対象の文書の長さ(総単語数)を表し、avgdLは、文書集合を構成する文書の平均の長さ(総単語数)を表し、Nは文書集合を構成する文書数を表し、nは、出現文書数算出部107により算出される文書数を表す。なおここでlogは常用対数である。
In the equation of
2−4.変形例4
重要度行列生成部109は、係り元の単語の行と係り先の単語の列に対応する成分として係り受け関係の重要度を割り当てるのに代えて、係り元の単語の列と係り先の単語の行に対応する成分として係り受け関係の重要度を割り当ててもよい。すなわち、係り元を行ではなく列に対応させ、係り先を列ではなく行に対応させてもよい。
2-4.
Instead of assigning the importance of the dependency relationship as a component corresponding to the row of the elemental word and the column of the elemental word, the importance
また、重要度行列生成部109が生成する重要度行列において、重要度が割り当てられない要素に、「0」以外の一定の値を割り当てるようにしてもよい。
Further, in the importance matrix generated by the importance
また、重要度行列生成部109は、重要度算出部108により算出された重要度に代えて、出現頻度算出部106により係り受け関係について算出された出現頻度を、当該係り受け関係を構成する係り元の単語の行と係り先の単語の列に対応する成分として割り当てた行列を生成してもよい。すなわち、重要度算出部108により算出された重要度に代えて、出現頻度算出部106により算出された出現頻度を係り受け関係の重要度として扱ってもよい。この変形が採用される場合には、出現文書数算出部107と重要度算出部108は省略されてよい。
Further, the importance
2−5.変形例5
文書ベクトル生成部110は、重要度行列の各行ベクトルを連結して文書ベクトルを生成するのに代えて、重要度行列の各列ベクトルを連結して文書ベクトルを生成してもよい。要するに文書ベクトル生成部110は、重要度行列の各成分を所定の規則に従って連結して文書ベクトルを生成すればよい。
2-5.
The document
2−6.変形例6
文書処理装置1は、演算処理装置がプログラムを実行することにより実現される機能として、次元圧縮部をさらに備えてもよい。この次元圧縮部は、文書ベクトル生成部110により生成された重要度行列の次元を、所定の次元圧縮方法を用いて圧縮(言い換えると削減)するための機能である。ここで所定の次元圧縮方法とは、例えば、二次元主成分分析(2DPCA)や、特異値分解(SVD)等の方法である。次元圧縮部により重要度行列の次元が圧縮されると、文書ベクトル生成部110は、当該行列の各行ベクトルを連結して文書ベクトルを生成する。この変形によれば、例えば、文書ベクトルを用いて類似文書の検索をする際の計算量を削減することができる。
2-6.
The
2−7.変形例7
文書処理装置1は、演算処理装置がプログラムを実行することにより実現される機能として、類似度判定部をさらに備えてもよい。この類似度判定部は、2件以上の文書の各々について文書ベクトル生成部110により生成された文書ベクトルに基づいて、所定の類似度計算方法を用いて、それらの文書の類似度を判定するための機能である。ここで所定の類似度計算方法を用いて算出される類似度としては、例えば、コサイン類似度や、ピアソンの相関係数や、偏差パターン類似度等がある。類似度判定部により判定された類似度は、図示せぬ表示装置に表示されてもよいし、通信回線3を介して送信されてもよい。または、文書ベクトル記憶部111に登録されている文書を、利用者により入力された質問文書に類似する順に並べて表示装置に表示させる際に参照されてもよい。
2-7.
The
2−8.変形例8
上記の実施形態に係る文書処理装置1は、日本語の文書を処理させることを想定しているが、日本語以外の言語を処理可能としてもよい。例えば、英語の文書を処理させる場合には、形態素解析部102は、例えばTreeTagger(http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/)を使用して英語の文書を解析し、単語を抽出するようにしてよい。また、係り受け解析部103は、例えばMaltparse(http://www.maltparser.org/)を使用して、英語の文書を構成する各単語の係り受け構造を抽出するようにしてよい。
2-8.
The
2−9.変形例9
文書処理装置1が備える各機能を実現するためのプログラムは、コンピュータ装置が読み取り可能な記録媒体を介して提供されてもよい。ここで記録媒体とは、例えば、磁気テープや磁気ディスクなどの磁気記録媒体や、光ディスクなどの光記録媒体や、光磁気記録媒体や、半導体メモリ等である。また、このプログラムは、インターネット等のネットワークを介して提供されてもよい。
2-9.
The program for realizing each function included in the
1…文書処理装置、2…文書データベース、3…通信回線、101…文書入力部、102…形態素解析部、103…係り受け解析部、104…係り受け関係抽出部、105…係り受け関係記憶部、106…出現頻度算出部、107…出現文書数算出部、108…重要度算出部、109…重要度行列生成部、110…文書ベクトル生成部、111…文書ベクトル記憶部 1 ... Document processing device, 2 ... Document database, 3 ... Communication line, 101 ... Document input unit, 102 ... Morphological analysis unit, 103 ... Dependency analysis unit, 104 ... Dependency relationship extraction unit, 105 ... Dependency relationship storage unit , 106 ... Appearance frequency calculation unit, 107 ... Appearance document number calculation unit, 108 ... Importance calculation unit, 109 ... Importance matrix generation unit, 110 ... Document vector generation unit, 111 ... Document vector storage unit
Claims (5)
前記文書集合を構成する各文書について、前記解析部により抽出された各単語の係り受け関係を抽出する係り受け関係抽出部と、
前記文書集合を構成する一の対象文書において、前記係り受け関係抽出部により抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出部により算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記出現頻度算出部により算出された頻度に、前記逆文書頻度算出部により算出された逆文書頻度を乗じて重要度を算出する重要度算出部と、
前記解析部により抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出部により算出された重要度が割り当てられた行列を生成する重要度行列生成部と、
前記重要度行列生成部により生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成部と
を備える文書処理装置。 An analysis unit that analyzes each document that makes up a document set and extracts words,
For each document constituting the document set, a dependency relationship extraction unit that extracts the dependency relationship of each word extracted by the analysis unit, and a dependency relationship extraction unit.
An appearance frequency calculation unit that calculates the appearance frequency of each dependency extracted by the dependency extraction unit in one target document that constitutes the document set, and an appearance frequency calculation unit.
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, an appearance document number calculation unit that calculates the number of documents in which the dependency relationship appears in the document set, and
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, the reverse document frequency is obtained by dividing the number of documents constituting the document set by the number of documents calculated by the appearance document number calculation unit. Inverse document frequency calculation unit that calculates
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, the importance is multiplied by the frequency calculated by the appearance frequency calculation unit and the inverse document frequency calculated by the reverse document frequency calculation unit. Importance calculation unit to calculate
Each word extracted by the analysis unit is a matrix associated with rows and columns, and each dependency relationship extracted by the dependency relationship extraction unit for the target document constitutes a dependency relationship. Severity matrix generation that generates a matrix to which the importance calculated by the importance calculation unit is assigned to the dependency relationship as a component corresponding to one row and the other column of the original word and the related word. Department and
A document processing apparatus including a document vector generation unit that concatenates each component of a matrix generated by the importance matrix generation unit to generate a document vector of the target document.
前記文書ベクトル生成部は、前記次元圧縮部により次元を圧縮された行列の各成分を連結して前記対象文書の文書ベクトルを生成する
ことを特徴とする請求項1に記載の文書処理装置。 A dimensional compression unit that compresses the dimensions of the matrix generated by the importance matrix generation unit using a predetermined dimensional compression method is further provided.
The document processing apparatus according to claim 1, wherein the document vector generation unit generates a document vector of the target document by concatenating each component of a matrix whose dimensions are compressed by the dimension compression unit.
文書集合を構成する各文書を解析して単語を抽出する解析ステップと、
前記文書集合を構成する各文書について、前記解析ステップにより抽出された各単語の係り受け関係を抽出する係り受け関係抽出ステップと、
前記文書集合を構成する一の対象文書において、前記係り受け関係抽出ステップにより抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出ステップと、
前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出ステップと、
前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出ステップにより算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出ステップと、
前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、前記出現頻度算出ステップにより算出された頻度に、前記逆文書頻度算出ステップにより算出された逆文書頻度を乗じて重要度を算出する重要度算出ステップと、
前記解析ステップにより抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出ステップにより抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出ステップにより算出された重要度が割り当てられた行列を生成する重要度行列生成ステップと、
前記重要度行列生成ステップにより生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成ステップと
を備える文書処理方法。 A document processing method executed by a document processing device.
An analysis step that analyzes each document that makes up a document set and extracts words,
For each document constituting the document set, a dependency relationship extraction step for extracting the dependency relationship of each word extracted by the analysis step, and a dependency relationship extraction step.
An appearance frequency calculation step for calculating the appearance frequency of each dependency extracted by the dependency extraction step in one target document constituting the document set, and an appearance frequency calculation step.
For each dependency relationship extracted by the dependency relationship extraction step for the target document, an appearance document number calculation step for calculating the number of documents in which the dependency relationship appears in the document set, and a step of calculating the number of appearance documents.
For each dependency relationship extracted by the dependency relationship extraction step for the target document, the reverse document frequency is obtained by dividing the number of documents constituting the document set by the number of documents calculated by the appearance document number calculation step. Inverse document frequency calculation step to calculate
For each dependency relationship extracted by the dependency relationship extraction step for the target document, the importance is multiplied by the frequency calculated by the appearance frequency calculation step and the reverse document frequency calculated by the reverse document frequency calculation step. The importance calculation step to calculate
Each word extracted by the analysis step is a matrix associated with rows and columns, and the dependency relationship is formed for each dependency relationship extracted by the dependency relationship extraction step for the target document. Severity matrix generation that generates a matrix to which the importance calculated by the importance calculation step is assigned to the dependency relationship as a component corresponding to one row and the other column of the original word and the associated word. Steps and
A document processing method including a document vector generation step of connecting each component of the matrix generated by the importance matrix generation step to generate a document vector of the target document.
文書集合を構成する各文書を解析して単語を抽出する解析部と、
前記文書集合を構成する各文書について、前記解析部により抽出された各単語の係り受け関係を抽出する係り受け関係抽出部と、
前記文書集合を構成する一の対象文書において、前記係り受け関係抽出部により抽出された各係り受け関係が出現する出現頻度を算出する出現頻度算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合において係り受け関係が出現する文書数を算出する出現文書数算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記文書集合を構成する文書数を、前記出現文書数算出部により算出された文書の数で除して逆文書頻度を算出する逆文書頻度算出部と、
前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、前記出現頻度算出部により算出された頻度に、前記逆文書頻度算出部により算出された逆文書頻度を乗じて重要度を算出する重要度算出部と、
前記解析部により抽出された各単語が行及び列に対応付けられた行列であって、前記対象文書について前記係り受け関係抽出部により抽出された各係り受け関係について、係り受け関係を構成する係り元の単語と係り先の単語のうち一方の行と他方の列に対応する成分として当該係り受け関係について前記重要度算出部により算出された重要度が割り当てられた行列を生成する重要度行列生成部と、
前記重要度行列生成部により生成された行列の各成分を連結して前記対象文書の文書ベクトルを生成する文書ベクトル生成部
として機能させるためのプログラム。 Computer,
An analysis unit that analyzes each document that makes up a document set and extracts words,
For each document constituting the document set, a dependency relationship extraction unit that extracts the dependency relationship of each word extracted by the analysis unit, and a dependency relationship extraction unit.
An appearance frequency calculation unit that calculates the appearance frequency of each dependency extracted by the dependency extraction unit in one target document that constitutes the document set, and an appearance frequency calculation unit.
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, an appearance document number calculation unit that calculates the number of documents in which the dependency relationship appears in the document set, and
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, the reverse document frequency is obtained by dividing the number of documents constituting the document set by the number of documents calculated by the appearance document number calculation unit. Inverse document frequency calculation unit that calculates
For each dependency relationship extracted by the dependency relationship extraction unit for the target document, the importance is multiplied by the frequency calculated by the appearance frequency calculation unit and the inverse document frequency calculated by the reverse document frequency calculation unit. Importance calculation unit to calculate
Each word extracted by the analysis unit is a matrix associated with rows and columns, and each dependency relationship extracted by the dependency relationship extraction unit for the target document constitutes a dependency relationship. Severity matrix generation that generates a matrix to which the importance calculated by the importance calculation unit is assigned to the dependency relationship as a component corresponding to one row and the other column of the original word and the related word. Department and
A program for connecting each component of the matrix generated by the importance matrix generation unit to function as a document vector generation unit for generating a document vector of the target document.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017031043A JP6773585B2 (en) | 2017-02-22 | 2017-02-22 | Document processing equipment, document processing methods and programs |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017031043A JP6773585B2 (en) | 2017-02-22 | 2017-02-22 | Document processing equipment, document processing methods and programs |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2018136760A JP2018136760A (en) | 2018-08-30 |
| JP6773585B2 true JP6773585B2 (en) | 2020-10-21 |
Family
ID=63366873
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017031043A Active JP6773585B2 (en) | 2017-02-22 | 2017-02-22 | Document processing equipment, document processing methods and programs |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6773585B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4318269A4 (en) * | 2021-04-16 | 2024-04-03 | Mitsubishi Electric Corporation | Information processing device, creation method, and creation program |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6689466B1 (en) | 2019-01-31 | 2020-04-28 | 三菱電機株式会社 | Sentence structure vectorization device, sentence structure vectorization method, and sentence structure vectorization program |
| JP2021022070A (en) * | 2019-07-25 | 2021-02-18 | 東京電力ホールディングス株式会社 | Method for processing information, information processor, and program |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009026133A (en) * | 2007-07-20 | 2009-02-05 | Kansai Electric Power Co Inc:The | Method for evaluating degree of coincidence between documents |
| JP5965260B2 (en) * | 2012-09-11 | 2016-08-03 | 株式会社日立アドバンストシステムズ | Document classification program and document classification apparatus |
-
2017
- 2017-02-22 JP JP2017031043A patent/JP6773585B2/en active Active
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4318269A4 (en) * | 2021-04-16 | 2024-04-03 | Mitsubishi Electric Corporation | Information processing device, creation method, and creation program |
| US12216699B2 (en) | 2021-04-16 | 2025-02-04 | Mitsubishi Electric Corporation | Information processing device, and generation method |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2018136760A (en) | 2018-08-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112765306B (en) | Intelligent question-answering method, intelligent question-answering device, computer equipment and storage medium | |
| CN109145102B (en) | Intelligent question answering method and knowledge graph system construction method, device and equipment thereof | |
| CN107168954B (en) | Text keyword generation method and device, electronic equipment and readable storage medium | |
| CN105975459B (en) | A kind of the weight mask method and device of lexical item | |
| CN105095444A (en) | Information acquisition method and device | |
| US9697099B2 (en) | Real-time or frequent ingestion by running pipeline in order of effectiveness | |
| CN109740158B (en) | Text semantic parsing method and device | |
| KR102685135B1 (en) | Video editing automation system | |
| JP5846959B2 (en) | Basic vocabulary extraction device and program | |
| JP6773585B2 (en) | Document processing equipment, document processing methods and programs | |
| CN119357318B (en) | Document retrieval method, device and storage medium | |
| TW201826145A (en) | Method and system for knowledge extraction from Chinese corpus useful for extracting knowledge from source corpuses mainly written in Chinese | |
| US20230259507A1 (en) | Systems, methods, and media for retrieving an entity from a data table using semantic search | |
| Kulkarni et al. | Video based transcript summarizer for online courses using natural language processing | |
| US8745078B2 (en) | Control computer and file search method using the same | |
| Shakeel et al. | Lexicon-based sentiment analysis of Indian Union Budget 2016–17 | |
| CN114462378A (en) | Science and technology project duplicate checking method, system, computer equipment and storage medium | |
| JP5982174B2 (en) | Similarity calculation device, similar program search device, and program thereof | |
| CN112579821A (en) | Video recommendation method and device based on real-time voice input and computing equipment | |
| KR102519955B1 (en) | Apparatus and method for extracting of topic keyword | |
| JP2009122772A (en) | Time-series person information editing method and apparatus, program, and computer-readable recording medium | |
| KR102422844B1 (en) | Method of managing language risk of video content based on artificial intelligence | |
| JPH03278270A (en) | Abstract document forming device | |
| JP6805927B2 (en) | Index generator, data search program, index generator, data search device, index generation method, and data search method | |
| JP2020129190A (en) | Answer retrieval device, answer retrieval method and answer retrieval program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191101 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200824 |
|
| 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: 20200901 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20201001 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6773585 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |