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
JP5513985B2 - CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM - Google Patents
[go: Go Back, main page]

JP5513985B2 - CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM - Google Patents

CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM Download PDF

Info

Publication number
JP5513985B2
JP5513985B2 JP2010118830A JP2010118830A JP5513985B2 JP 5513985 B2 JP5513985 B2 JP 5513985B2 JP 2010118830 A JP2010118830 A JP 2010118830A JP 2010118830 A JP2010118830 A JP 2010118830A JP 5513985 B2 JP5513985 B2 JP 5513985B2
Authority
JP
Japan
Prior art keywords
character string
matrix
gram
vector
character
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
JP2010118830A
Other languages
Japanese (ja)
Other versions
JP2011248483A (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.)
NTT Inc
NTT Inc USA
Original Assignee
Nippon Telegraph and Telephone Corp
NTT Inc USA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp, NTT Inc USA filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2010118830A priority Critical patent/JP5513985B2/en
Publication of JP2011248483A publication Critical patent/JP2011248483A/en
Application granted granted Critical
Publication of JP5513985B2 publication Critical patent/JP5513985B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明は、文字列の意味表現である文字列ベクトルを生成する文字列ベクトル生成装置、文字列ベクトル生成方法、プログラム、及びプログラムを格納したコンピュータ読み取り可能な記録媒体に関する。   The present invention relates to a character string vector generating device, a character string vector generating method, a program, and a computer-readable recording medium storing the program.

単語の意味表現としてのベクトルは、単語間の意味的類似性を定量化できるため、検索等の言語処理に適用され、精度向上に寄与している。   A vector as a semantic expression of a word can quantify the semantic similarity between words, and thus is applied to language processing such as search and contributes to improvement in accuracy.

単語の意味表現であるベクトルを生成する方法として、非特許文献1に記載の方法がある。この方法では、テキストを入力とし、テキスト中に存在する単語の異なりの集合をとり、該集合間の共起行列を生成する。テキストの所定の範囲(典型的には1文)において、任意の単語同士が共起する頻度を、テキスト中の全ての所定の範囲にわたって加算した値を、該単語対に対応する該共起行列中の要素に格納する。共起行列中の各行ベクトルは、該行に対応する単語が、どのような単語と共起しているか(すなわちどのような単語を隣人として持っているか)を表している。一般に、意味の近い単語は、共通の隣人となる単語を持っており、対応する行ベクトルが近くなる。そこで、単語の概念を、対応する行ベクトルで表す。この行ベクトルを共起ベクトルと呼ぶ。   There is a method described in Non-Patent Document 1 as a method of generating a vector that is a semantic representation of a word. This method takes text as input, takes different sets of words present in the text, and generates a co-occurrence matrix between the sets. The co-occurrence matrix corresponding to the word pair is a value obtained by adding the frequency at which arbitrary words co-occur in a predetermined range of text (typically one sentence) over all the predetermined ranges in the text. Store in the element inside. Each row vector in the co-occurrence matrix represents what word the word corresponding to the row co-occurs with (that is, what word has as a neighbor). In general, words that have close meanings have words that are common neighbors, and the corresponding row vectors are close. Therefore, the concept of a word is represented by a corresponding row vector. This row vector is called a co-occurrence vector.

生成された共起行列を特異値分解し、列数を縮退させた共起行列に変換し、共起ベクトルの次元数を縮退することにより、ベクトル間の類似性の精度を向上させることができる。共起ベクトルの次元数を縮退して得られるベクトルを概念ベクトルと呼ぶ。   The generated co-occurrence matrix is decomposed into singular values, converted into a co-occurrence matrix with a reduced number of columns, and the dimensionality of the co-occurrence vector is reduced, thereby improving the accuracy of similarity between vectors. . A vector obtained by reducing the dimensionality of the co-occurrence vector is called a concept vector.

共起ベクトルと概念ベクトルを合わせて単語ベクトルと呼ぶ。単語間の意味的類似性は、対応する単語ベクトルの間の類似度により定量化される。   The co-occurrence vector and the concept vector are collectively called a word vector. Semantic similarity between words is quantified by the similarity between corresponding word vectors.

文書の意味表現としての文書ベクトルは、文書中の単語の単語ベクトルの和または重心とする。文書間の意味的類似性は、対応する文書ベクトルの間の類似度により定量化される。   The document vector as the semantic expression of the document is the sum or centroid of the word vectors of the words in the document. Semantic similarity between documents is quantified by the similarity between corresponding document vectors.

H. Schutze, Dimensions of Meaning, Proc. of Supercomputing '92, pp.786-796, 1992H. Schutze, Dimensions of Meaning, Proc. Of Supercomputing '92, pp.786-796, 1992

非特許文献1の方法では、入力テキスト中の単語を取得するのに形態素解析を行う。形態素解析では、テキストを、単語辞書中の単語に分割する。テキスト中に、単語辞書にない単語がある等の場合に、単語分割が適切になされないことがあり、その結果、抽出する単語が正しくなく、単語間の共起頻度も正しくカウントされないため、単語ベクトルの品質に問題がある。また、単語ベクトル群を生成した後、入力文書のベクトルを生成するにあたっても、入力文書の単語分割が適切になされないことがあり、その結果、抽出する単語が正しくないため、文書ベクトルの品質に問題がある。   In the method of Non-Patent Document 1, morphological analysis is performed to acquire words in the input text. In morphological analysis, text is divided into words in a word dictionary. When there is a word that is not in the word dictionary in the text, the word may not be divided properly. As a result, the extracted word is incorrect and the co-occurrence frequency between words is not counted correctly. There is a problem with the quality of the vector. Also, after generating a word vector group, when generating an input document vector, the input document may not be properly segmented. As a result, the extracted word is not correct, resulting in improved document vector quality. There's a problem.

また、あるテキストから単語ベクトル群を生成したとしても、該テキストに存在しない単語については、単語ベクトルが得られないという問題がある。このため、入力文書のベクトルを生成するにあたっても、入力文書中に、単語ベクトルのない単語がある場合、その単語の意味は文書ベクトルに反映されないため、文書ベクトルの品質に問題がある。   Moreover, even if a word vector group is generated from a certain text, there is a problem that a word vector cannot be obtained for a word that does not exist in the text. For this reason, when generating a vector of an input document, if there is a word without a word vector in the input document, the meaning of the word is not reflected in the document vector, and there is a problem in the quality of the document vector.

以上のように、単語分割の誤りに起因する単語ベクトルや文書ベクトルの品質の問題や、単語ベクトルの量に起因する文書ベクトルの品質の問題がある。この他にも、単語ベクトルを使用した言語処理全般にわたり、精度に問題がある。   As described above, there are problems in the quality of word vectors and document vectors due to word division errors, and there are problems in the quality of document vectors due to the amount of word vectors. In addition to this, there is a problem in accuracy over the entire language processing using word vectors.

本発明は、上記の問題を解決するためになされたものであり、任意の文字列に対し、その意味表現として適切なベクトルを生成することを可能とする文字列ベクトル生成の技術を提供することを目的とする。   The present invention has been made to solve the above-described problem, and provides a technique for generating a character string vector that can generate an appropriate vector as a semantic expression for an arbitrary character string. With the goal.

上記の課題を解決するために、請求項1に係る発明は、文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置であって、入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出手段と、各行を前記集合A中の文字列に対応させ、各列を前記集合B中の文字列に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列Dとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記文字列Dに対応する前記行列中の要素とした行列を生成し、出力する第1行列生成手段とを備えることを特徴とする文字列ベクトル生成装置として構成される。 In order to solve the above-described problem, the invention according to claim 1 is a character string vector generation device that generates a character string vector as a row vector of a matrix, and each sentence of the sentence in the text is input from the input text. Character string set extraction means for extracting different sets A and B of character strings that are continuous finite number of character strings from the character position , and each row corresponding to the character string in the set A, and each column A matrix corresponding to the character string in the set B is generated, and the character string C in the set A existing in a predetermined range that is a string of a finite number of continuous words in the text, and the set A matrix in which the frequency of co-occurrence of the character string D in B is added over all the predetermined ranges in the text and the elements in the matrix corresponding to the character string C and the character string D are used. First matrix generation means for generating and outputting Configured as a string vector generation device comprising.

また、請求項2に係る発明は、文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置であって、入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出手段と、前記集合B中の各文字列に対し、L(Lは1以上の整数)個の成分番号から抽出される成分番号集合の群から、既に付与した成分番号集合の群を除いた集合群から、ランダムに一つの成分番号集合を選び、当該成分番号集合を当該文字列に付与する成分番号付与手段と、各行を前記集合A中の文字列に対応させ、各列を前記成分番号集合中の成分番号に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列に対応付けられた成分番号Eとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記成分番号Eに対応する前記行列中の要素とした行列を生成し、出力する第2行列生成手段とを備えることを特徴とする文字列ベクトル生成装置として構成される。
Further, the invention according to claim 2 is a character string vector generation device that generates a character string vector as a row vector of a matrix, and from an input text, a finite number of continuous characters from each character position of the sentence in the text. Character string set extraction means for extracting different sets A and B of character strings, and L (L is an integer of 1 or more) components for each character string in the set B components from the group of the set of components numbers extracted from the number, from an already group set excluding the group of imparting ingredients number set, randomly select one component numbers set to impart the component number set in the character string Numbering means, each row corresponding to a character string in the set A, a matrix in which each column corresponds to a component number in the component number set is generated, and a continuous finite number of words in the text Previous in a given range that is a column A value obtained by adding the frequency of co-occurrence of the character string C in the set A and the component number E associated with the character string in the set B over all the predetermined ranges in the text, A character string vector generation device is provided, comprising: a second matrix generation unit that generates and outputs a matrix having elements in the matrix corresponding to the column C and the component number E.

また、請求項3に係る発明は、請求項1または2に記載の文字列ベクトル生成装置において、前記出力された行列に対し特異値分解を行うことにより、当該行列を、列数をより少なくした行列に変換する特異値分解手段を更に備えることを特徴とする文字列ベクトル生成装置として構成される。   The invention according to claim 3 is the character string vector generation device according to claim 1 or 2, wherein the matrix is reduced in number by performing singular value decomposition on the output matrix. A singular value decomposition means for converting into a matrix is further provided as a character string vector generation device.

また、請求項4に係る発明は、請求項1ないし3のうちいずれか1項に記載の文字列ベクトル生成装置において、入力された文書に対し、当該文書中の各文字列で、前記出力された行列の行に対応する文字列の集合を検索し、検索された文字列に対応する行ベクトルを求め、当該行ベクトルの和または重心を、前記文書のベクトルとする文書ベクトル生成手段を更に備えたことを特徴とする文字列ベクトル生成装置として構成される。   According to a fourth aspect of the present invention, in the character string vector generating device according to any one of the first to third aspects, the output is performed for each input character string in the document. A document vector generation unit that searches a set of character strings corresponding to the rows of the matrix, obtains a row vector corresponding to the searched character string, and uses a sum or centroid of the row vectors as a vector of the document; This is configured as a character string vector generation device characterized by that.

また、請求項5〜8に記載のように、本発明は、請求項1〜4に記載の文字列ベクトル生成装置が実行する文字列ベクトル生成方法として構成することもできる。また、本発明は、請求項9に記載のように、コンピュータを、請求項1ないし4のうちいずれか1項に記載された文字列ベクトル生成装置における各手段として機能させるためのプログラムとして構成してもよい。更に、本発明は、請求項10に記載のように、請求項9に記載されたプログラムを格納したコンピュータ読み取り可能な記録媒体として構成することもできる。   Further, as described in claims 5 to 8, the present invention can also be configured as a character string vector generation method executed by the character string vector generation device according to claims 1 to 4. According to a ninth aspect of the present invention, there is provided a computer program configured to cause a computer to function as each unit in the character string vector generating device according to any one of the first to fourth aspects. May be. Furthermore, as described in claim 10, the present invention can also be configured as a computer-readable recording medium storing the program described in claim 9.

本発明に係る技術では、集合A中の各文字列に対し、該文字列に対応する、請求項1〜3に記載された発明のいずれかを用いて生成した行列の行ベクトルを、該文字列の文字列ベクトルとしている。集合A中の文字列と、該文字列に対応する文字列ベクトルとの対の集合を文字列ベクトルデータベースと呼ぶ。   In the technology according to the present invention, for each character string in the set A, a row vector of a matrix generated by using any of the inventions according to claims 1 to 3 corresponding to the character string, It is a string vector of columns. A set of pairs of character strings in the set A and character string vectors corresponding to the character strings is referred to as a character string vector database.

請求項1〜3に係る発明では、集合A、Bとも、一般の文字列の集合を取れば、テキストを形態素解析することがないため、単語分割の誤りに起因する問題はなく、任意の文字列の対の共起頻度を適切にカウントでき、生成される文字列ベクトルの品質は高くなる。また、請求項4に係る発明を用いて入力文書のベクトルを生成するにあたっても、該文書を形態素解析することがないため、単語分割の誤りに起因する問題はなく、該文書の文字列の文字列ベクトルを適切に取得でき、品質の高い文書ベクトルを生成できるという効果を奏する。   In the inventions according to claims 1 to 3, there is no problem caused by an error in word division because there is no morphological analysis of text if both sets A and B are a set of general character strings. The co-occurrence frequency of column pairs can be appropriately counted, and the quality of the generated character string vector is improved. In addition, when generating a vector of an input document using the invention according to claim 4, there is no problem caused by an error in word division because the document is not subjected to morphological analysis. The column vector can be appropriately acquired, and an effect is achieved that a high-quality document vector can be generated.

請求項1〜3に係る発明では、集合Aとして数個程度までの個数の文字からなる文字列の集合を取って文字列ベクトルデータベースを生成してもよい。この文字列ベクトルデータベースを使用する際、集合A中に存在しない文字列に対しても、該文字列を、集合A中の文字列のある集合に分解できるので、該文字列を請求項4に係る発明における入力文書として使用して、請求項4の処理を行うことにより、該文字列の文字列ベクトルを生成することが可能となる。   In the inventions according to claims 1 to 3, a character string vector database may be generated by taking a set of character strings consisting of up to several characters as the set A. When using this character string vector database, even for a character string that does not exist in the set A, the character string can be decomposed into a certain set of character strings in the set A. The character string vector of the character string can be generated by performing the process of claim 4 using the input document in the invention.

請求項1〜3に係る発明において、集合Aとして、単語の集合と、数個程度までの個数の文字からなる文字列の集合との、和集合を取って文字列ベクトルデータベースを生成してもよい。この文字列ベクトルデータベースを使用する際、集合A中に存在する単語に対しては、対応する文字列ベクトルを使用し、存在しない単語に対しては、該単語を、集合A中の文字列のある集合に分解できるので、該単語を請求項4に係る発明における入力文書として使用して、請求項4の処理を行うことにより、該単語の文字列ベクトルを生成することが可能となる。このように、文字列ベクトルデータベースに存在しない単語の文字列ベクトルも生成できるため、入力文書のベクトルを生成するにあたっても、該文書の単語の文字列ベクトルを適切に取得でき、品質の高い文書ベクトルを生成できる。   In the inventions according to claims 1 to 3, as the set A, a character string vector database may be generated by taking a union of a set of words and a set of character strings composed of up to several characters. Good. When using this character string vector database, the corresponding character string vector is used for words existing in the set A, and for words that do not exist, the word is assigned to the character string in the set A. Since it can be decomposed into a certain set, the character string vector of the word can be generated by performing the process of claim 4 using the word as an input document in the invention according to claim 4. Thus, since a character string vector of a word that does not exist in the character string vector database can also be generated, the character string vector of the word of the document can be appropriately acquired when generating a vector of the input document, and a high-quality document vector Can be generated.

請求項1〜3に係る発明は、集合Bとして、単語の集合を取ったり、あるいは、単語の集合と、数個程度までの個数の文字からなる文字列の集合との、和集合を取るというバリエーションも包含するものである。   The invention according to claims 1 to 3 takes a set of words as set B, or takes a union of a set of words and a set of character strings consisting of up to several characters. Variations are also included.

また、請求項2に係る発明では、任意の文字列の対の共起情報を保持しつつ、文字列ベクトルの次元数を一定(L個)にすることができる。これにより、任意の文字列の対の共起情報を保持しつつ、それを使用する処理の計算量が低い文字列ベクトルを生成することができる。   In the invention according to claim 2, the number of dimensions of the character string vector can be made constant (L) while holding the co-occurrence information of an arbitrary character string pair. As a result, it is possible to generate a character string vector with a low calculation amount of processing that uses the co-occurrence information of a pair of arbitrary character strings while using the information.

上述した効果は、上記各請求項に対応する他のカテゴリの請求項に係る発明においても同様に奏する効果である。   The effects described above are the same effects in the inventions according to claims of other categories corresponding to the above claims.

実施例1における文字列ベクトル生成装置100の機能構成図である。3 is a functional configuration diagram of a character string vector generation device 100 in Embodiment 1. FIG. 入力テキスト(15)の例を示す図である。It is a figure which shows the example of input text (15). 2-gram配列の例を示す図である。It is a figure which shows the example of a 2-gram arrangement | sequence. 第1行列生成部12又は第2行列生成部23が実行する処理のフローチャートである。5 is a flowchart of processing executed by a first matrix generation unit 12 or a second matrix generation unit 23. 実施例1-1における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 1-1. 実施例1-1、実施例2-1における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 1-1 and Example 2-1. 実施例1-1における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 1-1. 実施例1-1における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 1-1. 実施例1-1における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 1-1. 単語辞書の内容の一例を示す図である。It is a figure which shows an example of the content of a word dictionary. 不要語テーブルの内容の一例を示す図である。It is a figure which shows an example of the content of the unnecessary word table. 不要品詞テーブルの内容の一例を示す図である。It is a figure which shows an example of the content of the unnecessary part of speech table. 図2のテキストを形態素解析した結果を示す図である。FIG. 3 is a diagram showing a result of morphological analysis of the text of FIG. 実施例1-2、実施例2-2における文字列集合Aの例を示す図である。It is a figure which shows the example of the character string set A in Example 1-2 and Example 2-2. 実施例1-2、実施例2-2における文字列集合Bの例を示す図である。It is a figure which shows the example of the character string set B in Example 1-2 and Example 2-2. 実施例1-2における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 1-2. 実施例1-2、実施例2-2における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 1-2 and Example 2-2. 実施例1-2における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 1-2. 実施例1-2における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 1-2. 実施例1-2における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 1-2. 実施例2における文字列ベクトル生成装置200の機能構成図である。It is a function block diagram of the character string vector production | generation apparatus 200 in Example 2. FIG. 実施例2-1における成分番号付文字列集合Bの例を示す図である。It is a figure which shows the example of the character string set B with a component number in Example 2-1. 実施例2-1における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-1. 実施例2-1における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 2-1. 実施例2-1における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 2-1. 実施例2-1における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-1. 実施例2-1における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 2-1. 実施例2-1における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 2-1. 実施例2-1における配列gの例を示す図である。It is a figure which shows the example of the arrangement | sequence g in Example 2-1. 実施例2-1における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 2-1. 実施例2-1における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 2-1. 実施例2-1における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-1. 実施例2-2における成分番号付文字列集合Bの例を示す図である。It is a figure which shows the example of the character string set B with a component number in Example 2-2. 実施例2-2における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-2. 実施例2-2における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 2-2. 実施例2-2における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 2-2. 実施例2-2における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-2. 実施例2-2における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 2-2. 実施例2-2における配列aの例を示す図である。It is a figure which shows the example of the arrangement | sequence a in Example 2-2. 実施例2-2における配列gの例を示す図である。It is a figure which shows the example of the arrangement | sequence g in Example 2-2. 実施例2-2における配列bの例を示す図である。It is a figure which shows the example of the arrangement | sequence b in Example 2-2. 実施例2-2における配列b'の例を示す図である。It is a figure which shows the example of arrangement | sequence b 'in Example 2-2. 実施例2-2における行列の例を示す図である。It is a figure which shows the example of the matrix in Example 2-2. 実施例3における文字列ベクトル生成装置301の機能構成図である(例1)。It is a function block diagram of the character string vector production | generation apparatus 301 in Example 3 (example 1). 実施例3における文字列ベクトル生成装置302の機能構成図である(例2)。It is a function block diagram of the character string vector production | generation apparatus 302 in Example 3 (example 2). 実施例3-1における文字列ベクトルデータベース2(19)の例である。It is an example of the character string vector database 2 (19) in Example 3-1. 実施例3-2における文字列ベクトルデータベース2(19)の例である。It is an example of the character string vector database 2 (19) in Example 3-2. 実施例4における文字列ベクトル生成装置401の機能構成図である(例1)。It is a function block diagram of the character string vector generation apparatus 401 in Example 4 (Example 1). 実施例4における文字列ベクトル生成装置402の機能構成図である(例2)。It is a function block diagram of the character string vector production | generation apparatus 402 in Example 4 (example 2). 実施例4-1における入力文書の例を示す図である。It is a figure which shows the example of the input document in Example 4-1. 実施例4-1における2-gram列の例を示す図である。It is a figure which shows the example of the 2-gram row | line in Example 4-1. 実施例4-2における入力文書の例を示す図である。It is a figure which shows the example of the input document in Example 4-2. 実施例4-2における形態素解析結果の例を示す図である。It is a figure which shows the example of the morphological analysis result in Example 4-2. 実施例4-2において形態素解析結果から抽出される単語列の例である。It is an example of the word string extracted from a morphological analysis result in Example 4-2. 実施例4-2における1-gram列の例を示す図である。It is a figure which shows the example of the 1-gram row | line in Example 4-2.

以下、図面を参照して、本発明を実施するための形態である実施例1〜4を説明する。   Hereinafter, with reference to the drawings, Examples 1 to 4 which are forms for carrying out the present invention will be described.

[実施例1]
図1に、本発明の実施例1に係る文字列ベクトル生成装置100の構成例を示す。図1に示すように、実施例1の文字列ベクトル生成装置100は、文字列集合抽出部11、第1行列生成部12、テキスト格納部101、文字列集合格納部102、及び文字列ベクトル格納部103を備える。
[Example 1]
FIG. 1 shows a configuration example of a character string vector generation device 100 according to the first embodiment of the present invention. As shown in FIG. 1, a character string vector generation device 100 according to the first embodiment includes a character string set extraction unit 11, a first matrix generation unit 12, a text storage unit 101, a character string set storage unit 102, and a character string vector storage. A unit 103 is provided.

文字列集合抽出部11は、テキスト格納部101からテキスト(15)を読み出して入力とし、当該入力テキスト(15)中の連続する有限個の文字の列である文字列の異なりの集合である文字列集合A(16)及び文字列集合B(17)を抽出し、文字列集合格納部102に格納する。なお、"文字列の異なりの集合"とは、互いに異なる文字列の集合のことである。以下、同様に、"Xの異なりの集合"とは、互いに異なるXの集合を意味する。   The character string set extraction unit 11 reads the text (15) from the text storage unit 101 and inputs it, and the characters that are different sets of character strings that are strings of a finite number of consecutive characters in the input text (15). Column set A (16) and character string set B (17) are extracted and stored in the character string set storage unit. Note that “different sets of character strings” are sets of different character strings. Hereinafter, similarly, “different sets of X” mean sets of X different from each other.

上記の集合A、Bは同一であるとして、ある一つの文字列集合を抽出、格納して、該文字列集合を、集合Aでもあり、集合Bでもあるというように扱ってもよい。   Assuming that the above sets A and B are the same, one character string set may be extracted and stored, and the character string set may be treated as both set A and set B.

文字列集合抽出部11は、例えば、1以上の整数の定数nに対し、テキスト中の連続するn個の文字の列(n-gramと呼ぶ)の異なりの集合をとり、これを文字列集合とする。このn-gram集合の中で、例えば、高頻度のn-gramの集合に限定したものを文字列集合としてもよい。また、複数のnに対し、各nに対するn-gram集合の和集合をとり、それを文字列集合としてもよい。   For example, the character string set extraction unit 11 takes different sets of strings of n consecutive characters (called n-gram) in the text for an integer constant n of 1 or more, and uses this as a character string set. And Among the n-gram sets, for example, a character string set may be limited to a high-frequency n-gram set. Further, for a plurality of n, a union of n-gram sets for each n may be taken and used as a character string set.

また、文字列集合抽出部11は、入力テキストを形態素解析し、テキスト中の単語の異なりの集合を、文字列集合として抽出してもよい。この場合、文字列集合に採用する単語を、名詞、動詞、形容詞等の内容語に限定してもよい。また、単語集合の中で、例えば、高頻度の単語の集合に限定したものを文字列集合としてもよい。   Further, the character string set extraction unit 11 may perform morphological analysis on the input text and extract different sets of words in the text as character string sets. In this case, the words employed in the character string set may be limited to content words such as nouns, verbs, and adjectives. In addition, among the word sets, for example, a character string set may be limited to a high-frequency word set.

また、いくつかのn-gram集合と、単語集合との和集合をとることにより文字列集合としてもよい。このとき、n-gram集合と単語集合が、文字列として同一の要素をそれぞれ持っていたとしても、それらの要素は別物とみなして、n-gram集合と単語集合を、共通要素を持たない集合ととらえてもよい。   Moreover, it is good also as a character string set by taking the union of several n-gram sets and a word set. At this time, even if the n-gram set and the word set have the same elements as the character strings, they are regarded as different elements, and the n-gram set and the word set have no common elements. You may catch it.

第1行列生成部12は、テキスト(15)、文字列集合A(16)、文字列集合B(17)をテキスト格納部101及び文字列集合格納部102から読み出して入力とし、各行が集合A中の文字列に対応し、各列が集合B中の文字列に対応しているような行列を生成し、テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、集合A中の文字列Cと、集合B中の文字列Dとが共起する頻度を、テキスト中の全ての所定の範囲にわたって加算した値を、文字列Cと文字列Dに対応する該行列中の要素に格納し、集合A中の文字列と、該文字列に対応する該行列の行ベクトルとの対の集合である文字列ベクトルデータベース1(18)を出力し、文字列ベクトル格納部103に格納する。   The first matrix generation unit 12 reads the text (15), the character string set A (16), and the character string set B (17) from the text storage unit 101 and the character string set storage unit 102 as inputs, and each row includes the set A. A matrix corresponding to each character string in the text and corresponding to each character string in the set B, and existing in a predetermined range that is a sequence of a finite number of consecutive words in the text. The matrix corresponding to the character string C and the character string D, the value obtained by adding the frequency of occurrence of the character string C in the character set A and the character string D in the character set B over all the predetermined ranges in the text. A character string vector database 1 (18) which is a set of pairs of character strings in the set A and row vectors of the matrix corresponding to the character strings; Store in 103.

なお、第1行列生成部12は、文字列ベクトルデータベース1(18)を文字列ベクトル格納部103に対して出力、及び格納することに代えて、例えば通信ネットワークを介して、文字列ベクトル生成装置100の外部にある装置に出力することとしてもよい。   Note that the first matrix generation unit 12 instead of outputting and storing the character string vector database 1 (18) to the character string vector storage unit 103, for example, a character string vector generation device via a communication network It is good also as outputting to the apparatus outside 100.

以下、実施例1における処理の詳細例として、n-gram間の共起をとる実施例1-1と、単語間共起の行の単語集合にn-gram集合を加える実施例1-2を説明する。   Hereinafter, as detailed examples of processing in Example 1, Example 1-1 in which co-occurrence between n-grams is taken, and Example 1-2 in which an n-gram set is added to a word set in a co-occurrence line between words explain.

<実施例1-1>
文字列集合抽出部11は、以下のようにして、入力テキスト(15)から、1以上の整数の定数nに対し、n-gramの異なりの集合をとる。
(1) n-gramの配列をクリアする。なお、配列は、文字列ベクトル生成装置100内のメモリ等における所定のエリアである。他の実施例についても同様である。
(2) テキスト中の文ごとに以下の処理を行う。
<Example 1-1>
The character string set extraction unit 11 takes different sets of n-grams from the input text (15) for an integer constant n of 1 or more as follows.
(1) Clear the n-gram array. The array is a predetermined area in a memory or the like in the character string vector generation device 100. The same applies to the other embodiments.
(2) Perform the following process for each sentence in the text.

(2.1) 該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)から、連続するn個の文字(n-gram)をとり、該n-gramをn-gram配列に挿入する。この際、該n-gramが既にn-gram配列になければ挿入し(頻度もカウントする場合、さらに、n-gram配列中の該n-gramの頻度を1とする)、あれば何もしない(頻度もカウントする場合、さらに、n-gram配列中の該n-gramの頻度を1だけ増やす)。   (2.1) Numbering each character so that the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter the front of the sentence decreases and the rear of the sentence increases. To go. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N) is taken, and the n-gram is inserted into the n-gram array. At this time, if the n-gram is not already in the n-gram array, it is inserted (if the frequency is also counted, the frequency of the n-gram in the n-gram array is set to 1), and nothing is done. (When the frequency is also counted, the frequency of the n-gram in the n-gram array is further increased by 1).

このようにして得られたn-gram配列を、文字列集合A、Bとする。前述したように、n-gram配列の中で、高頻度のn-gramの集合に限定したものを、文字列集合AまたはBとしてもよい。   The n-gram arrays obtained in this way are set as character string sets A and B. As described above, the character string set A or B may be a string limited to a high-frequency n-gram set in the n-gram array.

以下、n=2とした場合の具体例を説明する。   Hereinafter, a specific example when n = 2 will be described.

図2は、入力テキスト(15)の例であり、図2中にある「時計とパンを買いパンを食べた」がテキスト中の1文である。   FIG. 2 is an example of the input text (15). “Buy clock and bread and ate bread” in FIG. 2 is one sentence in the text.

図3は、n=2としたときの文字列集合抽出部11の処理で得られた2-gram配列を示す。図3では、図2中の1文から得られた2-gramを表示している。ここで、図3における「〇時」は、該文における0文字目からの2-gramであることを示し、「た〇」は、該文におけるs文字目からの2-gramであることを示している。以下、図3の2-gram配列を、文字列集合A、Bとする。   FIG. 3 shows a 2-gram array obtained by the processing of the character string set extraction unit 11 when n = 2. In FIG. 3, a 2-gram obtained from one sentence in FIG. 2 is displayed. Here, “0 o'clock” in FIG. 3 indicates a 2-gram from the 0th character in the sentence, and “ta ○” indicates that it is a 2-gram from the s character in the sentence. Show. Hereinafter, the 2-gram array in FIG.

図4に、第1行列生成部12が実行する処理のフローチャートを示す。以下、実施例1-1における各ステップの処理について説明する。   FIG. 4 shows a flowchart of processing executed by the first matrix generation unit 12. Hereinafter, the process of each step in Example 1-1 will be described.

ステップ31) 図5に示すような、各行が集合A中のn-gramに対応し、各列が集合B中のn-gramに対応しているような行列を生成し、メモリ等の記憶手段に格納する。行列中の各要素は、対応する集合A中のn-gramと集合B中のn-gramとの共起頻度を表し、本ステップでは初期値として0をセットする。   Step 31) Generate a matrix such that each row corresponds to an n-gram in set A and each column corresponds to an n-gram in set B as shown in FIG. To store. Each element in the matrix represents the co-occurrence frequency of the corresponding n-gram in set A and n-gram in set B. In this step, 0 is set as an initial value.

ステップ32) 制御1として、集合A中のn-gramと集合B中のn-gramとが共起する頻度を算出する処理の対象となるテキスト中の所定の範囲を決定する。所定の範囲は、1文、1段落や1文書等の、連続する有限個の単語の列である。ここでの決定は、例えば、所定の範囲を示す情報を予め文字列ベクトル生成装置100の記憶手段に格納しておき、当該記憶手段から上記情報を読み出すことにより行うことができる。   Step 32) As the control 1, a predetermined range in the text to be processed is calculated for calculating the frequency with which the n-gram in the set A and the n-gram in the set B co-occur. The predetermined range is a string of a finite number of continuous words such as one sentence, one paragraph, and one document. This determination can be made, for example, by storing information indicating a predetermined range in the storage unit of the character string vector generation device 100 in advance and reading the information from the storage unit.

所定の範囲を1文とした場合は、まず、テキスト中の最初の文を処理対象とする。処理対象とした文に関するステップ33以降の処理が終了したならば、その次の文を処理対象とする。最後の文に関するステップ33以降の処理が終了したならば、処理対象の文はないので、本フローチャートを終了する。所定の範囲を、他のものとした場合も同様である。   When the predetermined range is one sentence, the first sentence in the text is first processed. When the processing from step 33 regarding the sentence to be processed is completed, the next sentence is set as the processing target. If the processing after step 33 relating to the last sentence is completed, there is no sentence to be processed, and thus this flowchart is ended. The same applies to the case where the predetermined range is other.

ステップ33) 集合A中のn-gramとその頻度の対の配列である配列aと、集合B中のn-gramとその頻度の対の配列である配列bを、クリアする。   Step 33) The array a which is an array of n-gram and its frequency in the set A and the array b which is an array of n-gram and its frequency in the set B are cleared.

ステップ34) 制御2として、処理対象のテキストの範囲におけるn-gramの列を以下のように定める。   Step 34) As control 2, an n-gram sequence in the range of the text to be processed is defined as follows.

該範囲における各文において、該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)からのn-gramを順にとり、該文のn-gram列とする。該範囲における各文のn-gram列を、文の順につなげたものを、該範囲におけるn-gram列とする。   In each sentence in the range, the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter each character is such that the front of the sentence decreases and the rear of the sentence increases. Number. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N-grams from (excluded) are taken in order to form an n-gram sequence of the sentence. The n-gram sequence of each sentence in the range is connected to the sentence in the order of the sentences, and is defined as the n-gram sequence in the range.

上記のように定めた上で、該範囲における、処理対象とするn-gramを以下のようにして決定する。   After determining as described above, an n-gram to be processed in the range is determined as follows.

まず、該範囲におけるn-gram列の最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ35の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ35の処理が終了したならば、処理対象のn-gramはないので、ステップ36へ移行する。   First, the first n-gram of the n-gram sequence in the range is set as a processing target. When the processing of step 35 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 35 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 36.

ステップ35) 処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。ヒットすれば、配列aにおける該n-gramの頻度を1だけ増やす。   Step 35) Search the set A with the n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a. If there is a hit, the frequency of the n-gram in sequence a is increased by 1.

処理対象のn-gramで集合Bを検索する。ヒットすれば、以下を行う。該n-gramで配列bを検索する。ヒットしなければ、配列bに該n-gramとその頻度1の対を追加する。ヒットすれば、配列bにおける該n-gramの頻度を1だけ増やす。   Search set B by n-gram to be processed. If hit, do the following: The array b is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the sequence b. If there is a hit, the frequency of the n-gram in sequence b is increased by 1.

上記の処理により、図2に示したテキストの1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図6の配列aと図7の配列bが得られる。   With the above processing, the array a in FIG. 6 and the array b in FIG. 7 are obtained from the range of the text shown in FIG. 2 when there is no n-gram to be processed in step 34.

ステップ36) 配列aにおける、処理対象とするn-gramを以下のようにして決定する。   Step 36) The n-gram to be processed in the array a is determined as follows.

まず、配列aにおける最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ37の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ37の処理が終了したならば、処理対象のn-gramはないので、ステップ32へ移行する。   First, the first n-gram in the array a is a processing target. When the processing in step 37 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 37 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 32.

ステップ37) 配列bの各n-gramVの頻度に、処理対象のn-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、n-gramVに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象n-gram(同一n-gramのものが複数あっても別物とする)に対し、該n-gram自身との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   Step 37) Add the frequency of each n-gramV in array b to the frequency in array a of n-gramU to be processed to the component corresponding to n-gramV in the row vector corresponding to n-gramU To do. Here, as a method of addition, self-co-occurrence that counts the co-occurrence with the n-gram itself for the processing target n-gram in the processing target range (even if there are multiple things of the same n-gram) There are two types: a method and a self-non-cooccurrence method that does not count.

1) 自己共起方式
・配列bの各n-gramVの頻度に、処理対象のn-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、n-gramVに対応する成分に加算する。
1) Self-co-occurrence method
A value obtained by multiplying the frequency of each n-gramV in array b by the frequency in array a of n-gramU to be processed is added to the component corresponding to n-gramV in the row vector corresponding to n-gramU.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成し、処理対象のn-gramUが配列b'にあれば、n-gramUの配列b'における頻度から1だけ減じる。
・配列b'の各n-gramVの頻度に、n-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、n-gramVに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
If array b ′ is generated as a copy of array b and n-gram U to be processed is in array b ′, the frequency of n-gram U in array b ′ is decreased by 1.
A value obtained by multiplying the frequency of each n-gram V in the array b ′ by the frequency in the array a of the n-gram U is added to the component corresponding to the n-gram V of the row vector corresponding to the n-gram U.
• Clear array b '.

自己非共起方式での具体例として、ステップ32で、行列が図5であり、かつ、図2に示したテキストの1範囲を処理対象と決定した場合を考える。ステップ36で図6の配列aにおけるn-gram「パン」を処理対象と決定したときに、ステップ37では、図7の配列bのn-gram「パン」の頻度から1だけ減じて得られる図8の配列b'の各頻度に、n-gram「パン」の配列aにおける頻度2を乗じて、n-gram「パン」の行ベクトルに加算する。ステップ36で処理対象のn-gramがなくなった時点で、図9の行列が得られる。   As a specific example of the self-non-co-occurrence method, consider a case where, in step 32, the matrix is FIG. 5, and one range of text shown in FIG. FIG. 6 is a diagram obtained by subtracting 1 from the frequency of the n-gram “pan” in the array b in FIG. 7 when the n-gram “pan” in the array a in FIG. Each frequency of array b ′ of 8 is multiplied by frequency 2 in array a of n-gram “pan” and added to the row vector of n-gram “pan”. When there is no n-gram to be processed in step 36, the matrix of FIG. 9 is obtained.

上記実施例1-1における図4のフローチャートの説明では、処理対象のテキストの範囲におけるn-gramで同一のものが複数あるとき、それぞれを別物として処理しているが、処理対象のテキストの範囲におけるn-gramで同一のものが複数あっても、1個として扱う処理方法も考えられる。この処理方法を用いる場合、ステップ35が以下のようになる。   In the description of the flowchart of FIG. 4 in Example 1-1 above, when there are a plurality of identical n-grams in the range of text to be processed, each is processed as a separate item, but the range of text to be processed Even if there are multiple identical n-grams, there can be a processing method that treats them as one. When this processing method is used, step 35 is as follows.

ステップ35) 処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。   Step 35) Search the set A with the n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a.

処理対象のn-gramで集合Bを検索する。ヒットすれば、以下を行う。該n-gramで配列bを検索する。ヒットしなければ、配列bに該n-gramとその頻度1の対を追加する。   Search set B by n-gram to be processed. If hit, do the following: The array b is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the sequence b.

図2に示したテキストの1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、配列aは図6の各n-gramの頻度を1にしたものが、配列bは図7の各n-gramの頻度を1にしたものが得られる。   From the range of the text shown in FIG. 2, when there are no n-grams to be processed in step 34, the array a has the frequency of each n-gram in FIG. You can get one with the frequency of each n-gram of 7.

<実施例1-2>
次に、実施例1-2について説明する。まず、文字列集合抽出部11は、単語辞書を参照して、入力テキスト(15)を形態素解析する。単語辞書は、文字列ベクトル生成装置100の記憶手段に格納されていてもよいし、外部装置に格納され、通信ネットワークを介してアクセスするものであってもよい。
<Example 1-2>
Next, Example 1-2 will be described. First, the character string set extraction unit 11 performs morphological analysis on the input text (15) with reference to the word dictionary. The word dictionary may be stored in the storage unit of the character string vector generation device 100, or may be stored in an external device and accessed via a communication network.

図10は、単語辞書の内容の一例を示す図である。図10の例では、単語辞書は、1レコードが1単語に関する情報となっており、1レコードは、カンマで区切られた2つの項目から構成されている。第1項目は単語の表記であり、第2項目は該単語の品詞情報である。活用語に対しては、終止形も新たな項目として登録しておくようにしてもよい。   FIG. 10 is a diagram showing an example of the contents of the word dictionary. In the example of FIG. 10, in the word dictionary, one record is information related to one word, and one record is composed of two items separated by a comma. The first item is a word notation, and the second item is the part of speech information of the word. You may make it register a closing form as a new item with respect to a use word.

文字列集合抽出部11は、形態素解析の結果得られる単語に対し、その後の処理で用いる単語(必要語と呼ぶ)か、用いない単語(不要語と呼ぶ)かを判断する。一般に、名詞、動詞、形容詞等の内容語が必要語となる。   The character string set extraction unit 11 determines whether the word obtained as a result of the morphological analysis is a word used in subsequent processing (referred to as a necessary word) or a word not used (referred to as an unnecessary word). In general, content words such as nouns, verbs, and adjectives are necessary words.

単語が必要語かどうかは、例えば、不要語を記述した不要語テーブルと、不要語の品詞を記述した不要品詞テーブルを文字列ベクトル生成装置100の記憶手段に格納しておき、これらのテーブルを参照することにより判断する。   Whether or not a word is a necessary word is determined by, for example, storing an unnecessary word table describing unnecessary words and an unnecessary part of speech table describing parts of speech of unnecessary words in the storage unit of the character string vector generation device 100. Judgment by reference.

図11は、不要語テーブルの内容の一例である。不要とされる各単語の終止形(終止形がない単語に対しては、単語表記を終止形とする。)が1レコードとして記述されている。図12は、不要品詞テーブルの内容の一例である。不要とされる各品詞情報が1レコードとして記述されている。   FIG. 11 shows an example of the contents of the unnecessary word table. The ending form of each word that is considered unnecessary (the word notation is the ending form for words that do not have a ending form) is described as one record. FIG. 12 is an example of the contents of the unnecessary part-of-speech table. Each part-of-speech information that is unnecessary is described as one record.

図2のテキストを形態素解析した結果を図13に示す。図13に示すように、各単語間は"/"で区切られている。各単語は、単語表記、終止形、品詞情報、必要語フラグから成っており、それぞれ","で区切られている。終止形が登録されていない単語に対しては、形態素解析後に、単語表記と品詞情報から終止形を導出し、終止形がない単語に対しては、単語表記を終止形とする。終止形が不要語テーブルのあるレコードと一致するか、あるいは、品詞情報が不要品詞テーブルのあるレコードと一致する場合、必要語フラグを0とし、一致しない場合、必要語フラグを1とする。   The result of morphological analysis of the text in FIG. 2 is shown in FIG. As shown in FIG. 13, each word is separated by “/”. Each word is composed of a word notation, an end form, part-of-speech information, and a necessary word flag, and each word is separated by “,”. For words for which no final form is registered, the final form is derived from the word notation and part-of-speech information after the morphological analysis, and for words that do not have a final form, the word notation is used as the final form. If the final form matches a record with an unnecessary word table, or if the part of speech information matches a record with an unnecessary part of speech table, the required word flag is set to 0, and if not, the required word flag is set to 1.

そして、文字列集合抽出部11は、形態素解析結果から、単語の異なりの集合と、1以上の整数の定数nに対し、n-gramの異なりの集合をとる。この処理は、以下のようにして行う。
(1) 単語の配列、n-gramの配列をクリアする。
(2) 形態素解析結果中の文ごとに以下の処理を行う。
Then, the character string set extraction unit 11 takes different sets of n-grams for different sets of words and an integer constant n of 1 or more from the morphological analysis result. This process is performed as follows.
(1) Clear the word array and n-gram array.
(2) The following processing is performed for each sentence in the morphological analysis result.

(2.1)・形態素解析結果中の終止形で、必要語フラグが1となっているものを、単語配列に挿入する。この際、該終止形が既に単語配列になければ挿入し(頻度もカウントする場合、さらに、単語配列中の該終止形の頻度を1とする)、あれば何もしない(頻度もカウントする場合、さらに、単語配列中の該終止形の頻度を1だけ増やす)。
・形態素解析結果中の単語表記を連結した非分割文を生成する。
・該非分割文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)から、連続するn個の文字(n-gram)をとり、該n-gramをn-gram配列に挿入する。この際、該n-gramが既にn-gram配列になければ挿入し(頻度もカウントする場合、さらに、n-gram配列中の該n-gramの頻度を1とする)、あれば何もしない(頻度もカウントする場合、さらに、n-gram配列中の該n-gramの頻度を1だけ増やす)。
・該非分割文をクリアする。
(2.1)-Insert the final form in the morpheme analysis result with the required word flag set to 1 into the word array. At this time, if the final form is not already in the word sequence, it is inserted (if the frequency is counted, the frequency of the final form in the word sequence is set to 1), and nothing is done if the frequency is counted. In addition, the frequency of the terminal form in the word sequence is increased by 1).
・ Generate a non-divided sentence by concatenating word expressions in the morphological analysis result.
-Number each character so that the first character of the non-split sentence is the first character, the position immediately before the first character is the 0th character, and thereafter the front of the sentence decreases and the rear of the sentence increases. Go. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N) is taken, and the n-gram is inserted into the n-gram array. At this time, if the n-gram is not already in the n-gram array, it is inserted (if the frequency is also counted, the frequency of the n-gram in the n-gram array is set to 1), and nothing is done. (When the frequency is also counted, the frequency of the n-gram in the n-gram array is further increased by 1).
-Clear the unsplit sentence.

このようにして得られた単語配列とn-gram配列を、それぞれ、高頻度の単語、高頻度のn-gramに限定してもよい。   The word array and n-gram array obtained in this way may be limited to high-frequency words and high-frequency n-grams, respectively.

文字列集合抽出部11は、上記のようにして得られた単語配列とn-gram配列を、共通要素を持たない集合ととらえて結合し、文字列集合Aとする。文字列集合Aでは、単語とn-gramで同一の文字列のものがあったとしても、別物ととらえる。また、単語配列を文字列集合Bとする。   The character string set extraction unit 11 regards the word array and the n-gram array obtained as described above as a set having no common elements, and combines them into a character string set A. In the character string set A, even if a word and an n-gram have the same character string, they are regarded as different things. Also, let the word array be a character string set B.

以下、n=1とした場合の具体例を説明する。   Hereinafter, a specific example when n = 1 is described.

図13の形態素解析結果から、n=1として文字列集合抽出部11の処理を行って得られた文字列集合Aを図14に示し、文字列集合Bを図15に示す。図14は、単語配列と1-gram配列を罫線で分かれているように表示しており、図13中の1文から得られた単語及び1-gramを表示している。図15は、図13中の1文から得られた単語を表示している。   FIG. 14 shows a character string set A and FIG. 15 shows a character string set B obtained by performing the processing of the character string set extraction unit 11 with n = 1 from the morphological analysis result of FIG. FIG. 14 displays the word array and the 1-gram array so as to be separated by ruled lines, and displays the word and 1-gram obtained from one sentence in FIG. FIG. 15 displays words obtained from one sentence in FIG.

図4に、第1行列生成部12が実行する処理のフローチャートを示す。以下、実施例1-2における各ステップの処理について説明する。   FIG. 4 shows a flowchart of processing executed by the first matrix generation unit 12. Hereinafter, processing of each step in Example 1-2 will be described.

ステップ31) 図16に示すような、各行が集合A中の文字列(単語またはn-gram)に対応し、各列が集合B中の単語に対応しているような行列を生成し、メモリ等の記憶手段に格納する。行列中の各要素は、対応する集合A中の文字列と集合B中の単語との共起頻度を表し、本ステップでは初期値として0をセットする。   Step 31) Generate a matrix such that each row corresponds to a character string (word or n-gram) in set A and each column corresponds to a word in set B, as shown in FIG. It stores in storage means such as. Each element in the matrix represents the co-occurrence frequency of the corresponding character string in the set A and the word in the set B. In this step, 0 is set as an initial value.

ステップ32) 制御1として、集合A中の文字列と集合B中の単語とが共起する頻度を算出する処理の対象となる形態素解析結果中の所定の範囲を決定する。所定の範囲は、1文、1段落や1文書等の、連続する有限個の単語の列である。ここでの決定は、例えば、所定の範囲を示す情報を予め文字列ベクトル生成装置100の記憶手段に格納しておき、当該記憶手段から上記情報を読み出すことにより行うことができる。   Step 32) As control 1, a predetermined range in the result of morpheme analysis to be subjected to processing for calculating the frequency of co-occurring character strings in set A and words in set B is determined. The predetermined range is a string of a finite number of continuous words such as one sentence, one paragraph, and one document. This determination can be made, for example, by storing information indicating a predetermined range in the storage unit of the character string vector generation device 100 in advance and reading the information from the storage unit.

所定の範囲を1文とした場合は、まず、形態素解析結果中の最初の文を処理対象とする。処理対象とした文に関するステップ33以降の処理が終了したならば、その次の文を処理対象とする。最後の文に関するステップ33以降の処理が終了したならば、処理対象の文はないので、本フローチャートを終了する。所定の範囲を、他のものとした場合も同様である。   When the predetermined range is one sentence, the first sentence in the morphological analysis result is first processed. When the processing from step 33 regarding the sentence to be processed is completed, the next sentence is set as the processing target. If the processing after step 33 relating to the last sentence is completed, there is no sentence to be processed, and thus this flowchart is ended. The same applies to the case where the predetermined range is other.

ステップ33) 集合A中の文字列とその頻度の対の配列である配列aと、集合B中の単語とその頻度の対の配列である配列bと、非分割テキストを、クリアする。   Step 33) The array a which is an array of pairs of character strings and their frequencies in the set A, the array b which is an array of pairs of words and their frequencies in the set B, and the undivided text are cleared.

処理対象の形態素解析結果の範囲における単語表記を連結した非分割テキストを生成し、記憶手段に格納する。   Non-divided text in which word notations in the range of the morpheme analysis result to be processed are connected is generated and stored in the storage means.

ステップ34) 制御2として、処理対象の形態素解析結果の範囲におけるn-gramの列を以下のように定める。   Step 34) As the control 2, an n-gram sequence in the range of the morphological analysis result to be processed is determined as follows.

該範囲の非分割テキストにおける各文において、該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)からのn-gramを順にとり、該文のn-gram列とする。該範囲の非分割テキストにおける各文のn-gram列を、文の順につなげたものを、該範囲におけるn-gram列とする。   In each sentence in the non-split text in the range, the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter the front of the sentence decreases and the rear of the sentence increases Then, number each letter. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N-grams from (excluded) are taken in order to form an n-gram sequence of the sentence. The n-gram sequence of each sentence in the non-divided text in the range is connected to the sentence in the order of the sentences, and is defined as the n-gram sequence in the range.

上記のように定めた上で、該範囲における、処理対象とするn-gramを以下のようにして決定する。   After determining as described above, an n-gram to be processed in the range is determined as follows.

まず、該範囲におけるn-gram列の最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ35の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ35の処理が終了したならば、処理対象のn-gramはないので、ステップ36へ移行する。   First, the first n-gram of the n-gram sequence in the range is set as a processing target. When the processing of step 35 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 35 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 36.

ステップ35) 配列aにおいては、単語とn-gramとは、文字列として一致しても別物として扱う。   Step 35) In the array a, a word and an n-gram are treated as different characters even if they match as a character string.

処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。ヒットすれば、配列aにおける該n-gramの頻度を1だけ増やす。   Search set A by n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a. If there is a hit, the frequency of the n-gram in sequence a is increased by 1.

処理対象のn-gramの先頭文字に対応する、形態素解析結果中の単語表記の文字が、単語表記の先頭文字であり、かつ、該単語表記の必要語フラグが1であれば、該単語表記の終止形を処理対象として以下を行う。   If the word notation character in the morphological analysis result corresponding to the first character of the n-gram to be processed is the first character of the word notation and the required word flag of the word notation is 1, the word notation The following processing is performed on the final form of processing.

処理対象の終止形で集合Aを検索する。ヒットすれば、以下を行う。該終止形で配列aを検索する。ヒットしなければ、配列aに該終止形とその頻度1の対を追加する。ヒットすれば、配列aにおける該終止形の頻度を1だけ増やす。   Search set A with the final form to be processed. If hit, do the following: The sequence a is searched with the end form. If there is no hit, add the terminal form and its frequency 1 pair to sequence a. If there is a hit, the frequency of the terminal form in sequence a is increased by one.

処理対象の終止形で集合Bを検索する。ヒットすれば、以下を行う。該終止形で配列bを検索する。ヒットしなければ、配列bに該終止形とその頻度1の対を追加する。ヒットすれば、配列bにおける該終止形の頻度を1だけ増やす。   Search set B with the final form to be processed. If hit, do the following: The sequence b is searched with the end form. If there is no hit, the pair of the terminal form and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the terminal form in sequence b is increased by one.

上記の処理により、図13に示した形態素解析結果の1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図17の配列aと図18の配列bが得られる。   With the above processing, the array a in FIG. 17 and the array b in FIG. 18 are obtained from the range of the morphological analysis results shown in FIG. 13 when there is no n-gram to be processed in step.

なお、ステップ34、35では、処理対象の範囲におけるn-gramと単語の頻度を同時に求めているが、ステップ34、35において、該範囲の非分割テキストをもとにn-gramの頻度のみを求め、それらのステップとは別に、該範囲の形態素解析結果をもとに単語の頻度を求めるステップを設けるという構成にしてもよい。   In steps 34 and 35, the frequency of the n-gram and the word in the processing target range is obtained simultaneously. In steps 34 and 35, only the frequency of the n-gram is calculated based on the non-divided text in the range. In addition to these steps, a step of obtaining a word frequency based on the morphological analysis result in the range may be provided.

ステップ36) 配列aにおける、処理対象とする文字列を以下のようにして決定する。   Step 36) The character string to be processed in the array a is determined as follows.

まず、配列aにおける最初の文字列を処理対象とする。処理対象とした文字列に関するステップ37の処理が終了したならば、その次の文字列を処理対象とする。最後の文字列に関するステップ37の処理が終了したならば、処理対象の文字列はないので、ステップ32へ移行する。   First, the first character string in the array a is a processing target. When the processing in step 37 regarding the character string to be processed is completed, the next character string is set as the processing target. When the process of step 37 regarding the last character string is completed, there is no character string to be processed, and the process proceeds to step 32.

ステップ37) 配列aにおけるn-gramと配列bにおける単語は、文字列として一致しても別物として扱う。   Step 37) The n-gram in the array a and the word in the array b are treated as different objects even if they match as a character string.

配列bの各単語Vの頻度に、処理対象の文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、単語Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象文字列(同一文字列のものが複数あっても別物とする)に対し、該文字列自身との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   A value obtained by multiplying the frequency of each word V in the array b by the frequency in the array a of the character string U to be processed is added to the component corresponding to the word V in the row vector corresponding to the character string U. Here, as a method of addition, a self-co-occurrence method for counting the co-occurrence with the character string itself for the processing target character string in the processing target range (even if there are a plurality of the same character string), There are self-non-co-occurrence methods that do not count, and each has the following processing contents.

1) 自己共起方式
・配列bの各単語Vの頻度に、処理対象の文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、単語Vに対応する成分に加算する。
1) Self-co-occurrence method
A value obtained by multiplying the frequency of each word V in the array b by the frequency in the array a of the character string U to be processed is added to the component corresponding to the word V in the row vector corresponding to the character string U.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成し、処理対象の文字列Uが配列b'にあれば、文字列Uの配列b'における頻度から1だけ減じる。
・配列b'の各単語Vの頻度に、文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、単語Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
If array b ′ is generated as a copy of array b and character string U to be processed is in array b ′, the frequency of array U of character string U is reduced by 1.
A value obtained by multiplying the frequency of each word V in the array b ′ by the frequency in the array a of the character string U is added to the component corresponding to the word V in the row vector corresponding to the character string U.
• Clear array b '.

自己非共起方式での具体例として、ステップ32で、行列が図16であり、かつ、図13に示した形態素解析結果の1範囲を処理対象と決定した場合を考える。ステップ36で図17の配列aにおける単語「パン」を処理対象と決定したときに、ステップ37では、図18の配列bの単語「パン」の頻度から1だけ減じて得られる図19の配列b'の各頻度に、単語「パン」の配列aにおける頻度2を乗じて、単語「パン」の行ベクトルに加算する。ステップ36で処理対象の文字列がなくなった時点で、図20の行列が得られる。   As a specific example of the self-non-co-occurrence method, consider a case where, in step 32, the matrix is FIG. 16, and one range of the morphological analysis results shown in FIG. When the word “pan” in the array a in FIG. 17 is determined as a processing target in step 36, the array b in FIG. 19 obtained by subtracting 1 from the frequency of the word “pan” in the array b in FIG. 18 is obtained in step 37. Each frequency of 'is multiplied by the frequency 2 in the array a of the word “pan” and added to the row vector of the word “pan”. When there is no character string to be processed in step 36, the matrix of FIG. 20 is obtained.

上記実施例1-2における図4のフローチャートの説明では、処理対象の形態素解析結果の範囲において、単語で同一のものが複数あるときや、n-gramで同一のものが複数あるとき、それぞれを別物として処理しているが、処理対象の形態素解析結果の範囲において、単語で同一のものが複数あるときや、n-gramで同一のものが複数あるときでも、それらを1個として扱う処理方法も考えられる。この処理方法を用いる場合、ステップ35が以下のようになる。   In the description of the flowchart of FIG. 4 in Example 1-2 above, when there are a plurality of the same words in the range of the morphological analysis results to be processed, or when there are a plurality of the same n-grams, A processing method that treats them as one, even if there are multiple identical words or n-grams that are the same in the scope of the morphological analysis results to be processed, even though they are processed separately Is also possible. When this processing method is used, step 35 is as follows.

ステップ35) 配列aにおいては、単語とn-gramとは、文字列として一致しても別物として扱う。   Step 35) In the array a, a word and an n-gram are treated as different characters even if they match as a character string.

処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。   Search set A by n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a.

処理対象のn-gramの先頭文字に対応する、形態素解析結果中の単語表記の文字が、単語表記の先頭文字であり、かつ、該単語表記の必要語フラグが1であれば、該単語表記の終止形を処理対象として以下を行う。   If the word notation character in the morphological analysis result corresponding to the first character of the n-gram to be processed is the first character of the word notation and the required word flag of the word notation is 1, the word notation The following processing is performed on the final form of processing.

処理対象の終止形で集合Aを検索する。ヒットすれば、以下を行う。該終止形で配列aを検索する。ヒットしなければ、配列aに該終止形とその頻度1の対を追加する。   Search set A with the final form to be processed. If hit, do the following: The sequence a is searched with the end form. If there is no hit, add the terminal form and its frequency 1 pair to sequence a.

処理対象の終止形で集合Bを検索する。ヒットすれば、以下を行う。該終止形で配列bを検索する。ヒットしなければ、配列bに該終止形とその頻度1の対を追加する。   Search set B with the final form to be processed. If hit, do the following: The sequence b is searched with the end form. If there is no hit, the pair of the terminal form and its frequency 1 is added to the sequence b.

図13に示した形態素解析結果の1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、配列aは図17の各文字列の頻度を1にしたものが、配列bは図7の各単語の頻度を1にしたものが得られる。   From the range of the morphological analysis results shown in FIG. 13, when the n-gram to be processed in step 34 disappears, the array a has the frequency of each character string in FIG. A word with the frequency of each word in FIG. 7 set to 1 is obtained.

[実施例2]
図21に、本発明の実施例2に係る文字列ベクトル生成装置200の構成例を示す。図21に示すように、実施例2の文字列ベクトル生成装置200は、文字列集合抽出部11、成分番号付与部22、第2行列生成部23、テキスト格納部101、文字列集合格納部102、及び文字列ベクトル格納部103を備える。
[Example 2]
FIG. 21 shows a configuration example of the character string vector generation device 200 according to the second embodiment of the present invention. As shown in FIG. 21, the character string vector generation device 200 according to the second embodiment includes a character string set extraction unit 11, a component number assigning unit 22, a second matrix generation unit 23, a text storage unit 101, and a character string set storage unit 102. , And a character string vector storage unit 103.

文字列集合抽出部11は、実施例1における文字列集合抽出部11と同一である。   The character string set extraction unit 11 is the same as the character string set extraction unit 11 in the first embodiment.

成分番号付与部22は、文字列集合格納部102から文字列集合B(17)を読み出して入力とし、集合B中の各文字列に対し、L個の成分番号からなる成分番号集合中のいくつかの成分番号を対応付けた成分番号付文字列集合B(24)を出力し、文字列集合格納部102に格納する。   The component number assigning unit 22 reads out the character string set B (17) from the character string set storage unit 102 and uses it as an input. The component number-attached character string set B (24) associated with the component number is output and stored in the character string set storage unit 102.

第2行列生成部23は、テキスト(15)、文字列集合A(16)、成分番号付文字列集合B(24)をテキスト格納部101及び文字列集合格納部102から読み出して入力とし、各行が集合A中の文字列に対応し、各列が成分番号集合中の成分番号に対応しているような行列を生成し、テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、集合A中の文字列Cと、集合B中の文字列に対応付けられた成分番号Eとが共起する頻度を、テキスト中の全ての所定の範囲にわたって加算した値を、文字列Cと成分番号Eに対応する該行列中の要素に格納し、集合A中の文字列と、該文字列に対応する該行列の行ベクトルとの対の集合である文字列ベクトルデータベース1(18)を出力し、文字列ベクトル格納部103に格納する。   The second matrix generation unit 23 reads the text (15), the character string set A (16), and the component numbered character string set B (24) from the text storage unit 101 and the character string set storage unit 102, and inputs each row. Generates a matrix in which each corresponds to a character string in set A and each column corresponds to a component number in the component number set, and a predetermined range that is a sequence of a finite number of consecutive words in the text The value obtained by adding the frequency of the occurrence of the character string C in the set A and the component number E associated with the character string in the set B over all the predetermined ranges in the text Stored in the element in the matrix corresponding to the column C and the component number E, the character string vector database 1 (a set of pairs of the character string in the set A and the row vector of the matrix corresponding to the character string 18) is output and stored in the character string vector storage unit 103.

なお、第2行列生成部23は、文字列ベクトルデータベース1(18)を文字列ベクトル格納部103に対して出力、及び格納することに代えて、例えば通信ネットワークを介して、文字列ベクトル生成装置200の外部にある装置に出力することとしてもよい。   The second matrix generation unit 23, instead of outputting and storing the character string vector database 1 (18) to the character string vector storage unit 103, for example, a character string vector generation device via a communication network It is good also as outputting to the apparatus outside 200.

以下、実施例2における処理の詳細例として、n-gram間の共起をとる実施例2-1と、単語間共起の行の単語集合にn-gram集合を加える実施例2-2を説明する。   Hereinafter, as a detailed example of processing in Example 2, Example 2-1 in which co-occurrence between n-grams is taken, and Example 2-2 in which an n-gram set is added to a word set in a co-occurrence line between words explain.

<実施例2-1>
文字列集合抽出部11は、入力テキスト(15)から、1以上の整数の定数nに対し、n-gramの異なりの集合をとる。処理内容は、実施例1-1の文字列集合抽出部11の処理内容と同一である。
<Example 2-1>
The character string set extraction unit 11 takes different sets of n-grams from the input text (15) for an integer constant n of 1 or more. The processing content is the same as the processing content of the character string set extraction unit 11 of Example 1-1.

以下、n=2とした場合の具体例を説明する。   Hereinafter, a specific example when n = 2 will be described.

図2の入力テキスト(15)から文字列集合抽出部11の処理で得られる図3の2-gram配列を、文字列集合A、Bとする。   The 2-gram array in FIG. 3 obtained by the processing of the character string set extraction unit 11 from the input text (15) in FIG.

成分番号付与部22は、集合B中の各文字列に対し、L個の成分番号からなる成分番号集合(集合Fと呼ぶ)中のいくつかの成分番号を対応付ける。   The component number assigning unit 22 associates each character string in the set B with several component numbers in a component number set (referred to as set F) composed of L component numbers.

集合Fを本実施例では{1, 2,・・・, L}とする。また、一文字列に対応付ける成分番号の個数を定数Kとして定めておく。定数Kは、異なる文字列には異なる成分番号集合が対応付けられるように、以下のようにして定める。   Assume that the set F is {1, 2,..., L} in this embodiment. The number of component numbers associated with one character string is determined as a constant K. The constant K is determined as follows so that different component numbers are associated with different character strings.

L個の成分番号から抽出したK個の成分番号の組合せの数   Number of combinations of K component numbers extracted from L component numbers

Figure 0005513985
は、以下の式で表される。
Figure 0005513985
Is represented by the following equation.

Figure 0005513985
そして、集合Bの要素数をMとしたとき、
Figure 0005513985
And when the number of elements in set B is M,

Figure 0005513985
となるようにKを定める。Kをこのように定めることにより、異なる文字列には異なる成分番号集合を対応付けることができる。
Figure 0005513985
Determine K to be By defining K in this way, different component number sets can be associated with different character strings.

成分番号付与部22の処理は、以下のようにして行われる。
(1) 集合Bの文字列ごとに以下の処理を行う。
The processing of the component number assigning unit 22 is performed as follows.
(1) The following processing is performed for each character string of set B.

(1.1) L個の成分番号から抽出されるK個の成分番号の集合の群から、それまでに付与した成分番号集合の群を除いた集合群から、ランダムに一つの成分番号集合を選び、該成分番号集合を該文字列に付与する。   (1.1) From the set of K component numbers extracted from L component numbers, a set of component numbers excluding the set of component number sets assigned so far, one component number set is randomly selected, The component number set is assigned to the character string.

図22は、図3の文字列集合Bを入力とし、K=2としたときの成分番号付与部22の処理で得られた成分番号付文字列集合Bの例を示す図である。各文字列には、その文字列にユニークな、2個の要素からなる成分番号集合が対応付けられており、該成分番号集合は第2項目として、各成分番号がコロン区切りとなっている。   FIG. 22 is a diagram showing an example of the component number-attached character string set B obtained by the processing of the component number assigning unit 22 when the character string set B of FIG. 3 is input and K = 2. Each character string is associated with a component number set consisting of two elements that is unique to the character string. The component number set is a second item, and each component number is separated by a colon.

実施例2-1における以後の第2行列生成部23の処理の説明において集合Bとは、この成分番号付文字列集合Bを意味するものとする。   In the following description of the processing of the second matrix generation unit 23 in Example 2-1, the set B means the character string set B with component numbers.

図4に、第2行列生成部23が実行する処理のフローチャートを示す。以下、実施例2-1における各ステップの処理について説明する。   FIG. 4 shows a flowchart of processing executed by the second matrix generation unit 23. Hereinafter, the process of each step in Example 2-1 will be described.

ステップ31) 図23に示すような、各行が集合A中のn-gramに対応し、各列が集合F中の成分番号に対応しているような行列を生成し、メモリ等の記憶手段に格納する。行列中の各要素は、対応する集合A中のn-gramと集合F中の成分番号との共起頻度を表し、本ステップでは初期値として0をセットする。   Step 31) Generate a matrix in which each row corresponds to an n-gram in set A and each column corresponds to a component number in set F, as shown in FIG. Store. Each element in the matrix represents the co-occurrence frequency of the corresponding n-gram in the set A and the component number in the set F. In this step, 0 is set as an initial value.

ステップ32) 制御1として、集合A中のn-gramと集合F中の成分番号とが共起する頻度を算出する処理の対象となるテキスト中の所定の範囲を決定する。所定の範囲は、1文、1段落や1文書等の、連続する有限個の単語の列である。ここでの決定は、例えば、所定の範囲を示す情報を予め文字列ベクトル生成装置200の記憶手段に格納しておき、当該記憶手段から上記情報を読み出すことにより行うことができる。   Step 32) As the control 1, a predetermined range in the text to be processed is calculated for calculating the frequency with which the n-gram in the set A and the component number in the set F co-occur. The predetermined range is a string of a finite number of continuous words such as one sentence, one paragraph, and one document. The determination here can be performed, for example, by storing information indicating a predetermined range in the storage unit of the character string vector generation device 200 in advance and reading the information from the storage unit.

所定の範囲を1文とした場合は、まず、テキスト中の最初の文を処理対象とする。処理対象とした文に関するステップ33以降の処理が終了したならば、その次の文を処理対象とする。最後の文に関するステップ33以降の処理が終了したならば、処理対象の文はないので、本フローチャートを終了する。所定の範囲を、他のものとした場合も同様である。   When the predetermined range is one sentence, the first sentence in the text is first processed. When the processing from step 33 regarding the sentence to be processed is completed, the next sentence is set as the processing target. If the processing after step 33 relating to the last sentence is completed, there is no sentence to be processed, and thus this flowchart is ended. The same applies to the case where the predetermined range is other.

ステップ33) 集合A中のn-gramとその頻度の対の配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bを、クリアする。   Step 33) The array a which is a pair of n-gram and its frequency in the set A and the array b which is a pair of the component number and its frequency in the set F are cleared.

ステップ34) 制御2として、処理対象のテキストの範囲におけるn-gramの列を以下のように定める。   Step 34) As control 2, an n-gram sequence in the range of the text to be processed is defined as follows.

該範囲における各文において、該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)からのn-gramを順にとり、該文のn-gram列とする。該範囲における各文のn-gram列を、文の順につなげたものを、該範囲におけるn-gram列とする。   In each sentence in the range, the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter each character is such that the front of the sentence decreases and the rear of the sentence increases. Number. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N-grams from (excluded) are taken in order to form an n-gram sequence of the sentence. The n-gram sequence of each sentence in the range is connected to the sentence in the order of the sentences, and is defined as the n-gram sequence in the range.

上記のように定めた上で、該範囲における、処理対象とするn-gramを以下のようにして決定する。   After determining as described above, an n-gram to be processed in the range is determined as follows.

まず、該範囲におけるn-gram列の最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ35の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ35の処理が終了したならば、処理対象のn-gramはないので、ステップ36へ移行する。   First, the first n-gram of the n-gram sequence in the range is set as a processing target. When the processing of step 35 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 35 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 36.

ステップ35) 処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。ヒットすれば、配列aにおける該n-gramの頻度を1だけ増やす。   Step 35) Search the set A with the n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a. If there is a hit, the frequency of the n-gram in sequence a is increased by 1.

処理対象のn-gramで集合Bを検索する。ヒットすれば、以下を行う。該n-gramに対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B by n-gram to be processed. If hit, do the following: The following is performed for each component number associated with the n-gram. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

上記の処理により、図2に示したテキストの1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図6の配列aと図24の配列bが得られる。   With the above processing, the array a in FIG. 6 and the array b in FIG. 24 are obtained from the range of the text shown in FIG. 2 when there is no n-gram to be processed in step.

ステップ36) 配列aにおける、処理対象とするn-gramを以下のようにして決定する。   Step 36) The n-gram to be processed in the array a is determined as follows.

まず、配列aにおける最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ37の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ37の処理が終了したならば、処理対象のn-gramはないので、ステップ32へ移行する。   First, the first n-gram in the array a is a processing target. When the processing in step 37 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 37 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 32.

ステップ37) 配列bの各成分番号Vの頻度に、処理対象のn-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象n-gram(同一n-gramのものが複数あっても別物とする)に対し、該n-gram自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   Step 37) A value obtained by multiplying the frequency of each component number V in array b by the frequency in array a of n-gram U to be processed is added to the component corresponding to component number V in the row vector corresponding to n-gram U. To do. Here, as the method of addition, the co-occurrence with the component number of the n-gram itself is counted with respect to the processing target n-gram in the processing target range (even if there are multiple items of the same n-gram). There are a self-co-occurrence method and a self-non-co-occurrence method that does not count, and each has the following processing contents.

1) 自己共起方式
・配列bの各成分番号Vの頻度に、処理対象のn-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
A value obtained by multiplying the frequency of each component number V in the array b by the frequency in the array a of the n-gram U to be processed is added to the component corresponding to the component number V of the row vector corresponding to the n-gram U.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象のn-gramUで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、n-gramUの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度に、n-gramUの配列aにおける頻度を乗じた値を、n-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the n-gram U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of n-gramU is reduced by 1 from the frequency in the component number array b ′.
A value obtained by multiplying the frequency of each component number V in the array b ′ by the frequency in the array a of the n-gram U is added to the component corresponding to the component number V of the row vector corresponding to the n-gram U.
• Clear array b '.

自己非共起方式での具体例として、ステップ32で、行列が図23であり、かつ、図2に示したテキストの1範囲を処理対象と決定した場合を考える。ステップ36で図6の配列aにおけるn-gram「パン」を処理対象と決定したときに、ステップ37では、n-gram「パン」の成分番号16,38に対し、図24の配列bの成分番号16,38の頻度からそれぞれ1だけ減じて得られる図25の配列b'の各頻度に、n-gram「パン」の配列aにおける頻度2を乗じて、n-gram「パン」の行ベクトルに加算する。ステップ36で処理対象のn-gramがなくなった時点で、図26の行列が得られる。   As a specific example of the self-non-co-occurrence method, consider a case where the matrix is FIG. 23 and one range of the text shown in FIG. When the n-gram “pan” in the array a in FIG. 6 is determined to be processed in step 36, the component in the array b in FIG. 24 is compared with the component numbers 16 and 38 of the n-gram “pan” in step 37. 25. The row vector of n-gram “pan” is obtained by multiplying each frequency of array b ′ in FIG. 25 obtained by subtracting 1 from the frequencies of numbers 16 and 38 by frequency 2 in array a of n-gram “pan”. Add to. When there is no n-gram to be processed in step 36, the matrix of FIG. 26 is obtained.

上記実施例2-1における図4のフローチャートの説明で、処理対象のテキストの範囲におけるn-gramの頻度をカウントしない処理方法を、ステップ33、35、37を以下のようにすることにより実現できる。この処理方法では、行列生成にあたり、処理対象のテキストの範囲において、n-gramの頻度をカウントするプロセスや、n-gram同士の共起頻度をカウントするプロセスを含めないように構成できる。   In the description of the flowchart of FIG. 4 in Example 2-1, a processing method that does not count the frequency of n-grams in the range of text to be processed can be realized by performing steps 33, 35, and 37 as follows. . This processing method can be configured not to include a process of counting the frequency of n-grams and a process of counting the frequency of co-occurrence of n-grams in the range of text to be processed when generating a matrix.

ステップ33) 集合A中のn-gramの配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bを、クリアする。   Step 33) The array a which is an n-gram array in the set A and the array b which is a pair of the component number and its frequency in the set F are cleared.

ステップ35) 処理対象のn-gramで集合Aを検索し、ヒットすれば、該n-gramを配列aに追加する。配列aにおいては、n-gramが、追加される順に格納されており、同一のn-gramが既に配列aにある場合でも追加される。   Step 35) The set A is searched for n-grams to be processed, and if hit, the n-gram is added to the array a. In the array a, n-grams are stored in the order of addition, and are added even when the same n-gram is already in the array a.

処理対象のn-gramで集合Bを検索する。ヒットすれば、以下を行う。該n-gramに対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B by n-gram to be processed. If hit, do the following: The following is performed for each component number associated with the n-gram. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

図2に示したテキストの1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図27の配列aと図24の配列bが得られる。   From the range of the text shown in FIG. 2, the array a in FIG. 27 and the array b in FIG. 24 are obtained when there is no n-gram to be processed in step.

ステップ37) 配列bの各成分番号Vの頻度を、処理対象のn-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象n-gram(同一n-gramのものが複数あっても別物とする)に対し、該n-gram自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   Step 37) The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the n-gram U to be processed. Here, as the method of addition, the co-occurrence with the component number of the n-gram itself is counted with respect to the processing target n-gram in the processing target range (even if there are multiple items of the same n-gram). There are a self-co-occurrence method and a self-non-co-occurrence method that does not count, and each has the following processing contents.

1) 自己共起方式
・配列bの各成分番号Vの頻度を、処理対象のn-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the n-gram U to be processed.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象のn-gramUで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、n-gramUの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度を、n-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the n-gram U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of n-gramU is reduced by 1 from the frequency in the component number array b ′.
The frequency of each component number V in the array b ′ is added to the component corresponding to the component number V in the row vector corresponding to n-gramU.
• Clear array b '.

上記実施例2-1における図4のフローチャートの説明では、処理対象のテキストの範囲におけるn-gramで同一のものが複数あるとき、それぞれを別物として処理している。処理対象のテキストの範囲におけるn-gramで同一のものが複数あっても、1個として扱う処理方法も考えられる。この処理方法の場合、ステップ33、35、37が以下のようになる。   In the description of the flowchart of FIG. 4 in Example 2-1 above, when there are a plurality of identical n-grams in the range of the text to be processed, each is processed as a different item. Even if there are multiple n-grams in the range of text to be processed, there can be a processing method that handles them as one. In the case of this processing method, steps 33, 35 and 37 are as follows.

ステップ33) 集合A中のn-gramの配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bと、集合B中のn-gramの配列である配列gを、クリアする。   Step 33) An array a which is an n-gram array in set A, an array b which is an array of component numbers and their frequencies in set F, and an array g which is an n-gram array in set B Is cleared.

ステップ35) 処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramを追加する。   Step 35) Search the set A with the n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram is added to the array a.

処理対象のn-gramで集合Bを検索する。ヒットすれば、以下を行う。該n-gramで配列gを検索する。ヒットしなければ、以下を行う。配列gに該n-gramを追加する。該n-gramに対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B by n-gram to be processed. If hit, do the following: The array g is searched with the n-gram. If not, do the following: The n-gram is added to the array g. The following is performed for each component number associated with the n-gram. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

図2に示したテキストの1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図28の配列aと図29の配列gと図30の配列bが得られる。   From the range of the text shown in FIG. 2, the array a in FIG. 28, the array g in FIG. 29, and the array b in FIG. 30 are obtained when there is no n-gram to be processed in step.

ステップ37) 配列bの各成分番号Vの頻度を、処理対象のn-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象n-gramに対し、該n-gram自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   Step 37) The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the n-gram U to be processed. Here, as a method of addition, there are a self-co-occurrence method for counting the co-occurrence with the component number of the n-gram itself for the processing target n-gram in the processing target range, and a self-non-co-occurrence method not counting, The processing contents are as follows.

1) 自己共起方式
・配列bの各成分番号Vの頻度を、処理対象のn-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the n-gram U to be processed.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象のn-gramUで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、n-gramUの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度を、n-gramUに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the n-gram U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of n-gramU is reduced by 1 from the frequency in the component number array b ′.
The frequency of each component number V in the array b ′ is added to the component corresponding to the component number V in the row vector corresponding to n-gramU.
• Clear array b '.

自己非共起方式での例として、ステップ32で、行列が図23であり、かつ、図2に示したテキストの1範囲を処理対象と決定した場合を考える。ステップ36で図28の配列aにおけるn-gram「パン」を処理対象と決定したときに、ステップ37では、n-gram「パン」の成分番号16,38に対し、図30の配列bの成分番号16,38の頻度からそれぞれ1だけ減じて得られる図31の配列b'の各頻度を、n-gram「パン」の行ベクトルに加算する。ステップ36で処理対象のn-gramがなくなった時点で、図32の行列が得られる。   As an example of the self-non-co-occurrence method, consider a case where the matrix is FIG. 23 and one range of text shown in FIG. When the n-gram “pan” in the array a in FIG. 28 is determined to be processed in step 36, the component in the array b in FIG. 30 is compared with the component numbers 16 and 38 in the n-gram “pan” in step 37. Each frequency of array b ′ in FIG. 31 obtained by subtracting 1 from the frequencies of numbers 16 and 38 is added to the row vector of n-gram “pan”. When there is no n-gram to be processed in step 36, the matrix of FIG. 32 is obtained.

<実施例2-2>
次に、実施例2-2について説明する。まず、文字列集合抽出部11は、単語辞書を参照して、入力テキスト(15)を形態素解析する。単語辞書は、文字列ベクトル生成装置200の記憶手段に格納されていてもよいし、外部装置に格納され、通信ネットワークを介してアクセスするものであってもよい。
<Example 2-2>
Next, Example 2-2 will be described. First, the character string set extraction unit 11 performs morphological analysis on the input text (15) with reference to the word dictionary. The word dictionary may be stored in the storage unit of the character string vector generation device 200, or may be stored in an external device and accessed via a communication network.

形態素解析結果から、単語の異なりの集合と、1以上の整数の定数nに対し、n-gramの異なりの集合をとる。処理内容は、実施例1-2の文字列集合抽出部11の処理内容と同一である。   From the morphological analysis results, different sets of n-grams are taken for different sets of words and an integer constant n of 1 or more. The processing content is the same as the processing content of the character string set extraction unit 11 of the embodiment 1-2.

以下、n=1とした場合の具体例を説明する。   Hereinafter, a specific example when n = 1 is described.

図13の形態素解析結果から、文字列集合抽出部11の処理で得られる図14の文字列配列を文字列集合Aとし、図15の単語配列を文字列集合Bとする。   The character string array of FIG. 14 obtained by the processing of the character string set extraction unit 11 from the morphological analysis result of FIG. 13 is referred to as a character string set A, and the word array of FIG.

成分番号付与部22は、集合B中の各単語に対し、L個の成分番号からなる成分番号集合(集合Fと呼ぶ)中のいくつかの成分番号を対応付ける。処理内容は、実施例2-1の成分番号付与部22の処理内容と同一である。   The component number assigning unit 22 associates each word in the set B with several component numbers in a component number set (referred to as set F) composed of L component numbers. The processing content is the same as the processing content of the component number assigning unit 22 of Example 2-1.

図33は、図15の文字列集合Bを入力とし、K=2としたときの成分番号付与部22の処理で得られた成分番号付文字列集合Bである。各文字列には、その文字列にユニークな、2個の要素からなる成分番号集合が対応付けられており、該成分番号集合は第2項目として、各成分番号がコロン区切りとなっている。   FIG. 33 is a component number-attached character string set B obtained by processing of the component number assigning unit 22 when the character string set B of FIG. 15 is input and K = 2. Each character string is associated with a component number set consisting of two elements that is unique to the character string. The component number set is a second item, and each component number is separated by a colon.

実施例2-2における以後の第2行列生成部23の処理の説明において集合Bとは、この成分番号付文字列集合Bを意味するものとする。   In the following description of the processing of the second matrix generation unit 23 in Example 2-2, the set B means the character string set B with component numbers.

図4に、第2行列生成部23が実行する処理のフローチャートを示す。以下、実施例2-2における各ステップの処理について説明する。   FIG. 4 shows a flowchart of processing executed by the second matrix generation unit 23. Hereinafter, the process of each step in Example 2-2 will be described.

ステップ31) 図34に示すような、各行が集合A中の文字列(単語またはn-gram)に対応し、各列が集合F中の成分番号に対応しているような行列を生成し、メモリ等の記憶手段に格納する。行列中の各要素は、対応する集合A中の文字列と集合F中の成分番号との共起頻度を表し、本ステップでは初期値として0をセットする。   Step 31) Generate a matrix in which each row corresponds to a character string (word or n-gram) in set A and each column corresponds to a component number in set F, as shown in FIG. Store in storage means such as memory. Each element in the matrix represents the co-occurrence frequency of the corresponding character string in the set A and the component number in the set F. In this step, 0 is set as an initial value.

ステップ32) 制御1として、集合A中の文字列と集合F中の成分番号とが共起する頻度を算出する処理の対象となる形態素解析結果中の所定の範囲を決定する。所定の範囲は、1文、1段落や1文書等の、連続する有限個の単語の列である。ここでの決定は、例えば、所定の範囲を示す情報を予め文字列ベクトル生成装置200の記憶手段に格納しておき、当該記憶手段から上記情報を読み出すことにより行うことができる。   Step 32) As a control 1, a predetermined range in the morphological analysis result to be processed is calculated for calculating the frequency with which the character string in the set A and the component number in the set F co-occur. The predetermined range is a string of a finite number of continuous words such as one sentence, one paragraph, and one document. The determination here can be performed, for example, by storing information indicating a predetermined range in the storage unit of the character string vector generation device 200 in advance and reading the information from the storage unit.

所定の範囲を1文とした場合は、まず、形態素解析結果中の最初の文を処理対象とする。処理対象とした文に関するステップ33以降の処理が終了したならば、その次の文を処理対象とする。最後の文に関するステップ33以降の処理が終了したならば、処理対象の文はないので、本フローチャートを終了する。所定の範囲を、他のものとした場合も同様である。   When the predetermined range is one sentence, the first sentence in the morphological analysis result is first processed. When the processing from step 33 regarding the sentence to be processed is completed, the next sentence is set as the processing target. If the processing after step 33 relating to the last sentence is completed, there is no sentence to be processed, and thus this flowchart is ended. The same applies to the case where the predetermined range is other.

ステップ33) 集合A中の文字列とその頻度の対の配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bと、非分割テキストを、クリアする。   Step 33) The array a which is an array of pairs of character strings and their frequencies in the set A, the array b which is an array of pairs of component numbers and their frequencies in the set F, and the undivided text are cleared.

処理対象の形態素解析結果の範囲における単語表記を連結した非分割テキストを生成する。   Non-divided text is generated by concatenating word notations in the range of the morphological analysis result to be processed.

ステップ34) 制御2として、処理対象の形態素解析結果の範囲におけるn-gramの列を以下のように定める。   Step 34) As the control 2, an n-gram sequence in the range of the morphological analysis result to be processed is determined as follows.

該範囲の非分割テキストにおける各文において、該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)からのn-gramを順にとり、該文のn-gram列とする。該範囲の非分割テキストにおける各文のn-gram列を、文の順につなげたものを、該範囲におけるn-gram列とする。   In each sentence in the non-split text in the range, the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter the front of the sentence decreases and the rear of the sentence increases Then, number each letter. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N-grams from (excluded) are taken in order to form an n-gram sequence of the sentence. The n-gram sequence of each sentence in the non-divided text in the range is connected to the sentence in the order of the sentences, and is defined as the n-gram sequence in the range.

上記のように定めた上で、該範囲における、処理対象とするn-gramを以下のようにして決定する。   After determining as described above, an n-gram to be processed in the range is determined as follows.

まず、該範囲におけるn-gram列の最初のn-gramを処理対象とする。処理対象としたn-gramに関するステップ35の処理が終了したならば、その次のn-gramを処理対象とする。最後のn-gramに関するステップ35の処理が終了したならば、処理対象のn-gramはないので、ステップ36へ移行する。   First, the first n-gram of the n-gram sequence in the range is set as a processing target. When the processing of step 35 regarding the n-gram to be processed is completed, the next n-gram is set as the processing target. If the process of step 35 regarding the last n-gram is completed, there is no n-gram to be processed, and the process proceeds to step 36.

ステップ35) 配列aにおいては、単語とn-gramとは、文字列として一致しても別物として扱う。   Step 35) In the array a, a word and an n-gram are treated as different characters even if they match as a character string.

処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramとその頻度1の対を追加する。ヒットすれば、配列aにおける該n-gramの頻度を1だけ増やす。   Search set A by n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram and its frequency 1 pair are added to the array a. If there is a hit, the frequency of the n-gram in sequence a is increased by 1.

処理対象のn-gramの先頭文字に対応する、形態素解析結果中の単語表記の文字が、単語表記の先頭文字であり、かつ、該単語表記の必要語フラグが1であれば、該単語表記の終止形を処理対象として以下を行う。   If the word notation character in the morphological analysis result corresponding to the first character of the n-gram to be processed is the first character of the word notation and the required word flag of the word notation is 1, the word notation The following processing is performed on the final form of processing.

処理対象の終止形で集合Aを検索する。ヒットすれば、以下を行う。該終止形で配列aを検索する。ヒットしなければ、配列aに該終止形とその頻度1の対を追加する。ヒットすれば、配列aにおける該終止形の頻度を1だけ増やす。   Search set A with the final form to be processed. If hit, do the following: The sequence a is searched with the end form. If there is no hit, add the terminal form and its frequency 1 pair to sequence a. If there is a hit, the frequency of the terminal form in sequence a is increased by one.

処理対象の終止形で集合Bを検索する。ヒットすれば、以下を行う。該終止形に対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B with the final form to be processed. If hit, do the following: The following is performed for each component number associated with the final shape. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

図13に示した形態素解析結果の1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図17の配列aと図35の配列bが得られる。   From one range of the morphological analysis results shown in FIG. 13, the array a in FIG. 17 and the array b in FIG. 35 are obtained when there is no n-gram to be processed in step.

ステップ34、35では、処理対象の範囲におけるn-gramと単語と成分番号の頻度を同時に求めているが、ステップ34、35では、該範囲の非分割テキストをもとにn-gramの頻度のみを求め、それらのステップとは別に、該範囲の形態素解析結果をもとに単語と成分番号の頻度を求めるステップを設けるという構成にしてもよい。   In steps 34 and 35, the frequency of the n-gram, the word, and the component number in the range to be processed is obtained at the same time, but in steps 34 and 35, only the frequency of the n-gram based on the non-divided text in the range is obtained. In addition to these steps, a step of obtaining the frequency of words and component numbers based on the morphological analysis results in the range may be provided.

ステップ36) 配列aにおける、処理対象とする文字列を以下のようにして決定する。   Step 36) The character string to be processed in the array a is determined as follows.

まず、配列aにおける最初の文字列を処理対象とする。処理対象とした文字列に関するステップ37の処理が終了したならば、その次の文字列を処理対象とする。最後の文字列に関するステップ37の処理が終了したならば、処理対象の文字列はないので、ステップ32へ移行する。   First, the first character string in the array a is a processing target. When the processing in step 37 regarding the character string to be processed is completed, the next character string is set as the processing target. When the process of step 37 regarding the last character string is completed, there is no character string to be processed, and the process proceeds to step 32.

ステップ37) 配列aにおけるn-gramは集合Bには存在しないものとする。   Step 37) It is assumed that the n-gram in the array a does not exist in the set B.

配列bの各成分番号Vの頻度に、処理対象の文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象文字列(同一文字列のものが複数あっても別物とする)に対し、該文字列自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   A value obtained by multiplying the frequency of each component number V in the array b by the frequency in the array a of the character string U to be processed is added to the component corresponding to the component number V of the row vector corresponding to the character string U. Here, as a method of addition, self-co-occurrence that counts the co-occurrence with the component number of the character string itself for the process target character string in the process target range (even if there are multiple things of the same character string) There are two types: a method and a self-non-cooccurrence method that does not count.

1) 自己共起方式
・配列bの各成分番号Vの頻度に、処理対象の文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
A value obtained by multiplying the frequency of each component number V in array b by the frequency in array a of character string U to be processed is added to the component corresponding to component number V of the row vector corresponding to character string U.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象の文字列Uで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、文字列Uの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度に、文字列Uの配列aにおける頻度を乗じた値を、文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the character string U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of the character string U is reduced by 1 from the frequency in the component number array b ′.
A value obtained by multiplying the frequency of each component number V in the array b ′ by the frequency in the array a of the character string U is added to the component corresponding to the component number V of the row vector corresponding to the character string U.
• Clear array b '.

自己非共起方式での具体例として、ステップ32で、行列が図34であり、かつ、図13に示した形態素解析結果の1範囲を処理対象と決定した場合を考える。ステップ36で図17の配列aにおける単語「パン」を処理対象と決定したときに、ステップ37では、単語「パン」の成分番号11,91に対し、図35の配列bの成分番号11,91の頻度からそれぞれ1だけ減じて得られる図36の配列b'の各頻度に、単語「パン」の配列aにおける頻度2を乗じて、単語「パン」の行ベクトルに加算する。ステップ36で処理対象の文字列がなくなった時点で、図37の行列が得られる。   As a specific example of the self-non-cooccurrence method, consider a case where the matrix is FIG. 34 and one range of the morphological analysis results shown in FIG. When the word “pan” in the array a in FIG. 17 is determined as a processing target in step 36, the component numbers 11, 91 in the array b in FIG. 35 are compared with the component numbers 11, 91 in the word “pan” in step 37. Each frequency of the array b ′ in FIG. 36 obtained by subtracting 1 from each of the frequencies is multiplied by the frequency 2 in the array “a” of the word “pan” and added to the row vector of the word “pan”. When there is no character string to be processed in step 36, the matrix of FIG. 37 is obtained.

上記実施例2-2における図4のフローチャートの説明で、処理対象の形態素解析結果の範囲における文字列の頻度をカウントしない処理方法を、ステップ33、35、37を以下のようにすることにより実現できる。この処理方法では、行列生成にあたり、処理対象の形態素解析結果の範囲において、文字列の頻度をカウントするプロセスや、文字列同士の共起頻度をカウントするプロセスを含めないように構成できる。   In the description of the flowchart of FIG. 4 in Example 2-2 above, a processing method that does not count the frequency of character strings in the range of the morpheme analysis result to be processed is realized by performing steps 33, 35, and 37 as follows: it can. This processing method can be configured not to include the process of counting the frequency of character strings and the process of counting the co-occurrence frequency of character strings in the range of the morphological analysis results to be processed when generating a matrix.

ステップ33) 集合A中の文字列の配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bと、非分割テキストを、クリアする。   Step 33) The array a which is an array of character strings in the set A, the array b which is an array of the component number and its frequency in the set F, and the non-divided text are cleared.

処理対象の形態素解析結果の範囲における単語表記を連結した非分割テキストを生成する。   Non-divided text is generated by concatenating word notations in the range of the morphological analysis result to be processed.

ステップ35) 配列aにおいては、単語とn-gramとは、文字列として一致しても別物として扱い、それぞれ別領域に格納する。   Step 35) In the array a, a word and an n-gram are treated as different objects even if they match as a character string, and are stored in different areas.

処理対象のn-gramで集合Aを検索し、ヒットすれば、該n-gramを配列aに追加する。配列aにおいては、n-gramが、追加される順に格納されており、同一のn-gramが既に配列aにある場合でも追加される。   If the set A is searched for n-grams to be processed and hit, the n-gram is added to the array a. In the array a, n-grams are stored in the order of addition, and are added even when the same n-gram is already in the array a.

処理対象のn-gramの先頭文字に対応する、形態素解析結果中の単語表記の文字が、単語表記の先頭文字であり、かつ、該単語表記の必要語フラグが1であれば、該単語表記の終止形を処理対象として以下を行う。   If the word notation character in the morphological analysis result corresponding to the first character of the n-gram to be processed is the first character of the word notation and the required word flag of the word notation is 1, the word notation The following processing is performed on the final form of processing.

処理対象の終止形で集合Aを検索し、ヒットすれば、該終止形を配列aに追加する。配列aにおいては、終止形が、追加される順に格納されており、同一の終止形が既に配列aにある場合でも追加される。   If the set A is searched for the termination form to be processed and hit, the termination form is added to the array a. In array a, the terminal forms are stored in the order of addition, and are added even if the same terminal form is already in array a.

処理対象の終止形で集合Bを検索する。ヒットすれば、以下を行う。該終止形に対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B with the final form to be processed. If hit, do the following: The following is performed for each component number associated with the final shape. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

図13に示した形態素解析結果の1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図38の配列aと図35の配列bが得られる。   From one range of the morphological analysis results shown in FIG. 13, the array a in FIG. 38 and the array b in FIG. 35 are obtained when there is no n-gram to be processed in step.

ステップ37) 配列aにおけるn-gramは集合Bには存在しないものとする。   Step 37) It is assumed that the n-gram in the array a does not exist in the set B.

配列bの各成分番号Vの頻度を、処理対象の文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象文字列(同一文字列のものが複数あっても別物とする)に対し、該文字列自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the character string U to be processed. Here, as a method of addition, self-co-occurrence that counts the co-occurrence with the component number of the character string itself for the process target character string in the process target range (even if there are multiple things of the same character string) There are two types: a method and a self-non-cooccurrence method that does not count.

1) 自己共起方式
・配列bの各成分番号Vの頻度を、処理対象の文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the character string U to be processed.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象の文字列Uで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、文字列Uの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度を、文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the character string U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of the character string U is reduced by 1 from the frequency in the component number array b ′.
The frequency of each component number V in the array b ′ is added to the component corresponding to the component number V in the row vector corresponding to the character string U.
• Clear array b '.

上記実施例2-2における図4のフローチャートの説明では、処理対象の形態素解析結果の範囲において、単語で同一のものが複数あるときや、n-gramで同一のものが複数あるとき、それぞれを別物として処理している。処理対象の形態素解析結果の範囲において、単語で同一のものが複数あるときや、n-gramで同一のものが複数あるときでも、それらを1個として扱う処理方法も考えられる。この処理方法の場合、ステップ33、35、37が以下のようになる。   In the description of the flowchart of FIG. 4 in the above Example 2-2, when there are a plurality of identical words or n-grams in the range of the morphological analysis results to be processed, Treated as a separate item. In the range of morpheme analysis results to be processed, even when there are a plurality of identical words or when there are a plurality of identical n-grams, a processing method that treats them as one can be considered. In the case of this processing method, steps 33, 35 and 37 are as follows.

ステップ33) 集合A中の文字列の配列である配列aと、集合F中の成分番号とその頻度の対の配列である配列bと、集合B中の単語の配列である配列gと、非分割テキストを、クリアする。   Step 33) An array a that is an array of character strings in set A, an array b that is an array of component numbers and their frequencies in set F, an array g that is an array of words in set B, and a non- Clear the split text.

処理対象の形態素解析結果の範囲における単語表記を連結した非分割テキストを生成する。   Non-divided text is generated by concatenating word notations in the range of the morphological analysis result to be processed.

ステップ35) 配列aにおいては、単語とn-gramとは、文字列として一致しても別物として扱う。   Step 35) In the array a, a word and an n-gram are treated as different characters even if they match as a character string.

処理対象のn-gramで集合Aを検索する。ヒットすれば、以下を行う。該n-gramで配列aを検索する。ヒットしなければ、配列aに該n-gramを追加する。   Search set A by n-gram to be processed. If hit, do the following: The array a is searched with the n-gram. If there is no hit, the n-gram is added to the array a.

処理対象のn-gramの先頭文字に対応する、形態素解析結果中の単語表記の文字が、単語表記の先頭文字であり、かつ、該単語表記の必要語フラグが1であれば、該単語表記の終止形を処理対象として以下を行う。   If the word notation character in the morphological analysis result corresponding to the first character of the n-gram to be processed is the first character of the word notation and the required word flag of the word notation is 1, the word notation The following processing is performed on the final form of processing.

処理対象の終止形で集合Aを検索する。ヒットすれば、以下を行う。該終止形で配列aを検索する。ヒットしなければ、配列aに該終止形を追加する。   Search set A with the final form to be processed. If hit, do the following: The sequence a is searched with the end form. If there is no hit, the end form is added to sequence a.

処理対象の終止形で集合Bを検索する。ヒットすれば、以下を行う。該終止形で配列gを検索する。ヒットしなければ、以下を行う。配列gに該終止形を追加する。該終止形に対応付けられた各成分番号に対し以下を行う。該成分番号で配列bを検索する。ヒットしなければ、配列bに該成分番号とその頻度1の対を追加する。ヒットすれば、配列bにおける該成分番号の頻度を1だけ増やす。   Search set B with the final form to be processed. If hit, do the following: The sequence g is searched with the end form. If not, do the following: Add the end form to array g. The following is performed for each component number associated with the final shape. Search the sequence b by the component number. If there is no hit, the pair of the component number and its frequency 1 is added to the sequence b. If there is a hit, the frequency of the component number in sequence b is increased by 1.

図13に示した形態素解析結果の1範囲からは、ステップ34で処理対象のn-gramがなくなった時点で、図39の配列aと図40の配列gと図41の配列bが得られる。   From the range of the morphological analysis results shown in FIG. 13, when there is no n-gram to be processed in step 34, the array a in FIG. 39, the array g in FIG. 40, and the array b in FIG. 41 are obtained.

ステップ37) 配列aにおけるn-gramは集合Bには存在しないものとする。   Step 37) It is assumed that the n-gram in the array a does not exist in the set B.

配列bの各成分番号Vの頻度を、処理対象の文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。ここで加算の仕方として、処理対象範囲における処理対象文字列に対し、該文字列自身の成分番号との共起をカウントする自己共起方式と、カウントしない自己非共起方式があり、それぞれ以下の処理内容となる。   The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the character string U to be processed. Here, as a method of addition, there are a self-co-occurrence method for counting the co-occurrence with the component number of the character string itself and a self-non-co-occurrence method not counting for the character string to be processed in the processing target range. It becomes processing contents.

1) 自己共起方式
・配列bの各成分番号Vの頻度を、処理対象の文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
1) Self-co-occurrence method
The frequency of each component number V in the array b is added to the component corresponding to the component number V in the row vector corresponding to the character string U to be processed.

2) 自己非共起方式
・配列bのコピーとして配列b'を生成する。
・処理対象の文字列Uで集合Bを検索し、対応する成分番号集合を取得する。
・該成分番号集合が空でなければ、文字列Uの各成分番号に対し、該成分番号の配列b'における頻度から1だけ減じる。
・配列b'の各成分番号Vの頻度を、文字列Uに対応する行ベクトルの、成分番号Vに対応する成分に加算する。
・配列b'をクリアする。
2) Self-non-co-occurrence method
Generate array b ′ as a copy of array b.
Search the set B with the character string U to be processed and obtain the corresponding component number set.
If the component number set is not empty, each component number of the character string U is reduced by 1 from the frequency in the component number array b ′.
The frequency of each component number V in the array b ′ is added to the component corresponding to the component number V in the row vector corresponding to the character string U.
• Clear array b '.

自己非共起方式での例として、ステップ32で、行列が図34であり、かつ、図13に示した形態素解析結果の1範囲を処理対象と決定した場合を考える。ステップ36で図39の配列aにおける単語「パン」を処理対象と決定したときに、ステップ37では、単語「パン」の成分番号11,91に対し、図41の配列bの成分番号11,91の頻度からそれぞれ1だけ減じて得られる図42の配列b'の各頻度を、単語「パン」の行ベクトルに加算する。ステップ36で処理対象の文字列がなくなった時点で、図43の行列が得られる。   As an example of the self-non-co-occurrence method, consider the case where the matrix is FIG. 34 and one range of the morphological analysis results shown in FIG. When the word “pan” in the array “a” in FIG. 39 is determined to be processed in step 36, the component numbers 11, 91 in the array “b” in FIG. Each frequency of the array b ′ shown in FIG. 42 obtained by subtracting 1 from each frequency is added to the row vector of the word “pan”. When there is no character string to be processed in step 36, the matrix of FIG. 43 is obtained.

<実施例3>
実施例3は、文字列ベクトル生成装置100、200において、特異値分解部13を備える実施例である。実施例1の文字列ベクトル生成装置100に特異値分解部13を備えた文字列ベクトル生成装置301の構成を図44に示す。また、実施例2の文字列ベクトル生成装置200に特異値分解部13を備えた文字列ベクトル生成装置302の構成を図45に示す。
<Example 3>
The third embodiment is an embodiment in which the singular value decomposition unit 13 is provided in the character string vector generation devices 100 and 200. FIG. 44 shows a configuration of a character string vector generation device 301 provided with the singular value decomposition unit 13 in the character string vector generation device 100 of the first embodiment. FIG. 45 shows a configuration of a character string vector generation device 302 provided with the singular value decomposition unit 13 in the character string vector generation device 200 of the second embodiment.

特異値分解部13は、文字列ベクトル格納部103から文字列ベクトルデータベース1(18)を読み出して入力とし、該文字列ベクトルデータベースの行列に対し特異値分解を行うことにより、該行列を、列数をより少なくした行列に変換し、集合A中の文字列と、該文字列に対応する、変換後の行列の行ベクトルとの対の集合である文字列ベクトルデータベース2(19)を出力し、文字列ベクトル格納部103に格納する。   The singular value decomposition unit 13 reads the character string vector database 1 (18) from the character string vector storage unit 103 and uses it as an input, and performs singular value decomposition on the matrix of the character string vector database, thereby converting the matrix into a column Convert to a matrix with fewer numbers, and output the character vector database 2 (19), which is a set of pairs of character strings in set A and row vectors of the converted matrix corresponding to the character strings. And stored in the character string vector storage unit 103.

<実施例3-1>
文字列ベクトルデータベース1(18)において、行に対応する文字列がn-gramである場合について実施例3-1として説明する。実施例3-1は、例えば、文字列ベクトルデータベース1(18)が、実施例1-1の図9か、または、実施例2-1の図26か図32である場合に対応する。
<Example 3-1>
In the character string vector database 1 (18), a case where a character string corresponding to a row is an n-gram will be described as Example 3-1. Example 3-1 corresponds to the case where the character string vector database 1 (18) is, for example, FIG. 9 of Example 1-1, or FIG. 26 or FIG. 32 of Example 2-1.

ここでは、文字列ベクトルデータベース1(18)の行列の次元数をJとしたとき、J≧H≧1となる定数Hをとる。該行列を、特異値分解により、列数がHの行列に変換することにより、図46のような文字列ベクトルデータベース2(19)が得られる。   Here, when the number of dimensions of the matrix in the character string vector database 1 (18) is J, a constant H satisfying J ≧ H ≧ 1 is taken. A character string vector database 2 (19) as shown in FIG. 46 is obtained by converting the matrix into a matrix having H columns by singular value decomposition.

<実施例3-2>
文字列ベクトルデータベース1(18)において、行に対応する文字列が単語及びn-gramである場合について実施例3-2として説明する。実施例3-2は、例えば、文字列ベクトルデータベース1(18)が、実施例1-2の図20か、または、実施例2-2の図37か図43である場合に対応する。
ここでは、文字列ベクトルデータベース1(18)の行列の次元数をJとしたとき、J≧H≧1となる定数Hをとる。該行列を、特異値分解により、列数がHの行列に変換することにより、図47のような文字列ベクトルデータベース2(19)が得られる。
<Example 3-2>
In the character string vector database 1 (18), the case where the character strings corresponding to the rows are words and n-grams will be described as Example 3-2. Example 3-2 corresponds to, for example, the case where the character string vector database 1 (18) is that of FIG. 20 of Example 1-2, or FIG. 37 or 43 of Example 2-2.
Here, when the number of dimensions of the matrix in the character string vector database 1 (18) is J, a constant H satisfying J ≧ H ≧ 1 is taken. A character string vector database 2 (19) as shown in FIG. 47 is obtained by converting the matrix into a matrix having the number of columns H by singular value decomposition.

このように、次元数が縮退した文字列ベクトルを生成することにより、文字列ベクトル間の類似性の精度が向上する。   Thus, by generating a character string vector with a reduced number of dimensions, the accuracy of similarity between character string vectors is improved.

<実施例4>
実施例4は、文字列ベクトル生成装置100、200、301、302において、文書ベクトル生成部14を備える実施例である。図44の文字列ベクトル生成装置301に文書ベクトル生成部14を備えた文字列ベクトル生成装置401の構成を図48に示す。また、図45の文字列ベクトル生成装置302に文書ベクトル生成部14を備えた文字列ベクトル生成装置402の構成を図49に示す。図48、図49に示すように、本実施例では、文書及び文書ベクトルを格納する文書情報格納部104も備えられている。
<Example 4>
In the fourth embodiment, the document vector generation unit 14 is provided in the character string vector generation devices 100, 200, 301, and 302. FIG. 48 shows a configuration of a character string vector generation device 401 provided with the document vector generation unit 14 in the character string vector generation device 301 of FIG. FIG. 49 shows a configuration of a character string vector generation device 402 provided with the document vector generation unit 14 in the character string vector generation device 302 of FIG. As shown in FIGS. 48 and 49, in this embodiment, a document information storage unit 104 for storing documents and document vectors is also provided.

なお、図48、図49に示す例では、それぞれ特異値分解部13を備えているが、特異値分解部13を備えることは必須ではなく、特異値分解部13を備えないこととしてもよい。すなわち、文書ベクトル生成部14は、特異値分解部13が出力した文字列ベクトルデータベース2(19)を入力とする代わりに、第1行列生成部12または第2行列生成部23が出力した文字列ベクトルデータベース1(18)を入力としてもよい。   48 and 49, the singular value decomposition unit 13 is provided. However, the singular value decomposition unit 13 is not essential, and the singular value decomposition unit 13 may not be provided. That is, the document vector generation unit 14 uses the character string output from the first matrix generation unit 12 or the second matrix generation unit 23 instead of the character string vector database 2 (19) output from the singular value decomposition unit 13 as an input. The vector database 1 (18) may be input.

実施例4では、文字列ベクトルデータベース1(18)と文字列ベクトルデータベース2(19)を総称して文字列ベクトルデータベースと呼ぶことにする。   In the fourth embodiment, the character string vector database 1 (18) and the character string vector database 2 (19) are collectively referred to as a character string vector database.

文書ベクトル生成部14は、文書情報格納部104から読み出され、入力された文書(20)に対し、該文書中の各文字列で、文字列ベクトルデータベースの行列の行に対応する文字列の集合を検索し、検索された文字列に対応する行ベクトルを求め、該行ベクトルの和または重心を、該文書のベクトルとして出力し、文書情報格納部104に格納する。   The document vector generation unit 14 reads from the document information storage unit 104 and inputs the character string corresponding to the row of the matrix of the character string vector database for each character string in the document (20). The set is searched, a row vector corresponding to the searched character string is obtained, the sum or centroid of the row vector is output as the vector of the document, and stored in the document information storage unit 104.

以下、実施例4の具体例として、行に対応する文字列がn-gramの文字列ベクトルデータベースをとる実施例4-1と、行に対応する文字列が単語及びn-gramの文字列ベクトルデータベースをとる実施例4-2を説明する。   Hereinafter, as a specific example of Example 4, Example 4-1, in which a character string corresponding to a row is an n-gram character string vector database, and a character string vector corresponding to a row is a word and an n-gram character string vector A description will be given of Example 4-2 taking a database.

<実施例4-1>
本実施例では、文字列ベクトルデータベースとして、実施例1-1の図9か、または、実施例2-1の図26か図32、または、実施例3-1の図46のような、行に対応する文字列がn-gramの文字列ベクトルデータベースをとる。このとき、入力文書の文書ベクトルを以下のようにして求める。
<Example 4-1>
In this embodiment, as the character string vector database, as shown in FIG. 9 of Embodiment 1-1, FIG. 26 or FIG. 32 of Embodiment 2-1, or FIG. 46 of Embodiment 3-1. A character string vector database whose character string corresponding to is n-gram is taken. At this time, the document vector of the input document is obtained as follows.

入力文書におけるn-gramの列を以下のように定める。   The n-gram sequence in the input document is defined as follows.

入力文書における各文において、該文の先頭文字を1文字目とし、先頭文字の直前の位置を0文字目として、以降、文の前方は減少し、文の後方は増加するように、各文字に番号を振っていく。該文の文字数をsとしたとき、(2-n)文字目からs文字目までの各位置(但しn≧s+3のときは、(s-n+3)文字目から0文字目を除く)からのn-gramを順にとり、該文のn-gram列とする。入力文書における各文のn-gram列を、文の順につなげたものを、入力文書におけるn-gram列とする。ここでn-gram列において、同一のn-gramが複数あるとき、それらを1つだけにしてもよい。   In each sentence in the input document, the first character of the sentence is the first character, the position immediately before the first character is the 0th character, and thereafter, each character so that the front of the sentence decreases and the rear of the sentence increases. Number. When the number of characters in the sentence is s, each position from the (2-n) th character to the sth character (however, if n ≧ s + 3, the (s-n + 3) th character to the 0th character N-grams from (excluded) are taken in order to form an n-gram sequence of the sentence. The n-gram sequence of each sentence in the input document connected in the order of the sentences is defined as the n-gram sequence in the input document. Here, when there are a plurality of identical n-grams in the n-gram sequence, only one of them may be used.

n-gram列における各n-gramで文字列ベクトルデータベースを検索し、対応する文字列ベクトルを取得する。検索がヒットしたn-gramの列をp1, p2,・・・,ptとし、各pr(1≦r≦t)の文字列ベクトルをv(pr)とする。   A character string vector database is searched for each n-gram in the n-gram sequence, and a corresponding character string vector is obtained. The n-gram columns that are hit by the search are p1, p2,..., Pt, and the character string vector of each pr (1 ≦ r ≦ t) is v (pr).

Figure 0005513985
または、
v(pr)(1≦r≦t)の重心である
Figure 0005513985
Or
It is the center of gravity of v (pr) (1 ≦ r ≦ t)

Figure 0005513985
または、
Figure 0005513985
Or

Figure 0005513985
を長さ1に正規化したベクトル、のうちのいずれかを算出し、入力文書の文書ベクトルとて出力する。どの方法で文書ベクトルを算出するかは予め設定しておくことができる。
Figure 0005513985
One of the vectors normalized to length 1 is calculated and output as the document vector of the input document. Which method is used to calculate the document vector can be set in advance.

文字列ベクトルデータベースとして、図9、図26、図32、図46のような、行に対応する文字列が2-gramの文字列ベクトルデータベースをとった場合、図50の入力文書から、図51の2-gram列を抽出し、図51の各2-gramで文字列ベクトルデータベースを検索して、対応する文字列ベクトルを取得し、それらのベクトル群に上記の式を適用することにより、入力文書の文書ベクトルを生成する。   As the character string vector database, when the character string vector database corresponding to the line is 2-gram as shown in FIGS. 9, 26, 32, and 46, the input document of FIG. The two-gram columns are extracted, the character string vector database is searched with each 2-gram of FIG. 51, the corresponding character string vectors are obtained, and the above formula is applied to these vector groups to input Generate a document vector for the document.

<実施例4-2>
本実施例では、文字列ベクトルデータベースとして、実施例1-2の図20か、または、実施例2-2の図37か図43、または、実施例3-2の図47のような、行に対応する文字列が単語及びn-gramの文字列ベクトルデータベースをとる。このとき、入力文書の文書ベクトルを以下のようにして求める。
<Example 4-2>
In this embodiment, as the character string vector database, as shown in FIG. 20 of Embodiment 1-2, FIG. 37 or FIG. 43 of Embodiment 2-2, or FIG. 47 of Embodiment 3-2. A character string vector database of word and n-gram character strings corresponding to is taken. At this time, the document vector of the input document is obtained as follows.

入力文書を形態素解析し、形態素解析結果中の終止形で、必要語フラグが1となっているものの列を、入力文書における単語列とする。ここで単語列において、同一の単語が複数あるとき、それらを1つだけにしてもよい。   The input document is subjected to morpheme analysis, and the end form in the morpheme analysis result with the necessary word flag set to 1 is set as a word string in the input document. Here, when there are a plurality of identical words in the word string, only one of them may be used.

単語列における各単語で文字列ベクトルデータベースを検索し、対応する文字列ベクトルを取得する。検索がヒットした単語の列をp1, p2,・・・,ptとし、各pr(1≦r≦t)の文字列ベクトルをv(pr)とする。   The character string vector database is searched for each word in the word string, and the corresponding character string vector is obtained. A string of words hit by the search is set as p1, p2,..., Pt, and a character string vector of each pr (1 ≦ r ≦ t) is set as v (pr).

Figure 0005513985
または、
v(pr)(1≦r≦t)の重心である
Figure 0005513985
Or
It is the center of gravity of v (pr) (1 ≦ r ≦ t)

Figure 0005513985
または、
Figure 0005513985
Or

Figure 0005513985
を長さ1に正規化したベクトル、のうちのいずれかを算出し、入力文書の文書ベクトルとて出力する。
Figure 0005513985
One of the vectors normalized to length 1 is calculated and output as the document vector of the input document.

単語列における単語で、文字列ベクトルデータベースを検索してもヒットしなかったものに対しては、該単語を入力文書として、実施例4-1の処理を行うことにより該単語の文字列ベクトルを生成してもよい。すなわち、該単語におけるn-gram列を抽出し、該n-gram列の各n-gramで文字列ベクトルデータベースを検索し、得られた文字列ベクトルを合成することにより該単語の文字列ベクトルを生成する。   For words in the word string that did not hit even after searching the character string vector database, the character string vector of the word is obtained by performing the processing of Example 4-1 using the word as an input document. It may be generated. That is, an n-gram string in the word is extracted, a character string vector database is searched for each n-gram in the n-gram string, and the character string vector of the word is obtained by synthesizing the obtained character string vectors. Generate.

このように、検索してもヒットしなかった単語と生成したその文字列ベクトルを、上記の単語列、文字列ベクトル列に加えて、入力文書ベクトルを生成してもよい。   As described above, the input document vector may be generated by adding the word that has not been hit by the search and the generated character string vector to the word string and the character string vector string.

文字列ベクトルデータベースとして、図20、図37、図43、図47のような、行に対応する文字列が単語及び1-gramの文字列ベクトルデータベースをとった場合、図52の入力文書を形態素解析して図53の形態素解析結果を取得し、図53の形態素解析結果から図54の単語列を抽出し、図54の各単語で文字列ベクトルデータベースを検索する。   When the character string vector database is a character string vector database in which the character string corresponding to the line is a word and 1-gram as shown in FIG. 20, FIG. 37, FIG. 43, and FIG. 47, the input document of FIG. 53, the morpheme analysis result of FIG. 53 is acquired, the word string of FIG. 54 is extracted from the morpheme analysis result of FIG. 53, and the character string vector database is searched for each word of FIG.

単語「紅茶」,「飲む」はヒットするので、対応する文字列ベクトルを取得する。   Since the words “tea” and “drink” are hit, the corresponding character string vector is acquired.

単語「シカゴ」はヒットしないので、該単語を入力文書として、図55の1-gram列を抽出し、図55の各1-gramで文字列ベクトルデータベースを検索し、得られた文字列ベクトルを合成することにより単語「シカゴ」の文字列ベクトルを生成する。   Since the word “Chicago” does not hit, the 1-gram column in FIG. 55 is extracted using the word as an input document, the character string vector database is searched with each 1-gram in FIG. 55, and the obtained character string vector is obtained. A character string vector of the word “Chicago” is generated by combining.

図54の各単語の文字列ベクトルを合成することにより、入力文書の文書ベクトルを生成する。   A document vector of the input document is generated by synthesizing the character string vectors of the respective words in FIG.

これまでに説明した各文字列ベクトル生成装置は、例えば、CPUやメモリ、ハードディスク等を備えた一般的なコンピュータに、各実施例で説明した処理手段に対応するプログラムを実行させることにより実現可能である。当該プログラムは、可搬メモリ等のコンピュータ読み取り可能な記録媒体に記録して配布してもよいし、ネットワーク上のサーバからダウンロードすることもできる。このように、文字列ベクトル生成装置をコンピュータで実現する場合、テキストや文字列等の処理データは、メモリ等に記憶され、プログラムの命令に従って、適宜、CPUにより読み出されて処理されることになる。   Each character string vector generation device described so far can be realized, for example, by causing a general computer including a CPU, a memory, a hard disk, and the like to execute a program corresponding to the processing means described in each embodiment. is there. The program may be distributed by being recorded on a computer-readable recording medium such as a portable memory, or may be downloaded from a server on the network. As described above, when the character string vector generation device is realized by a computer, processing data such as text and character strings is stored in a memory or the like, and is appropriately read and processed by a CPU according to a program instruction. Become.

また、これまでに説明した各文字列ベクトル生成装置は、1つのコンピュータで実現してもよいし、複数のコンピュータを、ネットワークを介して接続することにより実現してもよい。例えば、101〜104で示される格納部のうちの1つ又は複数を外部のサーバ装置として構成することは、文字列ベクトル生成装置を複数のコンピュータで実現する場合の一例である。   In addition, each character string vector generation device described so far may be realized by one computer or may be realized by connecting a plurality of computers via a network. For example, configuring one or more of the storage units 101 to 104 as an external server device is an example of a case where the character string vector generation device is realized by a plurality of computers.

本発明は、文字列の意味表現である文字列ベクトルを生成する技術に適用可能である。   The present invention can be applied to a technique for generating a character string vector that is a semantic representation of a character string.

本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。   The present invention is not limited to the above-described embodiments, and various modifications and applications are possible within the scope of the claims.

100、200、301、302、401、402 文字列ベクトル生成装置
11 文字列集合抽出部
12 第1行列生成部
13 特異値分解部
22 成分番号付与部
23 第2行列生成部
101 テキスト格納部
102 文字列集合格納部
103 文字列ベクトル格納部
104 文書情報格納部
14 文書ベクトル生成部
100, 200, 301, 302, 401, 402 Character string vector generator
11 String set extractor
12 First matrix generator
13 Singular value decomposition
22 Ingredient number assignment unit
23 Second matrix generator
101 Text storage
102 String set storage
103 String vector storage
104 Document information storage
14 Document vector generator

Claims (10)

文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置であって、
入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出手段と、
各行を前記集合A中の文字列に対応させ、各列を前記集合B中の文字列に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列Dとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記文字列Dに対応する前記行列中の要素とした行列を生成し、出力する第1行列生成手段と
を備えることを特徴とする文字列ベクトル生成装置。
A character string vector generation device for generating a character string vector as a matrix row vector,
Character string set extraction means for extracting different sets A and B of character strings, which are strings of a finite number of consecutive characters from each character position of the sentence in the text, from the input text;
A predetermined range that is a sequence of a finite number of consecutive words in the text by generating a matrix in which each row corresponds to a character string in the set A and each column corresponds to a character string in the set B The value obtained by adding the frequency of the co-occurrence of the character string C in the set A and the character string D in the set B over all the predetermined ranges in the text is present in the character string C. And a first matrix generation means for generating and outputting a matrix as an element in the matrix corresponding to the character string D, and a character string vector generation device.
文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置であって、
入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出手段と、
前記集合B中の各文字列に対し、L(Lは1以上の整数)個の成分番号から抽出される成分番号集合の群から、既に付与した成分番号集合の群を除いた集合群から、ランダムに一つの成分番号集合を選び、当該成分番号集合を当該文字列に付与する成分番号付与手段と、
各行を前記集合A中の文字列に対応させ、各列を前記成分番号集合中の成分番号に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列に対応付けられた成分番号Eとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記成分番号Eに対応する前記行列中の要素とした行列を生成し、出力する第2行列生成手段と
を備えることを特徴とする文字列ベクトル生成装置。
A character string vector generation device for generating a character string vector as a matrix row vector,
Character string set extraction means for extracting different sets A and B of character strings, which are strings of a finite number of consecutive characters from each character position of the sentence in the text, from the input text;
For each character string in the set B, from a set group obtained by excluding an already assigned component number set group from a set of component number sets extracted from L (L is an integer of 1 or more) component numbers A component number assigning unit that randomly selects one component number set and assigns the component number set to the character string ;
Each row is associated with a character string in the set A, a matrix is generated in which each column is associated with a component number in the component number set, and a predetermined finite number of words in the text. The frequency that the character string C in the set A and the component number E associated with the character string in the set B coexist in the range is added over all the predetermined ranges in the text A character string vector generation device comprising: a second matrix generation unit that generates and outputs a matrix in which the value obtained is an element in the matrix corresponding to the character string C and the component number E.
前記出力された行列に対し特異値分解を行うことにより、当該行列を、列数をより少なくした行列に変換する特異値分解手段を更に備えることを特徴とする請求項1または2に記載の文字列ベクトル生成装置。   3. The character according to claim 1, further comprising singular value decomposition means for converting the matrix into a matrix having a smaller number of columns by performing singular value decomposition on the output matrix. Column vector generator. 入力された文書に対し、当該文書中の各文字列で、前記出力された行列の行に対応する文字列の集合を検索し、検索された文字列に対応する行ベクトルを求め、当該行ベクトルの和または重心を、前記文書のベクトルとする文書ベクトル生成手段を更に備えたことを特徴とする請求項1ないし3のうちいずれか1項に記載の文字列ベクトル生成装置。   For an input document, a set of character strings corresponding to the row of the output matrix is searched for each character string in the document, and a row vector corresponding to the searched character string is obtained. 4. The character string vector generation device according to claim 1, further comprising: a document vector generation unit that uses the sum or the center of gravity of the document as a vector of the document. 5. 文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置が実行する文字列ベクトル生成方法であって、
入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出ステップと、
各行を前記集合A中の文字列に対応させ、各列を前記集合B中の文字列に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列Dとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記文字列Dに対応する前記行列中の要素とした行列を生成し、出力する第1行列生成ステップと
を備えることを特徴とする文字列ベクトル生成方法。
A character string vector generation method executed by a character string vector generation device that generates a character string vector as a row vector of a matrix,
A character string set extraction step for extracting different sets A and B of character strings, which are strings of a finite number of consecutive characters from each character position of the sentence in the text, from the input text;
A predetermined range that is a sequence of a finite number of consecutive words in the text by generating a matrix in which each row corresponds to a character string in the set A and each column corresponds to a character string in the set B The value obtained by adding the frequency of the co-occurrence of the character string C in the set A and the character string D in the set B over all the predetermined ranges in the text is present in the character string C. And a first matrix generation step of generating and outputting a matrix as an element in the matrix corresponding to the character string D. A character string vector generation method comprising:
文字列ベクトルを行列の行ベクトルとして生成する文字列ベクトル生成装置が実行する文字列ベクトル生成方法であって、
入力されたテキストから、当該テキスト中の文の各文字位置からの連続する有限個の文字の列である文字列の異なりの集合A及び集合Bを抽出する文字列集合抽出ステップと、
前記集合B中の各文字列に対し、L(Lは1以上の整数)個の成分番号から抽出される成分番号集合の群から、既に付与した成分番号集合の群を除いた集合群から、ランダムに一つの成分番号集合を選び、当該成分番号集合を当該文字列に付与する成分番号付与ステップと、
各行を前記集合A中の文字列に対応させ、各列を前記成分番号集合中の成分番号に対応させた行列を生成し、前記テキスト中の、連続する有限個の単語の列である所定の範囲に存在する、前記集合A中の文字列Cと、前記集合B中の文字列に対応付けられた成分番号Eとが共起する頻度を、前記テキスト中の全ての前記所定の範囲にわたって加算した値を、前記文字列Cと前記成分番号Eに対応する前記行列中の要素とした行列を生成し、出力する第2行列生成ステップと
を備えることを特徴とする文字列ベクトル生成方法。
A character string vector generation method executed by a character string vector generation device that generates a character string vector as a row vector of a matrix,
A character string set extraction step for extracting different sets A and B of character strings, which are strings of a finite number of consecutive characters from each character position of the sentence in the text, from the input text;
For each character string in the set B, from a set group obtained by excluding an already assigned component number set group from a set of component number sets extracted from L (L is an integer of 1 or more) component numbers A component number assigning step that randomly selects one component number set and assigns the component number set to the character string ;
Each row is associated with a character string in the set A, a matrix is generated in which each column is associated with a component number in the component number set, and a predetermined finite number of words in the text. The frequency that the character string C in the set A and the component number E associated with the character string in the set B coexist in the range is added over all the predetermined ranges in the text A second matrix generation step of generating and outputting a matrix in which the value obtained is an element in the matrix corresponding to the character string C and the component number E.
前記出力された行列に対し特異値分解を行うことにより、当該行列を、列数をより少なくした行列に変換する特異値分解ステップを更に備えることを特徴とする請求項5または6に記載の文字列ベクトル生成方法。   7. The character according to claim 5, further comprising a singular value decomposition step of converting the matrix into a matrix having a smaller number of columns by performing singular value decomposition on the output matrix. Column vector generation method. 入力された文書に対し、当該文書中の各文字列で、前記出力された行列の行に対応する文字列の集合を検索し、検索された文字列に対応する行ベクトルを求め、当該行ベクトルの和または重心を、前記文書のベクトルとする文書ベクトル生成ステップを更に備えたことを特徴とする請求項5ないし7のうちいずれか1項に記載の文字列ベクトル生成方法。   For an input document, a set of character strings corresponding to the row of the output matrix is searched for each character string in the document, and a row vector corresponding to the searched character string is obtained. The character string vector generation method according to claim 5, further comprising: a document vector generation step in which a sum or a center of gravity is used as a vector of the document. コンピュータを、請求項1ないし4のうちいずれか1項に記載された文字列ベクトル生成装置における各手段として機能させるためのプログラム。   The program for functioning a computer as each means in the character string vector generation apparatus described in any one of Claims 1 thru | or 4. 請求項9に記載されたプログラムを格納したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium storing the program according to claim 9.
JP2010118830A 2010-05-24 2010-05-24 CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM Active JP5513985B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010118830A JP5513985B2 (en) 2010-05-24 2010-05-24 CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010118830A JP5513985B2 (en) 2010-05-24 2010-05-24 CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM

Publications (2)

Publication Number Publication Date
JP2011248483A JP2011248483A (en) 2011-12-08
JP5513985B2 true JP5513985B2 (en) 2014-06-04

Family

ID=45413690

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010118830A Active JP5513985B2 (en) 2010-05-24 2010-05-24 CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM

Country Status (1)

Country Link
JP (1) JP5513985B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11694029B2 (en) * 2019-08-19 2023-07-04 Oracle International Corporation Neologism classification techniques with trigrams and longest common subsequences
CN112749250B (en) * 2019-10-30 2025-02-18 阿里巴巴集团控股有限公司 Text information processing method, device and system
CN114722793B (en) * 2021-01-04 2025-07-11 阿里巴巴集团控股有限公司 Trademark similarity obtaining method, device and electronic device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006338342A (en) * 2005-06-02 2006-12-14 Nippon Telegr & Teleph Corp <Ntt> Word vector generation device, word vector generation method and program
JP4499003B2 (en) * 2005-09-05 2010-07-07 日本電信電話株式会社 Information processing method, apparatus, and program

Also Published As

Publication number Publication date
JP2011248483A (en) 2011-12-08

Similar Documents

Publication Publication Date Title
JP3768205B2 (en) Morphological analyzer, morphological analysis method, and morphological analysis program
CN103970798B (en) The search and matching of data
JP2007004633A (en) Language model generation device and language processing device using language model generated by the same
CN106815197A (en) The determination method and apparatus of text similarity
JP2011085986A (en) Text summarization method, its device, and program
Yuret Fastsubs: An efficient and exact procedure for finding the most likely lexical substitutes based on an n-gram language model
JP5718405B2 (en) Utterance selection apparatus, method and program, dialogue apparatus and method
JP5513985B2 (en) CHARACTER VECTOR GENERATION DEVICE, CHARACTER VECTOR GENERATION METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM
CN110555091A (en) Associated word generation method and device based on word vectors
JP4900947B2 (en) Abbreviation extraction method, abbreviation extraction apparatus, and program
WO2011086637A1 (en) Requirements extraction system, requirements extraction method and requirements extraction program
JP4567025B2 (en) Text classification device, text classification method, text classification program, and recording medium recording the program
EP2219121A1 (en) Efficient computation of ontology affinity matrices
JP5853595B2 (en) Morphological analyzer, method, program, speech synthesizer, method, program
JP4945015B2 (en) Document search system, document search program, and document search method
US20050273316A1 (en) Apparatus and method for translating Japanese into Chinese and computer program product
CN101371252B (en) Character processing device, method and program, and recording medium
Torunoglu-Selamet et al. Exploring spelling correction approaches for turkish
Al Oudah et al. Wajeez: an extractive automatic Arabic text summarisation system
JP2009176148A (en) Unknown word determining system, method and program
JP3848014B2 (en) Document search method and document search apparatus
JP4499003B2 (en) Information processing method, apparatus, and program
CN107622129B (en) Method and device for organizing knowledge base and computer storage medium
JP6181890B2 (en) Literature analysis apparatus, literature analysis method and program
JP5362649B2 (en) Character string vector conversion device, character string vector conversion method, program, and computer-readable recording medium storing the program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121106

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130822

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130903

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20131004

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131101

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140328

R150 Certificate of patent or registration of utility model

Ref document number: 5513985

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150