JP7193000B2 - Similar document search method, similar document search program, similar document search device, index information creation method, index information creation program, and index information creation device - Google Patents
Similar document search method, similar document search program, similar document search device, index information creation method, index information creation program, and index information creation device Download PDFInfo
- Publication number
- JP7193000B2 JP7193000B2 JP2021541969A JP2021541969A JP7193000B2 JP 7193000 B2 JP7193000 B2 JP 7193000B2 JP 2021541969 A JP2021541969 A JP 2021541969A JP 2021541969 A JP2021541969 A JP 2021541969A JP 7193000 B2 JP7193000 B2 JP 7193000B2
- Authority
- JP
- Japan
- Prior art keywords
- document
- word
- search target
- words
- hash function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/38—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/383—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/93—Document management systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明の実施形態は、類似文書検索方法、類似文書検索プログラム、類似文書検索装置、索引情報作成方法、索引情報作成プログラムおよび索引情報作成装置に関する。 The embodiments of the present invention relate to a similar document search method, a similar document search program, a similar document search device, an index information creation method, an index information creation program, and an index information creation device.
従来、コンピュータによる自然言語処理の一つとして、データベースに記憶された文書の中から入力文書に類似する文書を検索する検索処理がある。例えば、問い合わせ文書のサンプルと当該サンプルに対応する返答文書とをデータベースに登録しておく。そして、入力された問い合わせ文書に類似するサンプルを検索し、当該類似するサンプルに対応する返答文書を出力するチャットボット等の対話インタフェースを構築することが考えられる。 2. Description of the Related Art Conventionally, as one of natural language processing by a computer, there is search processing for searching for documents similar to an input document from among documents stored in a database. For example, a sample inquiry document and a reply document corresponding to the sample are registered in the database. Then, it is conceivable to build an interactive interface such as a chatbot that retrieves samples similar to the input inquiry text and outputs response texts corresponding to the similar samples.
データベースに登録されたサンプルの中から入力文書に類似するサンプルを検索する方法としては、2つの文書の間で出現する単語の共通度を評価する方法がある。例えば、以下のような検索方法が考えられる。ある文書に含まれる単語集合から1つのハッシュ値を算出するハッシュ関数(Min-hash関数と言うことがある)を複数個定義しておく。各ハッシュ関数は、異なる単語に対して異なる値を対応付けた対応関係をもち、ある単語集合に含まれる単語に対応する値のうち最小の値をハッシュ値として出力する。データベースに登録されたサンプルに対して、この複数のハッシュ関数を用いて算出された複数のハッシュ値を列挙したベクトルを予め生成しておく。そして、入力文書に含まれる単語集合と上記の複数のハッシュ関数から同様にベクトルを算出し、データベースに登録されたサンプルのベクトルと近似するものを検索する。 As a method of retrieving samples similar to the input document from the samples registered in the database, there is a method of evaluating the degree of commonality of words appearing between two documents. For example, the following search methods are conceivable. A plurality of hash functions (sometimes called Min-hash functions) for calculating one hash value from a set of words contained in a document are defined. Each hash function has a correspondence relationship in which different values are associated with different words, and outputs the minimum value of values corresponding to words included in a certain word set as a hash value. A vector listing a plurality of hash values calculated using the plurality of hash functions is generated in advance for the samples registered in the database. Then, vectors are similarly calculated from the set of words contained in the input document and the plurality of hash functions described above, and a vector similar to the vector of the samples registered in the database is searched.
しかしながら、上記の従来技術では、入力文書が短い、文書に用いられる表現が多様でサンプルと一致する表現が少ないなどの場合に、単語の共通度が低く評価され、検索精度が低下するという問題がある。例えば、チャットボットの入力文書は、主に話し言葉であり、1文が短く表現も多様であることから、入力文書と、サンプルとの間で共通の単語が出現する確率が全体的に低くなる。この結果、入力文書に対するサンプルの検索精度が低くなりやすい。 However, in the above-described conventional technology, when the input document is short or the expressions used in the document are diverse and the number of expressions that match the sample is small, the degree of commonality of words is evaluated low, resulting in a decrease in search accuracy. be. For example, since the input documents of the chatbot are mainly spoken words, sentences are short, and expressions are diverse, the probability of common words appearing between the input document and the sample is generally low. As a result, the sample retrieval accuracy for the input document tends to be low.
1つの側面では、類似する文書の検索精度を向上させる類似文書検索方法、類似文書検索プログラム、類似文書検索装置、索引情報作成方法、索引情報作成プログラムおよび索引情報作成装置を提供することを目的とする。 An object of one aspect is to provide a similar document search method, a similar document search program, a similar document search device, an index information creation method, an index information creation program, and an index information creation device that improve the accuracy of searching for similar documents. do.
1つの案では、類似文書検索方法は、生成する処理と、算出する処理と、検索する処理とをコンピュータが実行する。生成する処理は、検索対象文書に含まれる単語の集合と、単語の語意の近さを示す語間情報とに基づき、単語の集合に含まれる単語それぞれに対して、所定の単語を基準として当該単語に対して語意の近い順に近い値を割り当てるハッシュ関数を生成する。算出する処理は、生成したハッシュ関数に基づいて複数の検索対象文書それぞれの要約情報を算出し、生成したハッシュ関数に基づいて入力文書の要約情報を算出する。検索する処理は、算出した検索対象文書の要約情報と、入力文書の要約情報との間の比較に基づいて、複数の検索対象文書の中から入力文書に類似する文書を検索する。 In one proposal, in the similar document search method, a computer executes the process of generating, the process of calculating, and the process of searching. The generating process is based on a set of words included in the search target document and inter-word information indicating the closeness of the meaning of the words. Generate a hash function that assigns close values to words in descending order of semantics. The calculation process calculates summary information for each of a plurality of search target documents based on the generated hash function, and calculates summary information for the input document based on the generated hash function. In the searching process, a document similar to the input document is searched from a plurality of search target documents based on comparison between the calculated summary information of the search target document and the summary information of the input document.
1つの側面では、類似する文書の検索精度が向上する。 In one aspect, search accuracy for similar documents is improved.
以下、図面を参照して、実施形態にかかる類似文書検索方法、類似文書検索プログラム、類似文書検索装置、索引情報作成方法、索引情報作成プログラムおよび索引情報作成装置を説明する。実施形態において同一の機能を有する構成には同一の符号を付し、重複する説明は省略する。なお、以下の実施形態で説明する類似文書検索方法、類似文書検索プログラム、類似文書検索装置、索引情報作成方法、索引情報作成プログラムおよび索引情報作成装置は、一例を示すに過ぎず、実施形態を限定するものではない。また、以下の各実施形態は、矛盾しない範囲内で適宜組みあわせてもよい。 Hereinafter, a similar document search method, a similar document search program, a similar document search device, an index information creation method, an index information creation program, and an index information creation device according to embodiments will be described with reference to the drawings. Configurations having the same functions in the embodiments are denoted by the same reference numerals, and overlapping descriptions are omitted. Note that the similar document search method, similar document search program, similar document search device, index information creation method, index information creation program, and index information creation device described in the following embodiments are merely examples, and the embodiments are not limited to these. It is not limited. Moreover, each of the following embodiments may be appropriately combined within a non-contradictory range.
[概要]
本実施形態では、データベースに登録されたサンプル(以下、検索対象文書とも呼ぶ)の中から入力文書(以下、問い合わせ文書とも呼ぶ)に類似する文書を検索する情報処理装置を例示する。[overview]
This embodiment will exemplify an information processing apparatus that retrieves a document similar to an input document (hereinafter also referred to as an inquiry document) from samples (hereinafter also referred to as search target documents) registered in a database.
この情報処理装置では、先ず事前処理を行い、次いで検索処理を行う。事前処理では、ハッシュ関数を用いて検索対象文書それぞれについてハッシュ値を算出し、算出したハッシュ値より検索対象文書を検索するための木構造などの索引構造(例えば探索木)を作る。 In this information processing apparatus, first, preliminary processing is performed, and then search processing is performed. In the pre-processing, a hash value is calculated for each search target document using a hash function, and an index structure such as a tree structure (for example, a search tree) for searching the search target document is created from the calculated hash value.
検索処理では、ハッシュ関数を用いて問い合わせ文書のハッシュ値を算出する。次いで、情報処理装置は、問い合わせ文書のハッシュ値と、検索対象文書それぞれのハッシュ値とを比較し、索引構造で示された検索対象文書それぞれのハッシュ値の中から近いものを探す。次いで、情報処理装置は、問い合わせ文書のハッシュ値と近いハッシュ値の検索対象文書を類似する文書の検索結果とする。 In the search process, a hash function is used to calculate the hash value of the inquiry document. Next, the information processing device compares the hash value of the inquiry document with the hash value of each search target document, and searches for a similar hash value among the search target documents shown in the index structure. Next, the information processing apparatus determines search target documents having hash values close to the hash value of the inquiry document as similar document search results.
ハッシュ値を算出するハッシュ関数については、データベースに登録された検索対象文書に含まれる単語を抽出して得られた単語の集合をもとに、複数個定義しておく。具体的には、情報処理装置は、Wを単語の集合、hをWから{0,1,…,|W|-1}へのすべての単射の集合(複数のハッシュ関数)としてハッシュ関数を複数生成しておく。 A plurality of hash functions for calculating hash values are defined based on a set of words obtained by extracting words contained in search target documents registered in the database. Specifically, the information processing apparatus uses a hash function where W is a set of words, and h is a set (a plurality of hash functions) of all injections from W to {0, 1, ..., |W|-1}. Generate multiple .
情報処理装置は、検索対象文書および問い合わせ文書について次の処理を行うことで、複数のハッシュ値によるベクトルを求めて検索対象文書および問い合わせ文書をハッシュ関数で要約した要約情報を得る。
・hからハッシュ関数をランダムに選択する。
・検索対象文書に含まれる単語を抽出して単語の集合を取得する。
・選択したhにより各単語から得る整数の中で最小のものをハッシュ値とする。
・関数のランダムな選択を複数回行うことで複数のハッシュ値を得る。The information processing apparatus performs the following processing on the search target document and the inquiry document, obtains a vector of a plurality of hash values, and obtains summary information summarizing the search target document and the inquiry document with a hash function.
• Randomly select a hash function from h.
・A set of words is obtained by extracting words contained in a document to be searched.
・The hash value is the smallest integer among the integers obtained from each word by the selected h.
・Multiple hash values are obtained by performing random selection of functions multiple times.
互いに類似する文書同士は、共通語の出現割合(ジャカール係数)が高くなる。hからのハッシュ関数の選択について、ハッシュ値が一致する確率はジャカール係数に一致する。よって、類似する文書を求める際の文書のハッシュ値同士の比較において、ベクトルの各要素の一致の割合からジャカール係数を確率的に計算でき、ハッシュ値のハミング距離(例えば不一致の数)が文書間の近さ(類似度)を反映している。 Documents that are similar to each other have a high common word appearance ratio (Jacquard coefficient). For a selection of hash functions from h, the probability of matching hash values is equal to the Jacquard coefficient. Therefore, when comparing hash values of documents when searching for similar documents, the Jacquard coefficient can be calculated stochastically from the rate of matching of each element of the vector. It reflects the closeness (similarity) of
また、nを検索対象文書の数、mを検索対象文書ごとの単語数(平均値)、kをハッシュ関数の数とする。すると、検索対象文書のベクトルを計算する計算量はO(kmn)となる。1つの問い合わせ文書のベクトルを計算する計算量はO(km)となり、このベクトルを用いた近傍探索の計算コストはO(log(n))となる。ハッシュ関数は予めランダムにk個生成される。kをO(log(n))とすると、異なる検索対象文書から同一のハッシュ値が算出される衝突確率を十分に小さくすることができる。 Let n be the number of search target documents, m be the number of words (average value) in each search target document, and k be the number of hash functions. Then, the amount of calculation for calculating the vector of the search target document is O (kmn). The amount of calculation for calculating a vector of one query document is O(km), and the calculation cost of neighborhood search using this vector is O(log(n)). K hash functions are randomly generated in advance. If k is O(log(n)), the collision probability of calculating the same hash value from different search target documents can be sufficiently reduced.
しかしながら、ハミング距離による類似度の検証では、ベクトルの各要素の差に意味はなく、要素が不一致の場合(共通語の出現がない場合)、類似度は0となる。このため、共通語の出現が少ない場合、類似検索の精度が低くなりやすい。 However, in verification of similarity based on Hamming distance, the difference between the elements of the vectors is meaningless, and the similarity is 0 when the elements do not match (when there is no common word). Therefore, when common words appear infrequently, the accuracy of similarity search tends to be low.
そこで、本実施形態では、情報処理装置は、単語間の語意の近さを示す語間距離情報をもとに、所定の単語を基準として語意の近い順に近い値を割り当てるハッシュ関数を生成する。具体的には、情報処理装置は、検索対象文書に含まれる単語を抽出して単語の集合し、ランダムに基準とする単語を選択する。次いで、情報処理装置は、語間距離情報をもとに、基準とする単語に対して語意の近い順に単語の集合に含まれる単語をソートし、ソート順に一意な値(例えばソート順に大きくなる整数値)の割り当てを行う。情報処理装置は、上記の処理を繰り返すことで、複数のハッシュ関数を生成する。 Therefore, in the present embodiment, the information processing apparatus generates a hash function that assigns a close value in descending order of meaning with reference to a predetermined word based on inter-word distance information indicating the closeness of meaning between words. Specifically, the information processing device extracts words contained in the search target document, collects the words, and randomly selects a reference word. Next, based on the inter-word distance information, the information processing device sorts the words included in the set of words in the order of closest meaning to the reference word, and obtains a unique value in the sort order (for example, an integer that increases in the sort order). numbers). The information processing device generates a plurality of hash functions by repeating the above process.
例えば、単語の集合が{猫、ご飯、…にゃんこ、えさ}であり、基準とする単語を{猫}とする場合、情報処理装置は、{猫}を基準として語意の近い順にソートする。これにより、{猫、にゃんこ、…ご飯、えさ}が得られる。このようにソートした単語の集合について、情報処理装置は、{猫=0、にゃんこ=1、…ご飯=5、えさ=6}などのように、ソート順に整数値を割り当てる。 For example, if the set of words is {cat, rice, . As a result, {cat, cat, . . . rice, food} is obtained. For the set of words sorted in this way, the information processing device assigns integer values in order of sorting, such as {cat=0, cat=1, . . . rice=5, food=6}.
このようにして生成されたハッシュ関数によるハッシュ値は、所定の単語に対する語意の距離(語間とも呼ぶ)に応じた値となる。このため、ハッシュ値間のハミング距離だけでなく、ユークリッド距離による類似度の検証が可能となる。したがって、共通語の出現がなく、ハッシュ値が不一致(要素が不一致の場合)であっても、ユークリッド距離により類似度を検証することができ、類似検索の精度を向上させることができる。 The hash value generated by the hash function generated in this manner is a value corresponding to the distance (also called between words) of the meaning of a given word. Therefore, it is possible to verify the degree of similarity not only by the Hamming distance between hash values but also by the Euclidean distance. Therefore, even if there is no common word and the hash values do not match (if the elements do not match), the degree of similarity can be verified by Euclidean distance, and the accuracy of similarity search can be improved.
[構成例]
図1は、実施形態にかかる情報処理装置の機能構成例を示すブロック図である。図1に示すように、情報処理装置100は、入力された問い合わせ文書101について、検索対象文書データベース121に格納された検索対象文書の中から類似する類似文書102を求める処理を行う装置である。情報処理装置100としては、例えばパーソナルコンピュータ等を適用できる。[Configuration example]
FIG. 1 is a block diagram of a functional configuration example of an information processing apparatus according to an embodiment; As shown in FIG. 1, the
情報処理装置100は、索引構造を作成する事前処理を行うインデックス生成モジュール111と、検索処理を行う検索モジュール112と、処理に関する各種データを格納する記憶部(検索対象文書データベース121、語間距離情報記憶部122、ハッシュ関数記憶部123およびインデックス記憶部124)とを有する。すなわち、情報処理装置100は、類似文書検索装置および索引情報作成装置の一例である。
The
検索対象文書データベース121は、問い合わせ文書101に対して検索対象となる検索対象文書が登録されたデータベースである。検索対象文書データベース121における検索対象文書は、事前に登録されていてもよいし、情報処理装置100を使用するユーザとのチャットボット等の対話インタフェースにおける対話を通じて追加されてもよし、ネットワークから自動的に収集されてもよい。
The search
語間距離情報記憶部122は、単語それぞれについて、他の単語との語意の近さ(語間)を表す語間距離情報を格納する。具体的には、語間距離情報としては、単語それぞれ(v)と、他の単語(w)との語意の距離(語間)を表す関数d(d,w)などがある。すなわち、語間距離情報は、単語の語意の近さを示す語間情報の一例である。 The inter-word distance information storage unit 122 stores inter-word distance information representing the closeness of meaning (between words) of each word to other words. Specifically, the inter-word distance information includes a function d(d, w) representing the distance (word inter-word) between each word (v) and another word (w). That is, inter-word distance information is an example of inter-word information indicating the closeness of word meanings of words.
ハッシュ関数記憶部123は、インデックス生成モジュール111が生成した異なる複数のハッシュ関数を記憶する。各ハッシュ関数は、検索対象文書に出現し得る単語それぞれに対して一意な整数(所定の単語に対して語意の近い順)を対応付ける対応関係をもち、単語集合を受け付けて1つのハッシュ値を出力する。また、異なるハッシュ関数は異なる対応関係をもつ。
Hash function storage unit 123 stores a plurality of different hash functions generated by
インデックス記憶部124は、問い合わせ文書101に類似する検索対象文書を検索するための索引構造を記憶する。索引構造は、複数のハッシュ関数を用いて検索対象文書から算出されたベクトル(要約情報)に基づいてインデックス生成部132が生成したものであり、検索対象文書それぞれの要約情報を探索する索引情報の一例である。
The
索引構造としては、例えば探索木を適用できる。探索木は、木構造に接続された複数のノード(葉ノードと、葉ノードに至る各ノード)を含む。探索木の葉ノードは、検索対象文書を指し示す。例えば、葉ノードは、検索対象文書のベクトルと当該検索対象文書を識別する識別情報(例えば文書ID)とを含む。ただし、葉ノードがベクトルを含まなくてもよい。 For example, a search tree can be applied as the index structure. A search tree includes a plurality of nodes (a leaf node and each node leading up to the leaf node) connected in a tree structure. A leaf node of the search tree indicates a document to be searched. For example, a leaf node includes a vector of a search target document and identification information (for example, document ID) that identifies the search target document. However, leaf nodes do not have to contain vectors.
葉ノード以外の各ノードには2つの子ノードが接続されている。葉ノード以外の各ノードは、ベクトルの中の特定の次元に対する閾値をもつ。入力されたベクトルの中の特定の次元のハッシュ値が閾値以上である場合は右子ノードに進み、特定の次元のハッシュ値が閾値未満である場合は左子ノードに進む。このようにして、探索木をルートノードから葉ノードに向かって辿ることで、所定のベクトルに近い検索対象文書を効率的に検索することができる。 Two child nodes are connected to each non-leaf node. Each non-leaf node has a threshold for a particular dimension in the vector. If the hash value of the specified dimension in the input vector is greater than or equal to the threshold, proceed to the right child node, and if the hash value of the specified dimension is less than the threshold, proceed to the left child node. By tracing the search tree from the root node to the leaf nodes in this way, it is possible to efficiently search for a search target document that is close to a predetermined vector.
インデックス生成モジュール111は、ハッシュ関数生成部131と、インデックス生成部132とを有する。
The
ハッシュ関数生成部131は、ハッシュ関数生成部131に記憶された検索対象文書と、問い合わせ受信部133に記憶された語間距離情報とに基づいて、複数のハッシュ関数を生成し、生成した複数のハッシュ関数をハッシュ関数記憶部123に格納する。
Hash
具体的には、ハッシュ関数生成部131は、検索対象文書に含まれる単語を抽出して単語の集合し、ランダムに基準とする単語を選択する。次いで、ハッシュ関数生成部131は、語間距離情報記憶部122の語間距離情報を参照し、基準とする単語に対して語意の近い順に単語の集合に含まれる単語を整列(ソート)する。次いで、ハッシュ関数生成部131は、単語の集合に含まれる単語について、整列順に一意な値(例えばソート順に大きくなる整数値)を割り当ててハッシュ関数を生成する。ハッシュ関数生成部131は、上記のハッシュ関数を生成する処理を繰り返すことで、複数のハッシュ関数を生成する。
Specifically, the
例えば、語間距離情報として単語それぞれ(v)と、他の単語(w)との語意の距離(語間)を表す関数d(d,w)が与えられているものとする。この関数d(d,w)については、語間の類似度や単語のベクトル表現などを参照して予め作成することができる。また、関数d(d,w)は、次のとおりである。
・任意のv,w∈Wについて、0≦d(v,w)である。
・任意のw∈Wについて、d(w,w)=0である。For example, it is assumed that a function d(d, w) representing the distance (word spacing) between each word (v) and another word (w) is given as inter-word distance information. This function d(d, w) can be created in advance with reference to the degree of similarity between words, the vector representation of words, and the like. Also, the function d(d, w) is as follows.
• 0≤d(v,w) for any v,wεW.
• d(w,w)=0 for any wεW.
また、ハッシュ関数については、任意のu、v∈Wについて、h(u)>h(v)⇔d(u,w)>d(v,w)となるw∈Wがあるものとする。 As for the hash function, for any u, v∈W, there is w∈W such that h(u)>h(v)⇔d(u, w)>d(v, w).
ハッシュ関数生成部131は、Wからwをランダムに選択し、すべてのv∈Wをd(v,w)の小さい順にソートする。次いで、ハッシュ関数生成部131は、ソートされた語w,v1,v2…に整数0,1,2,…を割り当てる。なお、ハッシュ関数生成部131は、整数を割り当てる代わりにd(v,w)の値をそのまま使ってもよい(重複がないものとする)。The
インデックス生成部132は、検索対象文書データベース121に記憶された検索対象文書とハッシュ関数記憶部123に記憶されたハッシュ関数に基づいて、索引構造を生成し、生成した索引構造をインデックス記憶部124に格納する。
The
具体的には、インデックス生成部132は、検索対象文書ごとに単語集合を抽出し、抽出した単語集合を複数のハッシュ関数それぞれに入力して、ハッシュ値のベクトル、すなわち検索対象文書の要約情報を算出する。次いで、インデックス生成部132は、複数の検索対象文書に対応する複数のベクトルを効率的に検索できるように、索引構造を生成する。例えば、インデックス生成部132は、ベクトルの中の1つの次元に着目し、ベクトルの集合が二分割されるように当該次元のハッシュ値の閾値を決定することを繰り返すことで、探索木を生成する。このとき、インデックス生成部132は、探索木の葉ノードにはできる限り単一のベクトルが対応付けられるように中間ノードを生成する。
Specifically, the
検索モジュール112は、問い合わせ受信部133と、ハッシュ値算出部134と、検索部135と、出力部136とを有する。
The
問い合わせ受信部133は、問い合わせ文書101を受信する。問い合わせ受信部133は、ユーザから文字列として入力された問い合わせ文書101を受信してもよいし、ユーザが口頭で発した問い合わせ発話の音声信号を文字列に変換してもよい。また、問い合わせ受信部133は、他の情報処理装置から文字列または音声信号を受信してもよい。 The inquiry reception unit 133 receives the inquiry document 101 . The inquiry receiving unit 133 may receive the inquiry document 101 input as a character string from the user, or may convert a voice signal of an inquiry utterance verbally uttered by the user into a character string. Also, the inquiry receiving unit 133 may receive a character string or an audio signal from another information processing device.
ハッシュ値算出部134は、ハッシュ関数記憶部123に記憶された複数のハッシュ関数に基づいて、問い合わせ文書101に対応するベクトル、すなわち問い合わせ文書101の要約情報を生成する。具体的には、ハッシュ値算出部134は、問い合わせ文書101から単語集合を抽出し、抽出した単語集合を複数のハッシュ関数それぞれに入力して、ハッシュ値のベクトルを算出する。 The hash value calculation unit 134 generates a vector corresponding to the inquiry document 101, that is, summary information of the inquiry document 101, based on a plurality of hash functions stored in the hash function storage unit 123. FIG. Specifically, the hash value calculation unit 134 extracts a word set from the inquiry document 101, inputs the extracted word set to each of a plurality of hash functions, and calculates a hash value vector.
検索部135は、インデックス記憶部124に記憶された索引構造と問い合わせ文書101のベクトルに基づいて、近傍探索により問い合わせ文書101に最も類似する検索対象文書を検索する。具体的には、問い合わせ文書101に最も類似する検索対象文書は、ベクトル同士を比較したときにハッシュ値が一致する次元が最も多いものである。
Based on the index structure stored in the
例えば、検索部135は、問い合わせ文書101のベクトルの中の特定の次元のハッシュ値と閾値とを比較しながら、インデックス記憶部124に記憶された探索木をルートノードから葉ノードに向かって辿り、特定の葉ノードに到達する。検索部135は、到達した葉ノードに対応する検索対象文書を選択する。
For example, the
なお、到達した葉ノードに2以上の検索対象文書が対応付けられている場合、すなわち、ハッシュ値が一致する次元数が同じであり、探索木では検索対象文書を1つに絞り込めない場合、検索部135は、ハッシュ値同士を比較してユークリッド距離を求める。次いで、検索部135は、ユークリッド距離がより近いものを最も類似する検索対象文書とする。
Note that if two or more search target documents are associated with the reached leaf node, that is, if the number of dimensions with matching hash values is the same and the search tree cannot narrow down the search target document to one, The
出力部136は、検索された検索対象文書を類似文書102として出力する。例えば、出力部136は、類似文書102の文字列をディスプレイ等に表示してもよいし、類似文書102を音声信号に変換してスピーカにより音声を再生してもよい。また、出力部136は、他の情報処理装置に類似文書102の文字列または音声信号を送信してもよい。 The output unit 136 outputs the retrieved search target document as the similar document 102 . For example, the output unit 136 may display the character string of the similar document 102 on a display or the like, or may convert the similar document 102 into an audio signal and reproduce the audio through a speaker. The output unit 136 may also transmit the character string or audio signal of the similar document 102 to another information processing device.
また、出力部136は、類似文書102を出力する代わりに、検索された検索対象文書に対して検索対象文書データベース121において予め紐付けられた処理を実施してもよい。具体的には、検索対象文書データベース121には、検索対象文書ごとに、所定の処理(例えばスケジュール登録、メール送信)が登録されているものとする。出力部136は、検索された検索対象文書に紐付けられた処理を検索対象文書データベース121より読み出して実行することで、問い合わせ文書101に対応した処理を行うことが可能となる。
Also, instead of outputting the similar document 102 , the output unit 136 may perform processing associated in advance in the search
[動作例]
図2は、実施形態にかかる情報処理装置の処理フローの一例を示す説明図である。図2に示すように、情報処理装置100は、索引構造を作成する事前処理(S1)と、問い合わせ文書101に対する類似文書102を検索して出力する検索処理(S2)とを行う。[Example of operation]
FIG. 2 is an explanatory diagram of an example of a processing flow of the information processing apparatus according to the embodiment; As shown in FIG. 2, the
先ず、事前処理(S1)について説明する。事前処理(S1)では、先ず検索対象文書データベース121より検索対象文書が読み出され、ハッシュ関数生成部131に入力される(S11)。
First, the preprocessing (S1) will be described. In the pre-processing (S1), a search target document is first read from the search
ハッシュ関数生成部131では、問い合わせ受信部133より語間の距離の入力を受け付け(S13)、入力された検索対象文書と、語間の距離とに基づき、複数のハッシュ関数123aを生成する(S12)。
The hash
図3は、ハッシュ関数の生成処理の一例を示すフローチャートである。図3に示すように、ハッシュ関数生成部131は、検索対象文書の入力を受け付け(S31)、検索対象文書に含まれる単語(出現語)を抽出することで(S32)、単語の集合(語集合)を取得する(S33)。
FIG. 3 is a flowchart illustrating an example of hash function generation processing. As shown in FIG. 3, the
次いで、ハッシュ関数生成部131は、S34~S39の処理を生成するハッシュ関数の数であるk回繰り返すことで、複数のハッシュ関数123aを生成する。
Next, the hash
具体的には、ハッシュ関数生成部131は、語集合の中からランダムに1つの単語を選択し(S35)、語間の距離を示す語間距離情報の入力を受け付け(S36)、選択した単語と他の単語との距離を語間距離情報より参照する(S37)。次いで、ハッシュ関数生成部131は、選択した単語との距離の近い順に語集合の単語をソートし(S38)、整列した各単語に整列順に大きくなるような整数値をハッシュ値として割り当てる(S39)。
Specifically, the hash
次いで、ハッシュ関数生成部131は、S34~S39の処理をk回繰り返して得られた複数のハッシュ関数123aを出力し、インデックス生成部132に格納する(S40)。
Next, the
図4は、ハッシュ関数123aを説明する説明図である。図4に示すように、ハッシュ関数123aにおけるh1,h2,…h2,…が1つのハッシュ関数である。FIG. 4 is an explanatory diagram for explaining the
例えば、h1は、(猫)を基準の単語としており、語集合における各単語について(猫)に対する語間の距離に応じた整数値が割り当てられている。また、h2は、(ごはん)を基準の単語としており、語集合における各単語について(ごはん)に対する語間の距離に応じた整数値が割り当てられている。また、h3は、(にゃんこ)を基準の単語としており、語集合における各単語について(にゃんこ)に対する語間の距離に応じた整数値が割り当てられている。また、h4は、(えさ)を基準の単語としており、語集合における各単語について(えさ)に対する語間の距離に応じた整数値が割り当てられている。また、h5は、(花)を基準の単語としており、語集合における各単語について(花)に対する語間の距離に応じた整数値が割り当てられている。また、h6は、(水)を基準の単語としており、語集合における各単語について(水)に対する語間の距離に応じた整数値が割り当てられている。For example, h1 has (cat) as a reference word, and each word in the word set is assigned an integer value according to the inter-word distance from (cat). Also, h2 is based on the word (rice), and each word in the word set is assigned an integer value corresponding to the inter-word distance from the word (rice). Also , h3 is based on a word (cat), and an integer value is assigned to each word in the word set according to the distance between words with respect to (cat). Also, h4 is based on the word (bait), and an integer value is assigned to each word in the word set according to the distance between words with respect to (bait). In addition, h5 uses (flower) as a reference word, and an integer value corresponding to the inter-word distance from (flower) is assigned to each word in the word set. Also, h6 is based on the word (water), and each word in the word set is assigned an integer value corresponding to the inter-word distance to (water).
ここで、図4に例示したハッシュ関数123aにより次の文書A~文書Cのハッシュ値を求める場合を例示する。
文書A:「猫にごはんをやる」
文書B:「にゃんこにえさをやる」
文書C:「花に水をやる」Here, a case where the hash values of the following documents A to C are obtained by the
Document A: "Feed the cat"
Document B: "Feed the Nyanko"
Document C: "Watering the flowers"
文書Aの語集合は{猫、ご飯}、文書Bの語集合は{にゃんこ、えさ}、文書Cの語集合は{花、水}である。よって、図4に例示したハッシュ関数123aによる文書Aのハッシュ値HAは、HA=001133となる。同様に、文書Bのハッシュ値HBは、HB=110022となる。また、文書Cのハッシュ値HCは、HC=424200となる。The word set of document A is {cat, rice}, the word set of document B is {nyanko, food}, and the word set of document C is {flower, water}. Therefore, the hash value H A of document A by the
ここで、文書A~Cのハッシュ値を比較してハミング距離を計算すると、HA,HB:6、HA,HC:6、HB,HC:6となる。また、文書A~Cのハッシュ値を比較してユークリッド距離を計算すると、HA,HB:1、HA,HC:6.9、HB,HC:6.2となる。このように、ハミング距離では類似度の検証が困難な場合(共通語が含まれていない場合)でも、ユークリッド距離により互いに類似する文書(図示例では文書A、B)を検証することができる。Here, when Hamming distances are calculated by comparing hash values of documents A to C, H A , H B : 6, H A , H C : 6, H B , H C : 6. Also, when comparing the hash values of documents A to C and calculating the Euclidean distance, H A , H B : 1, H A , H C : 6.9, H B , H C : 6.2. In this way, even when it is difficult to verify the degree of similarity using the Hamming distance (when no common words are included), it is possible to verify mutually similar documents (documents A and B in the illustrated example) using the Euclidean distance.
図2に戻り、S12に次いで、インデックス生成部132は、入力された検索対象文書と、生成したハッシュ関数123aに基づいて、索引構造124aを生成し(S14)、生成した索引構造124aをインデックス記憶部124に格納する。
Returning to FIG. 2, following S12, the
検索処理(S2)では、問い合わせ受信部133が受信した問い合わせ文書101がハッシュ値算出部134に入力される(S21)。ハッシュ値算出部134は、ハッシュ関数記憶部123に記憶された複数のハッシュ関数に基づいて、入力された問い合わせ文書101のハッシュ値を複数生成し(S22)、問い合わせ文書101に対応するベクトルを得る。 In the search process (S2), the inquiry document 101 received by the inquiry reception unit 133 is input to the hash value calculation unit 134 (S21). Hash value calculation unit 134 generates a plurality of hash values of input inquiry document 101 based on a plurality of hash functions stored in hash function storage unit 123 (S22), and obtains a vector corresponding to inquiry document 101. .
次いで、検索部135は、インデックス記憶部124に記憶された索引構造における検索対象文書それぞれのベクトルと、問い合わせ文書101のベクトルのハッシュ値を照合し(S23)、問い合わせ文書101に最も類似する検索対象文書を検索する。出力部136は、検索部135が検索した類似文書102を出力する(S24)。
Next, the
図5は、語間の類似度を説明する説明図である。具体的には、図5は、語間の類似度を示す高次元の空間における語W1~W6それぞれの配置を俯瞰した図である。図5の語W1~W6それぞれは、文書に含まれる単語を示す。ここで、語W1~W3は、例えば「猫」などの単語について類似するものであり、点線で示すクラスターを形成している。同様に、語W4~W6は、例えば「犬」などの単語について類似するものであり、語W1~W3とは別のクラスターを形成している。 FIG. 5 is an explanatory diagram for explaining the degree of similarity between words. Specifically, FIG. 5 is a bird's-eye view of the arrangement of the words W1 to W6 in a high-dimensional space indicating the degree of similarity between words. Words W1 to W6 in FIG. 5 each indicate a word contained in the document. Here, the words W1 to W3 are similar to words such as "cat" and form a cluster indicated by a dotted line. Similarly, words W4-W6 are similar for words such as "dog" and form a separate cluster from words W1-W3.
図5に示すように、語間の類似度を示す高次元の空間において、単純な射影では、類似度をうまく評価することは困難である。例えば、軸A1への直交射影では、類似する単語(語W1~W3または語W4~W6)の値が近くなる。しかしながら、軸A1とは異なる軸A2への直交射影では、互いに類似しない単語(例えば語W1と語W4)が互いに類似する単語(例えば語W1と語W3)よりも近くなる場合がある。 As shown in FIG. 5, in a high-dimensional space of similarity between words, it is difficult to evaluate similarity well with simple projection. For example, an orthogonal projection onto axis A1 brings the values of similar words (words W1-W3 or words W4-W6) closer together. However, in an orthogonal projection onto an axis A2, which is different from axis A1, words that are dissimilar to each other (eg, words W1 and W4) may be closer together than words that are similar to each other (eg, words W1 and W3).
本実施形態では、ランダムに基準とする単語を選択し、Min hashによるハッシュ値を用いることから、基準とする単語(基準点)からの距離による射影を用いている。 In this embodiment, since a reference word is randomly selected and a hash value based on Min hash is used, projection based on the distance from the reference word (reference point) is used.
図6は、Min hashによるハッシュ値を説明する説明図である。ここで、語W1は「猫」、語W2は「にゃんこ」、語W3は「キャット」、語W4は「犬」、語W5は「鼠」、語W6は「ドッグ」、語W7は「わんこ」であるものとする。また、基準点は語W1であるものとする。 FIG. 6 is an explanatory diagram for explaining hash values based on Min hash. Here, the word W1 is "cat", the word W2 is "nyanko", the word W3 is "cat", the word W4 is "dog", the word W5 is "mouse", the word W6 is "dog", and the word W7 is "dog". ” shall be It is also assumed that the reference point is the word W1.
図6に示すように、基準点である語W1をもとに、ハッシュ関数123aでは、1:「猫」、2:「にゃんこ」、3:「キャット」、4:「犬」、5:「鼠」、6:「ドッグ」、7:「わんこ」の値が割り当てられる。ここで、基準点からの距離ならば、基準点に近いほど類似度の大小関係が保たれている(例えば1:「猫」、2:「にゃんこ」、3:「キャット」など)。しかしながら、基準点からの距離が遠いところでは(例えば5:「鼠」、6:「ドッグ」)、類似しない語の値が近くなる場合がある。
As shown in FIG. 6, based on the word W1 as a reference point, the
本実施形態では、語集合のハッシュ値の中の最小値を用いる(Min hash)ので、類似度の大小関係が保たれた、語の類似度を表現できる射影として適切なものとなっている。 In this embodiment, since the minimum hash value among the hash values of the word set is used (Min hash), it is suitable as a projection capable of expressing the degree of similarity of words while maintaining the degree of similarity.
図7は、実施形態にかかる情報処理装置100の動作の概要を説明する説明図である。図7に示すように、事前処理(S1)において、情報処理装置100は、語間距離情報による語間の類似度をもとに、検索対象文書データベース121の検索対象文書121aそれぞれに含まれる単語の集合について、所定の単語を基準として語意の近い順に近い値を割り当てるハッシュ関数を複数生成する。次いで、情報処理装置100は、生成した複数のハッシュ関数を用いて検索対象文書121aそれぞれをMin Hashによる変換を行い、算出されたベクトルを検索するための索引構造を生成してインデックス記憶部124に格納する。
FIG. 7 is an explanatory diagram illustrating an overview of the operation of the
検索処理(S2)において、情報処理装置100は、入力された問い合わせ文書101について、S1で生成した同じ複数のハッシュ関数を用いてMin Hashによる変換を行う。次いで、情報処理装置100は、問い合わせ文書101より算出したハッシュ値のベクトルと、インデックス記憶部124に格納されたハッシュ値のベクトルとを比較することで、問い合わせ文書101に最も類似する検索対象文書121aを検索する。
In the search process (S2), the
図示例では、「会議を調整したい」とする問い合わせ文書101に対し、検索対象文書121aの中で「スケジュールの調整」と、「打ち合わせの調整」とが「調整」という単語においてハッシュ値が一致することから、ハミング距離が近いものとなる。ここで、問い合わせ文書101に含まれる「会議」に対し、「スケジュール」よりも「会議」の方がより語意が近く、ユークリッド距離が近いものとなる。したがって、「会議を調整したい」とする問い合わせ文書101に対しては、「打ち合わせを調整したい」とする類似文書102が得られることとなる。
In the illustrated example, for the query document 101 "I want to coordinate a meeting", the hash values of the word "coordination" in the
なお、出力部136は、検索された検索対象文書について、最も類似する1つの類似文書102を出力してもよいし、ハミング距離およびユークリッド距離により得られた類似度が所定の閾値以上である複数の類似文書102を出力してもよい。 Note that the output unit 136 may output one similar document 102 that is most similar to the searched search target document, or may output a plurality of similar documents 102 whose similarities obtained by the Hamming distance and the Euclidean distance are equal to or greater than a predetermined threshold. similar document 102 may be output.
図8は、検索対象文書の絞り込みを説明する説明図である。具体的には、図8は、類似度の閾値と検索対象文書121aのヒット数との関係例を示すグラフである。
FIG. 8 is an explanatory diagram for explaining narrowing down of search target documents. Specifically, FIG. 8 is a graph showing an example of the relationship between the similarity threshold and the number of hits of the
グラフ10は、問い合わせ文書101と検索対象文書121aの類似度の閾値と、類似度が閾値より大きい検索対象文書121aの数(ヒット数)との間の関係を示す。類似度は、問い合わせ発話のベクトルと検索対象発話のベクトルの間でハッシュ値が一致する次元の数に、ハッシュ値同士のユークリッド距離を合わせたものである。
The
(A)関連語を考慮せずにベクトルを算出する方法では、問い合わせ文書101と各検索対象文書121aの類似度が全体として低く算出される。よって、類似度の閾値とヒット数との間の関係は曲線11のようになる。すなわち、類似度の閾値を低く設定してもヒット数が少なくなり、類似する検索対象文書121aの検索漏れが多くなる。
(A) In the method of calculating vectors without considering related words, the similarity between the inquiry document 101 and each
(B)関連語を同一視してベクトルを算出する方法では、問い合わせ文書101と各検索対象文書121aの類似度が全体として高く算出される。よって、類似度の閾値とヒット数との間の関係は曲線12のようになる。すなわち、類似度の閾値を高く設定してもヒット数が多くなり、類似する検索対象文書121aを効率的に絞り込むことが難しい。
(B) In the method of calculating vectors by equating related terms, the degree of similarity between the query document 101 and each
(C)本実施形態の方法では、問い合わせ文書101と各検索対象文書121aの類似度がユークリッド距離を加味したものとなる。よって、類似度の閾値とヒット数との間の関係は曲線13のように連続的なものとなる。その結果、問い合わせ文書101に類似する検索対象文書121aを効率的に絞り込むことができる。
(C) In the method of the present embodiment, the degree of similarity between the query document 101 and each
図9は、操作画面の表示例を示す説明図である。操作画面20は、例えばチャットボット等の対話インタフェースにおいて情報処理装置100のユーザに提示することでユーザからの各種操作を受け付ける画面である。操作画面20において、表示領域21は処理結果などを表示する領域であり、入力領域22は文書などの入力を行う領域である。例えば、情報処理装置100は、入力領域22に入力された問い合わせ文書101に対して類似文書102の検索を行い、検索結果に応じた出力を表示領域21に行う。
FIG. 9 is an explanatory diagram showing a display example of the operation screen. The
例えば、情報処理装置100は、「スケジュール調整したい」とする入力文書21aを問い合わせ文書101として類似文書102の検索を行い、検索結果21bを表示領域21に表示する。具体的には、「スケジュール調整したい」とする問い合わせ文書101に対し、検索対象文書121aの中から類似文書102として得られた「スケジュールの調整」に対応するスケジュール登録の処理が実行される。
For example, the
情報処理装置100では、図9の例におけるチャットボット等の対話インタフェースのように、問い合わせ文書101が主に話し言葉であり、1文が短く表現も多様である場合であっても、適切に類似文書102の検索を行うことができる。
In the
[効果]
以上のように、情報処理装置100は、ハッシュ関数生成部131と、インデックス生成部132と、ハッシュ値算出部134と、検索部135とを有する。ハッシュ関数生成部131は、検索対象文書121aに含まれる単語の集合と、単語の語意の近さを示す語間距離情報とに基づき、単語の集合に含まれる単語それぞれに対して、所定の単語を基準として語意の近い順に近い値を割り当てるハッシュ関数を生成する。インデックス生成部132は、生成したハッシュ関数に基づいて複数の検索対象文書121aそれぞれの要約情報を算出する。ハッシュ値算出部134は、生成したハッシュ関数に基づいて入力文書(問い合わせ文書101)の要約情報を算出する。検索部135は、算出した検索対象文書121aの要約情報と、問い合わせ文書101の要約情報との間の比較に基づいて、複数の検索対象文書121aの中から入力文書に類似する文書を検索する。[effect]
As described above, the
このため、情報処理装置100において、生成したハッシュ関数に基づいて算出した検索対象文書121aの要約情報と、問い合わせ文書101の要約情報とに含まれるハッシュ値は、所定の単語に対する語意の距離に応じた値となる。したがって、情報処理装置100では、検索対象文書121aの要約情報と、問い合わせ文書101の要約情報との間の比較において、例えば互いの要約情報の間におけるハミング距離だけでなく、ユークリッド距離を用いた類似度合いの検証を行うことができ、類似する文書の検索精度を向上させることができる。
Therefore, in the
また、インデックス生成部132およびハッシュ値算出部134のそれぞれは、生成したハッシュ関数において検索対象文書121aまたは問い合わせ文書101に含まれる単語の集合の単語それぞれに割り当てられた値の中で最小の値をハッシュ値として算出する。このように、情報処理装置100では、Min-hash関数により検索対象文書121aまたは問い合わせ文書101の要約情報を算出できる。
In addition, each of the
また、ハッシュ関数生成部131は、所定の単語を選び直してハッシュ関数を生成する処理を繰り返すことでハッシュ関数を複数生成する。そして、インデックス生成部132およびハッシュ値算出部134のそれぞれは、生成した複数のハッシュ関数によって検索対象文書121aまたは問い合わせ文書101に含まれる単語の集合から算出される複数のハッシュ値を含むベクトルを要約情報として算出する。これにより、情報処理装置100では、検索対象文書121aの要約情報と、問い合わせ文書101の要約情報との間の比較において、複数のハッシュ値を列挙したベクトルの比較により、例えばハミング距離、ユークリッド距離などを求めて類似度合いを検証することができる。
Further, the hash
また、情報処理装置100のインデックス生成部132は、算出した複数の検索対象文書121aそれぞれの要約情報と、検索対象文書121aとを対応付けた索引情報を生成する。検索部135は、問い合わせ文書101の要約情報と、索引情報において検索対象文書121aと対応付けられた要約情報との間の比較を行う。情報処理装置100では、索引情報を生成しておくことで、複数の検索対象文書121aの中から問い合わせ文書101に類似する文書の検索を高速に行うことができる。
In addition, the
[その他]
なお、図示した各装置の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。[others]
It should be noted that each component of each illustrated device does not necessarily need to be physically configured as illustrated. In other words, the specific form of distribution and integration of each device is not limited to the one shown in the figure, and all or part of them can be functionally or physically distributed and integrated in arbitrary units according to various loads and usage conditions. Can be integrated and configured.
例えば、本実施形態では、インデックス生成モジュール111と、検索モジュール112とを有する情報処理装置100を例示したが、インデックス生成モジュール111と、検索モジュール112とはそれぞれ異なる情報処理装置が有していてもよい。すなわち、事前処理(S1)と、検索処理(S2)とは、それぞれ異なる情報処理装置で実施してもよい。
For example, in the present embodiment, the
また、情報処理装置100で行われる各種処理機能は、CPU(またはMPU、MCU(Micro Controller Unit)等のマイクロ・コンピュータ)上で、その全部または任意の一部を実行するようにしてもよい。また、各種処理機能は、CPU(またはMPU、MCU等のマイクロ・コンピュータ)で解析実行されるプログラム上、またはワイヤードロジックによるハードウエア上で、その全部または任意の一部を実行するようにしてもよいことは言うまでもない。また、情報処理装置100で行われる各種処理機能は、クラウドコンピューティングにより、複数のコンピュータが協働して実行してもよい。
Various processing functions performed by the
ところで、上記の実施形態で説明した各種の処理は、予め用意されたプログラムをコンピュータで実行することで実現できる。そこで、以下では、上記の実施例と同様の機能を有するプログラムを実行するコンピュータ(ハードウエア)の一例を説明する。図10は、プログラムを実行するコンピュータの一例を示す図である。 By the way, the various processes described in the above embodiments can be realized by executing a prepared program on a computer. Therefore, an example of a computer (hardware) that executes a program having functions similar to those of the above embodiments will be described below. FIG. 10 is a diagram illustrating an example of a computer that executes programs.
図10に示すように、コンピュータ1は、各種演算処理を実行するCPU201と、データ入力を受け付ける入力装置202と、モニタ203と、スピーカ204とを有する。また、コンピュータ1は、記憶媒体からプログラム等を読み取る媒体読取装置205と、各種装置と接続するためのインタフェース装置206と、有線または無線により外部機器と通信接続するための通信装置207とを有する。また、コンピュータ1は、各種情報を一時記憶するRAM208と、ハードディスク装置209とを有する。また、コンピュータ1内の各部(201~209)は、バス210に接続される。
As shown in FIG. 10, the
ハードディスク装置209には、上記の実施形態で説明した各種の処理を実行するためのプログラム211が記憶される。また、ハードディスク装置209には、プログラム211が参照する各種データ212(例えば語間距離情報記憶部122、検索対象文書データベース121、ハッシュ関数記憶部123およびインデックス記憶部124の情報)が記憶される。入力装置202は、例えば、コンピュータ1の操作者から操作情報の入力を受け付ける。モニタ203は、例えば、操作者が操作する各種画面を表示する。インタフェース装置206は、例えば印刷装置等が接続される。通信装置207は、LAN(Local Area Network)等の通信ネットワークと接続され、通信ネットワークを介した外部機器との間で各種情報をやりとりする。
The
CPU201は、ハードディスク装置209に記憶されたプログラム211を読み出して、RAM208に展開して実行することで、ハッシュ関数生成部131、インデックス生成部132、問い合わせ受信部133、ハッシュ値算出部134、検索部135および出力部136に関する各種の処理を行う。なお、プログラム211は、ハードディスク装置209に記憶されていなくてもよい。例えば、コンピュータ1が読み取り可能な記憶媒体に記憶されたプログラム211を、コンピュータ1が読み出して実行するようにしてもよい。コンピュータ1が読み取り可能な記憶媒体は、例えば、CD-ROMやDVDディスク、USB(Universal Serial Bus)メモリ等の可搬型記録媒体、フラッシュメモリ等の半導体メモリ、ハードディスクドライブ等が対応する。また、公衆回線、インターネット、LAN等に接続された装置にこのプログラム211を記憶させておき、コンピュータ1がこれらからプログラムを読み出して実行するようにしてもよい。
The
1…コンピュータ
10…グラフ
11~13…曲線
20…操作画面
21…表示領域
21a…入力文書
21b…検索結果
22…入力領域
100…情報処理装置
101…問い合わせ文書
102…類似文書
111…インデックス生成モジュール
112…検索モジュール
121…検索対象文書データベース
121a…検索対象文書
122…語間距離情報記憶部
123…ハッシュ関数記憶部
123a…ハッシュ関数
124…インデックス記憶部
124a…索引構造
131…ハッシュ関数生成部
132…インデックス生成部
133…問い合わせ受信部
134…ハッシュ値算出部
135…検索部
136…出力部
201…CPU
202…入力装置
203…モニタ
204…スピーカ
205…媒体読取装置
206…インタフェース装置
207…通信装置
208…RAM
209…ハードディスク装置
210…バス
211…プログラム
212…各種データ
A1~A2…軸
W1~W7…語
202...
209
Claims (9)
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出し、
生成した前記ハッシュ関数に基づいて入力文書の要約情報を算出し、
算出した前記検索対象文書の要約情報と、前記入力文書の要約情報との間の比較に基づいて、複数の前記検索対象文書の中から前記入力文書に類似する文書を検索する、
処理をコンピュータが実行することを特徴とする類似文書検索方法。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. Generate a hash function that assigns close values in order of meaning,
calculating summary information for each of the plurality of search target documents based on the generated hash function;
calculating summary information of the input document based on the generated hash function;
searching for a document similar to the input document from among the plurality of search target documents based on a comparison between the calculated summary information of the search target document and the summary information of the input document;
A similar document search method characterized in that processing is executed by a computer.
ことを特徴とする請求項1に記載の類似文書検索方法。 In each of the calculating processes, a minimum value among values assigned to each word in a set of words included in the search target document or the input document in the generated hash function is calculated as a hash value.
2. The similar document search method according to claim 1, characterized by:
前記算出する処理のそれぞれは、生成した複数の前記ハッシュ関数によって前記検索対象文書または前記入力文書に含まれる単語の集合から算出される複数のハッシュ値を含むベクトルを要約情報として算出する、
ことを特徴とする請求項2に記載の類似文書検索方法。 In the generating process, a plurality of hash functions are generated by repeating the process of reselecting the predetermined word and generating the hash function,
In each of the calculating processes, a vector including a plurality of hash values calculated from a set of words included in the search target document or the input document by the plurality of generated hash functions is calculated as summary information.
3. The similar document retrieval method according to claim 2, characterized by:
前記検索する処理は、前記入力文書の要約情報と、前記索引情報において前記検索対象文書と対応付けられた要約情報との間の比較を行う、
ことを特徴とする請求項1に記載の類似文書検索方法。 a computer further executing a process of generating index information in which the calculated summary information of each of the plurality of search target documents and the search target documents are associated with each other;
The searching process compares summary information of the input document with summary information associated with the search target document in the index information.
2. The similar document search method according to claim 1, characterized by:
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出し、
生成した前記ハッシュ関数に基づいて入力文書の要約情報を算出し、
算出した前記検索対象文書の要約情報と、前記入力文書の要約情報との間の比較に基づいて、複数の前記検索対象文書の中から前記入力文書に類似する文書を検索する、
処理をコンピュータに実行させることを特徴とする類似文書検索プログラム。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. Generate a hash function that assigns close values in order of meaning,
calculating summary information for each of the plurality of search target documents based on the generated hash function;
calculating summary information of the input document based on the generated hash function;
searching for a document similar to the input document from among the plurality of search target documents based on a comparison between the calculated summary information of the search target document and the summary information of the input document;
A similar document search program characterized by causing a computer to execute processing.
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出する第1の算出部と、
生成した前記ハッシュ関数に基づいて入力文書の要約情報を算出する第2の算出部と、
算出した前記検索対象文書の要約情報と、前記入力文書の要約情報との間の比較に基づいて、複数の前記検索対象文書の中から前記入力文書に類似する文書を検索する検索部と、
を有することを特徴とする類似文書検索装置。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. a hash function generation unit that generates a hash function that assigns values close to each other in order of meaning;
a first calculation unit that calculates summary information of each of the plurality of search target documents based on the generated hash function;
a second calculation unit that calculates summary information of an input document based on the generated hash function;
a search unit that searches for a document similar to the input document from among the plurality of search target documents based on a comparison between the calculated summary information of the search target document and the summary information of the input document;
A similar document retrieval device characterized by comprising:
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出し、
算出した複数の前記検索対象文書それぞれの要約情報を探索する索引情報を生成する、
処理をコンピュータが実行することを特徴とする索引情報作成方法。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. Generate a hash function that assigns close values in order of meaning,
calculating summary information for each of the plurality of search target documents based on the generated hash function;
generating index information for searching summary information of each of the plurality of calculated search target documents;
An index information creation method characterized in that processing is executed by a computer.
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出し、
算出した複数の前記検索対象文書それぞれの要約情報を探索する索引情報を生成する、
処理をコンピュータに実行させることを特徴とする索引情報作成プログラム。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. Generate a hash function that assigns close values in order of meaning,
calculating summary information for each of the plurality of search target documents based on the generated hash function;
generating index information for searching summary information of each of the plurality of calculated search target documents;
An index information creation program characterized by causing a computer to execute processing.
生成した前記ハッシュ関数に基づいて複数の前記検索対象文書それぞれの要約情報を算出する算出部と、
算出した複数の前記検索対象文書それぞれの要約情報を探索する索引情報を生成する索引情報生成部と、
を有することを特徴とする索引情報作成装置。 Based on a set of words included in the search target document and inter-word information indicating the closeness of meaning of the words, for each word included in the set of words, a predetermined word is used as a reference for the word. a hash function generation unit that generates a hash function that assigns values close to each other in order of meaning;
a calculation unit that calculates summary information for each of the plurality of search target documents based on the generated hash function;
an index information generation unit that generates index information for searching for summary information of each of the plurality of calculated search target documents;
An index information creation device characterized by having:
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2019/034306 WO2021038887A1 (en) | 2019-08-30 | 2019-08-30 | Similar document retrieval method, similar document retrieval program, similar document retrieval device, index information creation method, index information creation program, and index information creation device |
Publications (3)
Publication Number | Publication Date |
---|---|
JPWO2021038887A1 JPWO2021038887A1 (en) | 2021-03-04 |
JPWO2021038887A5 JPWO2021038887A5 (en) | 2022-01-25 |
JP7193000B2 true JP7193000B2 (en) | 2022-12-20 |
Family
ID=74683387
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021541969A Active JP7193000B2 (en) | 2019-08-30 | 2019-08-30 | Similar document search method, similar document search program, similar document search device, index information creation method, index information creation program, and index information creation device |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP7193000B2 (en) |
WO (1) | WO2021038887A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022239174A1 (en) * | 2021-05-13 | 2022-11-17 | 日本電気株式会社 | Similarity degree derivation system and similarity degree derivation method |
JP2024063280A (en) * | 2022-10-26 | 2024-05-13 | 株式会社LegalOn Technologies | Information processing method, information processing program, information processing system, |
CN116302074B (en) * | 2023-05-12 | 2023-07-28 | 卓望数码技术(深圳)有限公司 | Third party component identification method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010267108A (en) | 2009-05-15 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Device, method and program for generating document signature for detecting similar document |
US20110087669A1 (en) | 2009-10-09 | 2011-04-14 | Stratify, Inc. | Composite locality sensitive hash based processing of documents |
JP2015201042A (en) | 2014-04-08 | 2015-11-12 | 日本電信電話株式会社 | Hash function generation method, hash value generation method, device, and program |
CN106156154A (en) | 2015-04-14 | 2016-11-23 | 阿里巴巴集团控股有限公司 | The search method of Similar Text and device thereof |
CN107784110A (en) | 2017-11-03 | 2018-03-09 | 北京锐安科技有限公司 | A kind of index establishing method and device |
-
2019
- 2019-08-30 JP JP2021541969A patent/JP7193000B2/en active Active
- 2019-08-30 WO PCT/JP2019/034306 patent/WO2021038887A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010267108A (en) | 2009-05-15 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Device, method and program for generating document signature for detecting similar document |
US20110087669A1 (en) | 2009-10-09 | 2011-04-14 | Stratify, Inc. | Composite locality sensitive hash based processing of documents |
JP2015201042A (en) | 2014-04-08 | 2015-11-12 | 日本電信電話株式会社 | Hash function generation method, hash value generation method, device, and program |
CN106156154A (en) | 2015-04-14 | 2016-11-23 | 阿里巴巴集团控股有限公司 | The search method of Similar Text and device thereof |
CN107784110A (en) | 2017-11-03 | 2018-03-09 | 北京锐安科技有限公司 | A kind of index establishing method and device |
Also Published As
Publication number | Publication date |
---|---|
WO2021038887A1 (en) | 2021-03-04 |
JPWO2021038887A1 (en) | 2021-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7193000B2 (en) | Similar document search method, similar document search program, similar document search device, index information creation method, index information creation program, and index information creation device | |
JP5257071B2 (en) | Similarity calculation device and information retrieval device | |
CN110399515B (en) | Picture retrieval method, device and system | |
US9436681B1 (en) | Natural language translation techniques | |
CN110472043B (en) | Clustering method and device for comment text | |
CN111985228B (en) | Text keyword extraction method, text keyword extraction device, computer equipment and storage medium | |
JP2013167666A (en) | Speech recognition device, speech recognition method, and program | |
JP6370962B1 (en) | Generating device, generating method, and generating program | |
JP7058574B2 (en) | Information processing equipment, information processing methods, and programs | |
WO2014118978A1 (en) | Learning method, image processing device and learning program | |
WO2008062822A1 (en) | Text mining device, text mining method and text mining program | |
JP2005301856A (en) | Method and program for document retrieval, and document retrieving device executing the same | |
US20210312333A1 (en) | Semantic relationship learning device, semantic relationship learning method, and storage medium storing semantic relationship learning program | |
JP4325370B2 (en) | Document-related vocabulary acquisition device and program | |
JPH11328317A (en) | Method and device for correcting japanese character recognition error and recording medium with error correcting program recorded | |
CN116932730A (en) | Document question-answering method and related equipment based on multi-way tree and large-scale language model | |
CN111460114A (en) | Retrieval method, device, equipment and computer readable storage medium | |
CN114742062B (en) | Text keyword extraction processing method and system | |
JP6232358B2 (en) | Next utterance candidate ranking apparatus, method, and program | |
CN114722188A (en) | Advertisement generation method, device and equipment based on operation data and storage medium | |
JP7131130B2 (en) | Classification method, device and program | |
CN113761206A (en) | Intelligent information query method, device, equipment and medium based on intention recognition | |
KR20220041336A (en) | Graph generation system of recommending significant keywords and extracting core documents and method thereof | |
JP6574469B2 (en) | Next utterance candidate ranking apparatus, method, and program | |
US20050154750A1 (en) | Methods and apparatus for generating automated graphics using stored graphics examples |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20211022 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211022 |
|
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: 20221108 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20221121 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7193000 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |