JP7032650B2 - Similar text search method, similar text search device and similar text search program - Google Patents
Similar text search method, similar text search device and similar text search program Download PDFInfo
- Publication number
- JP7032650B2 JP7032650B2 JP2018123365A JP2018123365A JP7032650B2 JP 7032650 B2 JP7032650 B2 JP 7032650B2 JP 2018123365 A JP2018123365 A JP 2018123365A JP 2018123365 A JP2018123365 A JP 2018123365A JP 7032650 B2 JP7032650 B2 JP 7032650B2
- Authority
- JP
- Japan
- Prior art keywords
- word
- text
- words
- utterance
- similar
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は類似テキスト検索方法、類似テキスト検索装置および類似テキスト検索プログラムに関する。 The present invention relates to a similar text search method, a similar text search device, and a similar text search program.
コンピュータによる自然言語処理として、データベースに記憶された保存テキストの中から入力テキストに類似する保存テキストを検索したいことがある。例えば、問い合わせ文のサンプルと当該サンプルに対応する返答文とをデータベースに登録しておき、入力された問い合わせ文に類似するサンプルを検索し、当該類似するサンプルに対応する返答文を出力する対話システムを構築することが考えられる。 As a natural language process by a computer, you may want to search for stored text that is similar to the input text from the stored text stored in the database. For example, a dialogue system that registers a sample of inquiry text and a response text corresponding to the sample in a database, searches for a sample similar to the input inquiry text, and outputs a response text corresponding to the similar sample. Is conceivable to build.
入力テキストに類似する保存テキストを検索する方法としては、2つのテキストの間で出現する単語の共通度を評価する方法がある。例えば、以下のような検索方法が考えられる。あるテキストに含まれる単語集合から1つのハッシュ値を算出するハッシュ関数(Min-hash関数と言うことがある)を複数個定義しておく。各ハッシュ関数は、異なる単語に対して異なる値を対応付けた対応関係をもち、ある単語集合に含まれる単語に対応する値のうち最小の値をハッシュ値として出力する。各保存テキストに対して、この複数のハッシュ関数を用いて算出された複数のハッシュ値を列挙したベクトルを予め生成しておく。入力テキストに含まれる単語集合と上記の複数のハッシュ関数から同様にベクトルを算出し、近似するベクトルをもつ保存テキストを選択する。 As a method of searching for a stored text similar to the input text, there is a method of evaluating the commonality of words appearing between the two texts. For example, the following search methods can be considered. A plurality of hash functions (sometimes called Min-hash functions) that calculate one hash value from a word set contained in a certain text are defined. Each hash function has a correspondence relationship in which different values are associated with different words, and outputs the smallest value among the values corresponding to the words included in a certain word set as a hash value. For each stored text, a vector enumerating a plurality of hash values calculated by using the plurality of hash functions is generated in advance. Similarly, a vector is calculated from the word set contained in the input text and the above-mentioned multiple hash functions, and a stored text having an approximate vector is selected.
なお、問い合わせ文に対応する返答文の候補を絞り込む質問回答サーバが提案されている。提案の質問回答サーバは、問い合わせ文から単語を抽出し、抽出した単語を含む複数のコメント文をデータベースから検索し、検索されたコメント文を複数のトピックグループに分類する。質問回答サーバは、トピックグループ毎にコメント文との類似度が閾値以上である返答文の候補をデータベースから抽出する。 A question / answer server has been proposed that narrows down the candidates for the response text corresponding to the inquiry text. The question-and-answer server of the proposal extracts words from the inquiry sentence, searches a plurality of comment sentences including the extracted words from the database, and classifies the searched comment sentences into a plurality of topic groups. The question-and-answer server extracts from the database the candidates for the answer sentence whose similarity with the comment sentence is equal to or more than the threshold value for each topic group.
また、問い合わせ文に対応する返答文を異なる検索方法を併用して検索する端末装置が提案されている。提案の端末装置は、第1の検索方法によって問い合わせ文に対応する返答文を検索し、検索された第1の返答文を音声で再生する。端末装置は、第1の返答文が再生されている間、第2の検索方法によって問い合わせ文に対応する返答文を検索し、検索された第2の返答文と第1の返答文との類似度が低い場合、第1の返答文の再生が終了した後に追加的に第2の返答文を音声で再生する。 Further, a terminal device for searching a response sentence corresponding to an inquiry sentence by using different search methods in combination has been proposed. The proposed terminal device searches for a response sentence corresponding to the inquiry sentence by the first search method, and reproduces the searched first response sentence by voice. While the first reply sentence is being played back, the terminal device searches for the reply sentence corresponding to the inquiry sentence by the second search method, and the searched second reply sentence is similar to the first reply sentence. If the degree is low, the second response sentence is additionally reproduced by voice after the reproduction of the first response sentence is completed.
また、コンテンツのハッシュ値を算出するハッシュ関数を学習するハッシュ関数生成装置が提案されている。提案のハッシュ関数生成装置は、複数のコンテンツそれぞれから特徴量を算出する。また、ハッシュ関数生成装置は、各コンテンツに付与された意味ラベルに基づいて、2つのコンテンツの組み合わせ毎に意味ラベルの相関を算出する。ハッシュ関数生成装置は、意味ラベルの相関が高いほど2つのコンテンツそれぞれの特徴量から算出されるハッシュ値が近似するように、ハッシュ関数を学習する。 Further, a hash function generation device for learning a hash function for calculating a hash value of contents has been proposed. The proposed hash function generator calculates a feature amount from each of a plurality of contents. Further, the hash function generation device calculates the correlation of the semantic label for each combination of the two contents based on the semantic label given to each content. The hash function generator learns the hash function so that the higher the correlation between the semantic labels, the closer the hash value calculated from the features of each of the two contents.
出現する単語の共通度を評価する検索方法では、内容の類似度が高いにもかかわらず異なる表現が使用されることで単語の共通度が低く評価され、検索漏れが発生することがあるという問題がある。例えば、入力テキストや保存テキストがユーザの発話メッセージである場合、話し言葉は1文が短く表現も多様であることから、入力テキストと保存テキストとの間で共通の単語が出現する確率が全体的に低くなる。その結果、入力テキストに類似する保存テキストの検索精度が低くなりやすい。 In the search method that evaluates the commonality of the words that appear, the commonality of the words is evaluated low because different expressions are used even though the similarities of the contents are high, and there is a problem that search omission may occur. There is. For example, if the input text or the stored text is a user's utterance message, the spoken language is short and has various expressions, so the overall probability that a common word will appear between the input text and the stored text is overall. It gets lower. As a result, the search accuracy of the stored text similar to the input text tends to be low.
1つの側面では、本発明は、類似するテキストの検索精度を向上させる類似テキスト検索方法、類似テキスト検索装置および類似テキスト検索プログラムを提供することを目的とする。 In one aspect, it is an object of the present invention to provide a similar text search method, a similar text search device, and a similar text search program that improve the search accuracy of similar texts.
1つの態様では、コンピュータが実行する類似テキスト検索方法が提供される。第1のテキストの入力を受け付ける。第1のテキストに含まれる2以上の第1の単語を抽出し、関連する単語のグループを示す関連語辞書を参照して、2以上の第1の単語のうち何れかのグループに属する第1の単語に対して当該グループを示す第1のダミー語を割り当てる。2以上の第1の単語および第1のダミー語を含む第1の単語集合に応じた第1の特徴情報を生成する。複数の第2のテキストそれぞれに対応して記憶された、当該第2のテキストに含まれる2以上の第2の単語および何れかの第2の単語が属するグループを示す第2のダミー語を含む第2の単語集合に応じた第2の特徴情報と、第1の特徴情報との間の比較に基づいて、第1のテキストに類似する第2のテキストを検索する。 In one aspect, a computer-executed similar text retrieval method is provided. Accepts the input of the first text. A first word belonging to any of the two or more first words by extracting two or more first words contained in the first text and referring to a related word dictionary indicating a group of related words. A first dummy word indicating the group is assigned to the word. Generates first feature information according to a first word set containing two or more first words and a first dummy word. Includes two or more second words contained in the second text and a second dummy word indicating a group to which any second word belongs, which is stored corresponding to each of the plurality of second texts. A second text similar to the first text is searched based on the comparison between the second feature information according to the second word set and the first feature information.
また、1つの態様では、記憶部と処理部とを有する類似テキスト検索装置が提供される。また、1つの態様では、類似テキスト検索プログラムが提供される。 Further, in one embodiment, a similar text search device having a storage unit and a processing unit is provided. Also, in one aspect, a similar text search program is provided.
1つの側面では、類似するテキストの検索精度が向上する。 In one aspect, the search accuracy of similar texts is improved.
以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
第1の実施の形態を説明する。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
The first embodiment will be described.
図1は、第1の実施の形態の類似テキスト検索装置の例を説明する図である。
第1の実施の形態の類似テキスト検索装置10は、入力されたテキストと類似するテキストをデータベースの中から検索する。類似テキスト検索装置10は、情報処理装置やコンピュータと呼んでもよい。また、類似テキスト検索装置10は、ユーザが操作するクライアント装置でもよいし、ネットワーク経由でアクセスされるサーバ装置でもよい。類似テキスト検索装置10は、ユーザから問い合わせテキストを受け付け返答テキストを出力する対話システムに用いられるものであってもよい。
FIG. 1 is a diagram illustrating an example of a similar text retrieval device according to the first embodiment.
The similar
類似テキスト検索装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性の半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。
The similar
記憶部11は、関連語辞書13を記憶する。関連語辞書13は、互いに関連する単語のグループを示すデータである。関連する単語は、類似する意味をもつ単語である。例えば、関連語辞書13は、「猫」と「にゃんこ」が同一のグループG1に属し、「ご飯」と「えさ」が同一のグループG2に属することを示す。
The
また、記憶部11は、テキスト15a,15bを含む複数のテキスト(第2のテキスト)に対応して、特徴情報19a,19bを含む複数の特徴情報(第2の特徴情報)を記憶する。テキスト15a,15bは、類似テキスト検索装置10に入力されるテキスト14(第1のテキスト)と照合すべき検索対象テキストであり、2以上の単語を含む文字列である。特徴情報19a,19bは、検索のためのインデックスとして使用され、テキスト15a,15bから生成される。記憶部11は、テキスト15a,15bそのものを記憶していてもよいし記憶していなくてもよい。特徴情報19a,19bは、類似テキスト検索装置10が生成してもよいし他の情報処理装置が生成してもよい。
Further, the
特徴情報19a,19bを生成する方法については後述する。なお、類似テキスト検索装置10を対話システムに用いる場合、記憶部11は、テキスト15a,15bを含む複数のテキストに対応付けて、複数の返答テキスト(第3のテキスト)を記憶してもよい。例えば、ユーザからの問い合わせテキストに最も類似する検索対象テキストが選択されると、選択された検索対象テキストに対応付けられた返答テキストが出力される。
The method for generating the
処理部12は、テキスト14の入力を受け付ける。テキスト14は、ユーザから入力される問い合わせテキストであり、2以上の単語を含む文字列である。テキスト14は、類似テキスト検索装置10に接続された入力デバイスから入力されてもよいし、他の情報処理装置からネットワーク経由で受信されてもよい。また、類似テキスト検索装置10に音声信号が入力され、音声認識により音声信号がテキスト14に変換されてもよい。
The
処理部12は、テキスト14に含まれる2以上の単語を抽出し、抽出した単語を含む単語集合16を生成する。例えば、処理部12は、テキスト14から「にゃんこ」と「えさ」を抽出し、「にゃんこ」と「えさ」を含む単語集合16を生成する。
The
また、処理部12は、関連語辞書13を参照して、テキスト14から抽出した単語のうち何れかのグループに属する単語に対して、当該グループを示すダミー語(第1のダミー語)を割り当てる。処理部12は、割り当てたダミー語を単語集合16に追加する。ダミー語は、テキスト14やテキスト15a,15bに使用されない仮想的な単語である。例えば、「にゃんこ」はグループG1に属するため、グループG1を示すダミー語「G1」が単語集合16に追加される。また、「えさ」はグループG2に属するため、グループG2を示すダミー語「G2」が単語集合16に追加される。このとき、元の単語である「にゃんこ」や「えさ」は単語集合16から削除されずに残される。
Further, the
処理部12は、テキスト14に含まれる元の単語およびダミー語を含む単語集合16から、テキスト14のインデックスに相当する特徴情報18(第1の特徴情報)を生成する。特徴情報18は、問い合わせテキストと検索対象テキストとの間で出現する単語の共通度を評価するための情報である。特徴情報18は、例えば、以下のように生成される。
The
処理部12は、異なる複数のハッシュ関数を予め用意しておく。処理部12は、複数のハッシュ関数にそれぞれ単語集合16を入力し、複数のハッシュ関数から出力された複数のハッシュ値を列挙したベクトルを特徴情報18として生成する。ハッシュ関数はMin-hash関数であってもよい。例えば、各ハッシュ関数は、単語およびダミー語それぞれに対して一意な値を対応付けた対応関係をもつ。異なるハッシュ関数は異なる対応関係をもつ。ハッシュ関数は、単語集合に含まれる単語およびダミー語に対応する値の中で最小の値をハッシュ値として出力する。例えば、「にゃんこ」、「えさ」、「G1」および「G2」を含む単語集合16から(0,1,2,2,…)といったベクトルが生成される。
The
テキスト15a,15bからも同様にして特徴情報19a,19bを生成することが可能である。テキスト15aに含まれる2以上の単語が抽出され、抽出された単語に対して関連語辞書13を参照してダミー語(第2のダミー語)が割り当てられ、テキスト15aに含まれる元の単語およびダミー語を含む単語集合17aが生成される。そして、単語集合17aから特徴情報19aが生成される。例えば、単語集合17aを複数のハッシュ関数に入力することで算出された複数のハッシュ値を列挙したベクトルが生成される。また、テキスト15bに含まれる2以上の単語が抽出され、抽出された単語に対して関連語辞書13を参照してダミー語が割り当てられ、テキスト15bに含まれる元の単語およびダミー語を含む単語集合17bが生成される。そして、単語集合17bから特徴情報19bが生成される。例えば、単語集合17bを複数のハッシュ関数に入力することで算出された複数のハッシュ値を列挙したベクトルが生成される。
It is possible to generate
例えば、テキスト15aから「猫」と「ご飯」が抽出され、「猫」が属するグループG1を示すダミー語「G1」が追加され、「ご飯」が属するグループG2を示すダミー語「G2」が追加される。そして、「猫」、「ご飯」、「G1」および「G2」を含む単語集合17aから(0,0,2,2,…)といったベクトルが生成される。また、テキスト15bから「メール」と「会議」が抽出され、「メール」が属するグループG3を示すダミー語「G3」が追加され、「会議」が属するグループG4を示すダミー語「G4」が追加される。そして、「メール」、「会議」、「G3」および「G4」を含む単語集合17bから(4,4,5,5,…)といったベクトルが生成される。
For example, "cat" and "rice" are extracted from the
処理部12は、特徴情報18と特徴情報19a,19bとの間の比較に基づいて、テキスト15a,15bなどの検索対象テキストの中からテキスト14に類似するテキストを検索する。例えば、処理部12は、特徴情報19a,19bなどの検索対象テキストに対応する特徴情報の中から特徴情報18に最も近似する特徴情報を検索する。特徴情報18がハッシュ値のベクトルである場合、近似する特徴情報は、例えば、一致するハッシュ値の個数が最も多いベクトルである。処理部12は、所定の近傍探索アルゴリズムによって最も近似する特徴情報を探索してもよい。例えば、処理部12は、検索対象テキストに対応するベクトルから生成された二分探索用の探索木を記憶部11に予め記憶しておき、探索木を辿ることで特徴情報18に最も近似するベクトルを探索してもよい。
The
例えば、特徴情報18がベクトル(0,1,2,2,…)であり、特徴情報19aがベクトル(0,0,2,2,…)であり、特徴情報19bがベクトル(4,4,5,5,…)であるとする。この場合、特徴情報18は特徴情報19bよりも特徴情報19aに近いため、テキスト14はテキスト15bよりもテキスト15aに類似することになる。
For example, the
処理部12は、テキスト14に類似するテキスト15aを出力してもよい。例えば、処理部12は、類似テキスト検索装置10に接続されたティスプレイにテキスト15aを表示させるなど、出力デバイスにテキスト15aを出力してもよいし、他の情報処理装置にテキスト15aを送信してもよい。また、処理部12は、テキスト15aに対応付けられた返答テキストを、ディスプレイに表示させるなど出力デバイスに出力してもよいし、他の情報処理装置に送信してもよい。また、処理部12は、テキスト15aに対応付けられた返答テキストを音声信号に変換して音声として再生してもよい。
The
ここで、テキスト15aはテキスト14に含まれる単語と近い意味をもつ関連語を含んでおり、テキスト14とテキスト15aはある程度類似していると言える。しかし、テキスト14に含まれる単語とテキスト15aに含まれる単語の共通度を単純に評価した場合、共通する単語が存在しないためテキスト15aはテキスト14と類似しないと判定されるおそれがある。また、関連語を単純に同一単語とみなした場合、テキスト14とテキスト15aは使用している表現が異なるにもかかわらず、表現が同一であるテキストと同一視されてしまい、類似度が過大評価されるおそれがある。
Here, the
これに対して、類似テキスト検索装置10は、テキスト14に含まれる元の単語に加えて、元の単語に対応する関連語のグループを示すダミー語を単語集合16に追加し、単語集合16から特徴情報18を生成する。また、テキスト15aに含まれる元の単語に加えて、元の単語に対応する関連語のグループを示すダミー語が単語集合17aに追加され、単語集合17aから特徴情報19aが生成される。
On the other hand, the similar
よって、テキスト14に含まれる単語とテキスト15aに含まれる単語が同一でなくても、両者の意味的な近さが評価される。また、単語集合16,17aの中に元の単語が残っているため、使用している表現の違いも評価される。すなわち、テキスト14とテキスト15aがある程度類似していることを特徴情報18,19aによって表現することができる。その結果、類似するテキストの検索精度が向上する。また、単語集合16から生成された特徴情報18と単語集合17aから生成された特徴情報19aの間の比較によって類似テキストを検索でき、類似テキスト検索の速度を向上させることができる。
Therefore, even if the word contained in the
[第2の実施の形態]
次に、第2の実施の形態を説明する。
第2の実施の形態の情報処理装置100は、ユーザから問い合わせ発話を受け付け、問い合わせ発話に対応する適切な返答発話を出力する対話システムに使用される。情報処理装置100は、クライアント装置であってもよいしサーバ装置であってもよい。
[Second Embodiment]
Next, a second embodiment will be described.
The
図2は、情報処理装置のハードウェア例を示すブロック図である。
情報処理装置100は、バスに接続されたCPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107を有する。情報処理装置100は、第1の実施の形態の類似テキスト検索装置10に対応する。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。
FIG. 2 is a block diagram showing a hardware example of the information processing apparatus.
The
CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。なお、CPU101は複数のプロセッサコアを備えてもよく、情報処理装置100は複数のプロセッサを備えてもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。
The
RAM102は、CPU101が実行するプログラムやCPU101が演算に使用するデータを一時的に記憶する揮発性の半導体メモリである。なお、情報処理装置100は、RAM以外の種類のメモリを備えてもよく、複数のメモリを備えてもよい。
The
HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性の記憶装置である。なお、情報処理装置100は、フラッシュメモリやSSD(Solid State Drive)など他の種類の記憶装置を備えてもよく、複数の記憶装置を備えてもよい。
The
画像信号処理部104は、CPU101からの命令に従って、情報処理装置100に接続されたディスプレイ104aに画像を出力する。ディスプレイ104aとしては、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、有機EL(OEL:Organic Electro-Luminescence)ディスプレイなど、任意の種類のディスプレイを使用することができる。
The image
入力信号処理部105は、情報処理装置100に接続された入力デバイス105aから入力信号を受信する。入力デバイス105aとして、マウス、タッチパネル、タッチパッド、キーボードなど、任意の種類の入力デバイスを使用できる。また、情報処理装置100に複数の種類の入力デバイスが接続されてもよい。
The input
媒体リーダ106は、記録媒体106aに記録されたプログラムやデータを読み取る読み取り装置である。記録媒体106aとして、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)、半導体メモリなどを使用できる。媒体リーダ106は、例えば、記録媒体106aから読み取ったプログラムやデータをRAM102またはHDD103に格納する。
The
通信インタフェース107は、ネットワーク107aに接続され、ネットワーク107aを介して他の情報処理装置と通信を行うインタフェースである。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースでもよいし、基地局やアクセスポイントに接続される無線通信インタフェースでもよい。
The
次に、問い合わせ発話から返答発話を決定する方法について説明する。
図3は、発話テーブルの例を示す図である。
情報処理装置100は、問い合わせと返答のサンプルを多数蓄積したデータベースとして、発話テーブル141を保持する。発話テーブル141は、発話ID、検索対象発話および返答発話の項目を含む。発話IDは、検索対象発話を識別する識別子である。
Next, a method of determining a response utterance from an inquiry utterance will be described.
FIG. 3 is a diagram showing an example of an utterance table.
The
検索対象発話は、問い合わせ発話のサンプルである。検索対象発話は、ユーザが口頭で発することがある文を示す文字列であり、2以上の単語を含むテキストである。検索対象発話は、比較的短い1つの文または少数の文によって構成される。返答発話は、検索対象発話に対応付けられている。ある検索対象発話に類似する問い合わせ発話が入力されたとき、当該検索対象発話に対応付けられた返答発話が出力される。返答発話は、ユーザに対して伝達されることがある文を示す文字列であり、2以上の単語を含むテキストである。返答発話は、比較的短い1つの文または少数の文によって構成される。 The search target utterance is a sample of inquiry utterances. The search target utterance is a character string indicating a sentence that the user may verbally utter, and is a text containing two or more words. The utterance to be searched is composed of one relatively short sentence or a small number of sentences. The reply utterance is associated with the search target utterance. When an inquiry utterance similar to a certain search target utterance is input, the response utterance associated with the search target utterance is output. The reply utterance is a character string indicating a sentence that may be transmitted to the user, and is a text containing two or more words. Response utterances consist of one relatively short sentence or a small number of sentences.
例えば、情報処理装置100は、ユーザが口頭で発した問い合わせ発話を示す音声信号を受信し、音声認識により音声信号をテキストの問い合わせ発話に変換する。情報処理装置100は、テキストの問い合わせ発話に類似する検索対象発話を判定し、判定した検索対象発話に対応する返答発話を選択する。情報処理装置100は、テキストの返答発話を音声信号に変換して音声として返答発話を再生する。
For example, the
次に、問い合わせ発話に類似する検索対象発話を探索する探索方法について説明する。情報処理装置100は、Min-hash関数を用いて発話間の出現単語の共通度を評価する。
図4は、ハッシュ関数およびベクトルの例を示す図である。
Next, a search method for searching for a search target utterance similar to the inquiry utterance will be described. The
FIG. 4 is a diagram showing an example of a hash function and a vector.
一例として、情報処理装置100は、問い合わせ発話31を受け付ける。また、発話テーブル141に検索対象発話32,33が登録されている。また、情報処理装置100は、Min-hash関数であるハッシュ関数34~36を保持している。
As an example, the
問い合わせ発話31は、単語として「大谷」、「LA」、「盗塁」、「メジャー」、「ボール」および「本塁打」を含む。検索対象発話32は、単語として「松井」、「NY」、「三振」、「メジャー」、「ボール」および「本塁打」を含む。検索対象発話33は、単語として「大谷」、「三振」、「太刀」、「戦国時代」、「関ヶ原」および「切腹」を含む。情報処理装置100は、問い合わせ発話31を受け付けたとき、ハッシュ関数34~36を用いて問い合わせ発話31からベクトル37を生成する。また、情報処理装置100は、ハッシュ関数34~36を用いて検索対象発話32から予めベクトル38を生成して保持しておく。また、情報処理装置100は、ハッシュ関数34~36を用いて検索対象発話33から予めベクトル39を生成して保持しておく。
The inquiry utterance 31 includes the words "Otani", "LA", "stolen base", "major", "ball" and "home run". The
ハッシュ関数34~36は、1つの問い合わせ発話または1つの検索対象発話に含まれる1つの単語集合から1つのハッシュ値を算出するMin-hash関数である。ハッシュ関数34~36はそれぞれ、異なる単語に対して異なる整数を対応付けた対応関係をもつ。異なるハッシュ関数は異なる対応関係をもっている。例えば、情報処理装置100は、検索対象発話32,33に出現し得る複数の単語をランダムに整列し、単語の列に対して0,1,2,…と連続する非負整数を割り当てることで、1つのハッシュ関数を生成する。ただし、複数の単語に対して不連続な整数を割り当てるようにしてもよい。
Hash functions 34 to 36 are Min-hash functions that calculate one hash value from one word set included in one inquiry utterance or one search target utterance. Each of the hash functions 34 to 36 has a correspondence relationship in which different integers are associated with different words. Different hash functions have different correspondences. For example, the
例えば、ハッシュ関数34は、「メジャー」に整数0、「戦国時代」に整数1、「野球」に整数2を割り当てている。ハッシュ関数35は、「切腹」に整数0、「歴史」に整数1、「本塁打」に整数2を割り当てている。ハッシュ関数36は、「NY」に整数0、「LA」に整数1、「関ヶ原」に整数2を割り当てている。ハッシュ関数34~36はそれぞれ、単語集合に含まれる2以上の単語に対応する2以上の整数の中から、最小の整数を選択し、選択した最小の整数をハッシュ値として出力する。
For example, the
ベクトル37は、問い合わせ発話31の単語集合をハッシュ関数34~36に入力することで算出された3つのハッシュ値を列挙した整数ベクトルである。問い合わせ発話31に対して、ハッシュ関数34は「メジャー」に対応する整数0を出力し、ハッシュ関数35は「本塁打」に対応する整数2を出力し、ハッシュ関数36は「LA」に対応する整数1を出力する。よって、ベクトル37は(0,2,1)となる。
The
ベクトル38は、検索対象発話32の単語集合をハッシュ関数34~36に入力することで算出された3つのハッシュ値を列挙した整数ベクトルである。検索対象発話32に対して、ハッシュ関数34は「メジャー」に対応する整数0を出力し、ハッシュ関数35は「本塁打」に対応する整数2を出力し、ハッシュ関数36は「NY」に対応する整数0を出力する。よって、ベクトル38は(0,2,0)となる。
The
ベクトル39は、検索対象発話33の単語集合をハッシュ関数34~36に入力することで算出された3つのハッシュ値を列挙した整数ベクトルである。検索対象発話33に対して、ハッシュ関数34は「戦国時代」に対応する整数1を出力し、ハッシュ関数35は「切腹」に対応する整数0を出力し、ハッシュ関数36は「関ヶ原」に対応する整数2を出力する。よって、ベクトル38は(1,0,2)となる。
The
情報処理装置100は、ベクトル37とベクトル38を比較することで、問い合わせ発話31と検索対象発話32の類似度を評価することができる。類似度は、ベクトル37,38の次元のうち整数が一致する次元の個数で表現される。ここでは、整数が一致しているか否かが重要であり、整数が異なる場合は整数の近さは重要でない。ベクトル37とベクトル38の間では、3次元のうち2次元で整数が一致している。同様に、情報処理装置100は、ベクトル37とベクトル39を比較することで、問い合わせ発話31と検索対象発話33の類似度を評価することができる。ベクトル37とベクトル39の間では、3次元のうち1つの次元でも整数が一致していない。よって、問い合わせ発話31は、検索対象発話33よりも検索対象発話32に類似していると判定できる。
The
任意のハッシュ関数が1つの問い合わせ発話と1つの検索対象発話に対して同一のハッシュ値を出力する確率は、問い合わせ発話の単語集合と検索対象発話の単語集合の間で共通する単語が出現する割合に一致する。共通する単語の割合をジャッカール係数と言うことがある。よって、異なるハッシュ関数が算出した複数のハッシュ値のうち一致するハッシュ値の割合を、ジャッカール係数の近似値として用いることが可能である。多数の検索対象発話に対応するベクトルを予め算出しておけば、受け付けた問い合わせ発話に類似する検索対象発話を高速に検索することが可能である。 The probability that any hash function will output the same hash value for one query utterance and one search target utterance is the rate at which a common word appears between the query utterance word set and the search target utterance word set. Matches. The ratio of common words is sometimes called the Jackal coefficient. Therefore, it is possible to use the ratio of matching hash values among a plurality of hash values calculated by different hash functions as an approximate value of the Jackal coefficient. If the vectors corresponding to a large number of search target utterances are calculated in advance, it is possible to search for search target utterances similar to the received inquiry utterances at high speed.
例えば、問い合わせ発話31と検索対象発話32の間では、重複を除去した9個の単語(9種類の単語)のうち3個の単語が共通しているため、ジャッカール係数は0.33となる。また、問い合わせ発話31と検索対象発話33の間では、重複を除去した11個の単語のうち1個の単語が共通しているため、ジャッカール係数は0.09となる。よって、ベクトル間で一致するハッシュ値の割合はジャッカール係数に近似している。
For example, between the inquiry utterance 31 and the
情報処理装置100は、多数の検索対象発話に対応する多数のベクトルの中から、問い合わせ発話に対応するベクトルと最も一致度が高い1つのベクトルまたは一致度が高い少数のベクトルを検索できればよい。そこで、情報処理装置100は、二分探索木を用いた近傍探索によって1つまたは少数のベクトルを探索する。
The
図5は、探索木の例を示す図である。
情報処理装置100は、発話テーブル141に登録された検索対象発話から生成されたベクトルに基づいて、予め探索木142を生成して保持しておく。探索木142は、木構造に接続された複数のノードを含む。葉ノード以外の各ノードには2つの子ノードが接続されている。葉ノード以外の各ノードは、ベクトルの中の特定の次元に対する閾値をもつ。入力されたベクトルの中の特定の次元のハッシュ値が閾値以上である場合は右子ノードに進み、特定の次元のハッシュ値が閾値未満である場合は左子ノードに進む。このようにして、探索木142をルートノードから葉ノードに向かって辿る。
FIG. 5 is a diagram showing an example of a search tree.
The
例えば、図5の例では、ルートノードは1次元目に対する閾値として10をもつ。このため、1次元目のハッシュ値が10以上であるベクトルが入力された場合はルートノードから右子ノードに進むことになり、1次元目のハッシュ値が10未満であるベクトルが入力された場合はルートノードから左子ノードに進むことになる。 For example, in the example of FIG. 5, the root node has 10 as a threshold value for the first dimension. Therefore, if a vector having a hash value of 10 or more in the first dimension is input, the process proceeds from the root node to the right child node, and if a vector having a hash value of less than 10 in the first dimension is input. Will go from the root node to the left child node.
探索木142の葉ノードは、検索対象発話を指し示す。例えば、葉ノードは、検索対象発話のベクトルと当該検索対象発話を識別する発話IDとを含む。ただし、葉ノードがベクトルを含まなくてもよい。2以上の検索対象発話のベクトルが互いに近似している場合、1つの葉ノードに2以上の検索対象発話が対応付けられることもある。ただし、検索対象発話を効率的に絞り込むため、1つの葉ノードは1つまたは少数の検索対象発話を指し示すことが好ましい。なお、探索木142の葉ノードはルートノードからの深さが同一でなくてもよく、探索に全ての次元のハッシュ値が使用されなくてもよい。 The leaf node of the search tree 142 points to the utterance to be searched. For example, the leaf node contains a vector of search target utterances and an utterance ID that identifies the search target utterance. However, the leaf node does not have to contain the vector. When the vectors of two or more search target utterances are close to each other, one leaf node may be associated with two or more search target utterances. However, in order to efficiently narrow down the search target utterances, it is preferable that one leaf node points to one or a small number of search target utterances. The leaf nodes of the search tree 142 do not have to have the same depth from the root node, and hash values of all dimensions may not be used for the search.
次に、問い合わせ発話と検索対象発話が、同一の単語を含まないものの関連する単語を含んでいる場合の問題について説明する。問い合わせ発話および検索対象発話は、話し言葉を用いた短文であるため、同一または類似の事象を多様な単語で表現することができ、問い合わせ発話と検索対象発話の間に同一の単語が出現する確率が全体的に低い。よって、単純に単語の共通度を評価する方法では、関連語を使用する問い合わせ発話と検索対象発話の間の類似度が適切に評価されないという問題がある。 Next, the problem when the inquiry utterance and the search target utterance do not contain the same word but contain related words will be described. Since the inquiry utterance and the search target utterance are short sentences using spoken words, the same or similar events can be expressed by various words, and the probability that the same word appears between the inquiry utterance and the search target utterance is high. Overall low. Therefore, in the method of simply evaluating the commonality of words, there is a problem that the similarity between the inquiry utterance using the related word and the search target utterance is not appropriately evaluated.
図6は、ジャッカール係数の算出例を示す図である。
(A)問い合わせ発話41は、単語として「猫」および「ご飯」を含む。検索対象発話42は、単語として「にゃんこ」および「えさ」を含む。「猫」と「にゃんこ」は類似する意味をもつ関連語であり、「ご飯」と「えさ」は類似する意味をもつ関連語である。しかし、単純に単語の同一性に基づきジャッカール係数を算出すると、問い合わせ発話41と検索対象発話42は同一の単語を含まないため、ジャッカール係数が0.00となる。このため、問い合わせ発話41と検索対象発話42は類似する内容を表している可能性が高いにもかかわらず、類似度が非常に低く判定されてしまう。
FIG. 6 is a diagram showing a calculation example of the Jackal coefficient.
(A) The
(B)問い合わせ発話43は、単語として「猫」および「ご飯」を含む。検索対象発話44は、単語として「にゃんこ」および「えさ」を含む。ここで、検索対象発話44の「にゃんこ」は「猫」の関連語であるため、「にゃんこ」を「猫」と同一の単語であるとみなすとする。また、検索対象発話44の「えさ」は「ご飯」の関連語であるため、「えさ」を「ご飯」と同一の単語であるとみなすとする。すると、問い合わせ発話43と検索対象発話44の間のジャッカール係数が1.00と算出される。しかし、問い合わせ発話43と検索対象発話44は異なる表現を使用しているため、類似度が過大評価されており、問い合わせ発話43と同一の表現を使用する他の検索対象発話との区別が困難となる。
(B) The inquiry utterance 43 includes "cat" and "rice" as words. The
そこで、第2の実施の形態では以下のようにして類似度を評価する。
(C)問い合わせ発話45は、単語として「猫」および「ご飯」を含む。検索対象発話46は、単語として「にゃんこ」および「えさ」を含む。「猫」と「にゃんこ」が同一の関連語グループに属し、「ご飯」と「えさ」が同一の関連語グループに属する。
Therefore, in the second embodiment, the degree of similarity is evaluated as follows.
(C) The inquiry utterance 45 includes "cat" and "rice" as words. The
すると、「猫」が属する関連語グループに対応する仮想語s1を問い合わせ発話45の単語集合に追加し、「ご飯」が属する関連語グループに対応する仮想語s2を問い合わせ発話45の単語集合に追加する。仮想語は問い合わせ発話や検索対象発話に出現しない仮想的な単語であり、ダミー語やラベルと言うこともできる。「猫」および「ご飯」を残したまま仮想語s1,s2が追加される。また、「にゃんこ」が属する関連語グループに対応する仮想語s1を検索対象発話46の単語集合に追加し、「えさ」が属する関連語グループに対応する仮想語s2を検索対象発話46の単語集合に追加する。「にゃんこ」および「えさ」を残したまま仮想語s1,s2が追加される。
Then, the virtual word s 1 corresponding to the related word group to which "cat" belongs is added to the word set of the inquiry utterance 45, and the virtual word s 2 corresponding to the related word group to which "rice" belongs is added to the word set of the inquiry utterance 45. Add to. A virtual word is a virtual word that does not appear in inquiry utterances or search target utterances, and can also be called a dummy word or a label. Virtual words s 1 and s 2 are added while leaving "cat" and "rice". Further, the virtual word s 1 corresponding to the related word group to which "Nyanko" belongs is added to the word set of the
仮想語が追加された問い合わせ発話45の単語集合と、仮想語が追加された検索対象発話46の単語集合とを比較すると、6種類の単語のうち2種類の単語が共通するため、ジャッカール係数は0.33と算出される。このように算出したジャッカール係数を、第2の実施の形態では拡張ジャッカール係数と言うことがある。拡張ジャッカール係数は、単語間の関連性(意味の類似性)を無視する場合のジャッカール係数よりも大きくなる。また、単語集合に元の単語を残したまま仮想語を追加するため、拡張ジャッカール係数は、関連語を同一視する場合のジャッカール係数よりも小さくなる。よって、異なる表現を使用する問い合わせ発話と検索対象発話の間の類似性を適切に評価することができる。
Comparing the word set of the inquiry utterance 45 to which the virtual word is added and the word set of the
情報処理装置100は、仮想語も独立した単語として取り扱って複数のハッシュ関数を生成しておく。情報処理装置100は、発話テーブル141に登録された検索対象発話から、仮想語を追加した単語集合を生成してハッシュ関数に入力し、仮想語の影響を反映したベクトルを算出する。情報処理装置100は、仮想語の影響を反映したベクトルから探索木142を生成する。問い合わせ発話が入力されると、情報処理装置100は、問い合わせ発話から、仮想語を追加した単語集合を生成してハッシュ関数に入力し、仮想語の影響を反映したベクトルを算出する。情報処理装置100は、探索木142を用いて、問い合わせ発話のベクトルに近似する検索対象発話のベクトルを探す。このように、情報処理装置100は、ハッシュ関数と単語集合を拡張することで、関連語を考慮しない探索方法を流用して高速に類似の検索対象発話を検索することができる。
The
図7は、類似度の閾値と検索対象発話のヒット数との関係例を示すグラフである。
グラフ50は、問い合わせ発話と検索対象発話の類似度の閾値と、類似度が閾値より大きい検索対象発話の数(ヒット数)との間の関係を示す。類似度は、問い合わせ発話のベクトルと検索対象発話のベクトルの間でハッシュ値が一致する次元の数である。
FIG. 7 is a graph showing an example of the relationship between the threshold value of similarity and the number of hits of the utterance to be searched.
The
(A)関連語を考慮せずにベクトルを算出する方法では、問い合わせ発話と各検索対象発話の類似度が全体として低く算出される。よって、類似度の閾値とヒット数との間の関係は曲線51のようになる。すなわち、類似度の閾値を低く設定してもヒット数が少なくなり、類似する検索対象発話の検索漏れが多くなる。
(A) In the method of calculating the vector without considering the related words, the similarity between the inquiry utterance and each search target utterance is calculated to be low as a whole. Therefore, the relationship between the threshold of similarity and the number of hits is as shown in the
(B)関連語を同一視してベクトルを算出する方法では、問い合わせ発話と各検索対象発話の類似度が全体として高く算出される。よって、類似度の閾値とヒット数との間の関係は曲線52のようになる。すなわち、類似度の閾値を高く設定してもヒット数が多くなり、類似する検索対象発話を効率的に絞り込むことが難しい。
(B) In the method of equating related words and calculating the vector, the similarity between the inquiry utterance and each search target utterance is calculated to be high as a whole. Therefore, the relationship between the threshold of similarity and the number of hits is as shown in the
(C)元の単語を残しつつ関連語グループを示す仮想語を追加してベクトルを算出する方法では、問い合わせ発話と各検索対象発話の類似度が上記2つの方法の中間の値をとる。よって、類似度の閾値とヒット数との間の関係は曲線53のようになる。仮想語が追加されることで、一致するハッシュ値の個数が若干増える。一方、元の単語が残っているため、一致するハッシュ値の個数が増え過ぎることを抑制できる。その結果、問い合わせ発話に類似する検索対象発話を効率的に絞り込むことができる。
(C) In the method of calculating the vector by adding a virtual word indicating a related word group while keeping the original word, the similarity between the inquiry utterance and each search target utterance takes an intermediate value between the above two methods. Therefore, the relationship between the threshold of similarity and the number of hits is as shown in
関連語グループは予め定義されている。
図8は、関連語テーブルの例を示す図である。
情報処理装置100は、関連語テーブル143を保持している。関連語テーブル143は、関連語辞書と言うこともできる。関連語テーブル143は、グループIDおよび関連語の項目を含む。グループIDは、関連語グループを識別する識別子である。1つ関連語グループに対して1つの仮想語が割り当てられる。関連語の項目には、同一の関連語グループに属する2以上の単語が列挙される。同一の関連語グループに属する単語は、類似する意味として使用されることがある単語である。
Related word groups are predefined.
FIG. 8 is a diagram showing an example of a related word table.
The
「猫」および「にゃんこ」は同一の関連語グループに属する。そこで、例えば、情報処理装置100は、「猫」および「にゃんこ」に同一の仮想語s1を割り当てる。また、「ご飯」および「えさ」は同一の関連語グループに属する。そこで、例えば、情報処理装置100は、「ご飯」および「えさ」に同一の仮想語s2を割り当てる。
"Cat" and "Nyanko" belong to the same related word group. Therefore, for example, the
なお、関連語テーブル143に登録されていない単語は、何れの関連語グループにも属さず、関連する他の単語をもたない。後述するように、第2の実施の形態では、関連語が存在しない単語に対しても一意な仮想語を追加してハッシュ値を算出する。これは、関連語が存在しない単語集合からは同一のジャッカール係数と拡張ジャッカール係数とが算出されるようにし、ジャッカール係数と拡張ジャッカール係数の整合性を維持するためである。ただし、関連語が存在しない単語に対して仮想語を割り当てないことも可能である。その場合であっても、拡張ジャッカール係数は、関連語を考慮しない場合のジャッカール係数以上の値をとり、関連語を同一視する場合のジャッカール係数以下の値をとる。 A word not registered in the related word table 143 does not belong to any related word group and has no other related words. As will be described later, in the second embodiment, a unique virtual word is added to a word for which a related word does not exist, and a hash value is calculated. This is to ensure that the same Jackal coefficient and extended Jackal coefficient are calculated from a word set in which no related word exists, and to maintain the consistency between the Jackal coefficient and the extended Jackal coefficient. However, it is also possible not to assign a virtual word to a word that does not have a related word. Even in that case, the extended Jackal coefficient takes a value equal to or higher than the Jackal coefficient when the related words are not considered, and a value equal to or lower than the Jackal coefficient when the related words are equated.
ここで、ジャッカール係数やハッシュ関数の数学的側面について説明する。
第2の実施の形態で使用するハッシュ関数はMin-hash関数であり、単語集合を整数に変換する写像である。複数のハッシュ関数によって近似するベクトルが生成される問い合わせ発話と検索対象発話は、共通する単語の出現割合が高い発話である。一方の発話(例えば、1つの検索対象発話)の単語集合をA、他方の発話(例えば、問い合わせ発話)の単語集合をBとすると、ジャッカール係数は数式(1)のように定義される。単語集合A,Bは出現する単語の種類を示し、同じ単語が2回以上出現しても重複カウントしない。
Here, the mathematical aspects of the Jackal coefficient and the hash function will be described.
The hash function used in the second embodiment is a Min-hash function, which is a mapping that converts a word set into an integer. The inquiry utterance and the search target utterance in which a vector to be approximated by a plurality of hash functions are generated are utterances in which the appearance rate of a common word is high. Assuming that the word set of one utterance (for example, one search target utterance) is A and the word set of the other utterance (for example, inquiry utterance) is B, the Jackal coefficient is defined as in the mathematical formula (1). The word sets A and B indicate the types of words that appear, and even if the same word appears more than once, they are not counted twice.
1つのハッシュ関数のハッシュ値が2つのベクトルの間で一致している場合、当該ハッシュ値に対応する単語が両方の発話に出現している。一致していない場合、小さい方のハッシュ値に対応する単語が一方の発話にのみ出現している。前述のように、1つのハッシュ関数のハッシュ値が一致する確率はジャッカール係数に等しいため、複数のハッシュ関数についての一致割合によってジャッカール係数を近似できる。単語集合A,Bに含まれる単語の数に依存しない所定回数のハッシュ値計算によって近似値が得られる。 When the hash value of one hash function matches between two vectors, the word corresponding to the hash value appears in both utterances. If they do not match, the word corresponding to the smaller hash value appears in only one utterance. As described above, since the probability that the hash values of one hash function match is equal to the Jackal coefficient, the Jackal coefficient can be approximated by the matching ratio for a plurality of hash functions. An approximate value can be obtained by a predetermined number of hash value calculations that do not depend on the number of words included in the word sets A and B.
nを検索対象発話の数、mを発話1つ当たりの平均の単語数、kをハッシュ関数の数とする。すると、予め検索対象発話のベクトルを計算する計算量はO(kmn)となる。1つの問い合わせ発話のベクトルを計算する計算量はO(km)となり、このベクトルを用いた近傍探索の計算コストはO(log(n))となる。ハッシュ関数は予めランダムにk個生成される。kをO(log(n))とすると、異なる検索対象発話から同一のハッシュ値が算出される衝突確率を十分に小さくすることができる。 Let n be the number of utterances to be searched, m be the average number of words per utterance, and k be the number of hash functions. Then, the amount of calculation for calculating the vector of the utterance to be searched in advance is O (kmn). The amount of calculation for calculating the vector of one inquiry utterance is O (km), and the calculation cost of the neighborhood search using this vector is O (log (n)). K hash functions are randomly generated in advance. When k is O (log (n)), the collision probability in which the same hash value is calculated from different search target utterances can be sufficiently reduced.
これに対して、ジャッカール係数とハッシュ関数を拡張する。単語集合A,Bの中に関連語が存在しない場合、拡張ジャッカール係数はジャッカール係数に等しい。関連語が存在する場合、拡張ジャッカール係数は、関連語を異なる単語とみなした際のジャッカール係数よりも大きく、関連語を同一単語とみなした際のジャッカール係数よりも小さい。ハッシュ値の一致確率が拡張ジャッカール係数に等しくなるように、単語集合A,Bに仮想語を追加すると共に、仮想語に対しても整数を割り当てるようハッシュ関数を拡張する。 On the other hand, the Jackal coefficient and hash function are extended. If there are no related words in the word sets A and B, the extended Jackal coefficient is equal to the Jackal coefficient. If a related word is present, the extended Jackal coefficient is greater than the Jackal coefficient when the related word is regarded as a different word and smaller than the Jacker coefficient when the related word is regarded as the same word. A virtual word is added to the word sets A and B so that the matching probability of the hash value is equal to the extended Jackal coefficient, and the hash function is expanded so that an integer is also assigned to the virtual word.
検索対象発話に出現し得る単語の集合をWとし、単語集合Wに含まれない仮想語の集合をW’とする。単語集合Wに属する任意の単語aに対して、仮想語集合W’に属する一意な仮想語siが割り当てられる。同一の関連語グループに属する単語に対しては同一の仮想語が割り当てられる。何れの関連語グループにも属さない単語に対しては、他の単語に対して使用されない仮想語が割り当てられる。数式(2)に示す関数fはWからW×W’への写像であり、1つの単語から当該単語と仮想語の組を返す。 Let W be a set of words that can appear in the search target utterance, and let W'be a set of virtual words that are not included in the word set W. A unique virtual word s i belonging to the virtual word set W'is assigned to any word a belonging to the word set W. The same virtual word is assigned to words that belong to the same related word group. Words that do not belong to any related word group are assigned virtual words that are not used for other words. The function f shown in the mathematical formula (2) is a mapping from W to W × W', and returns a set of the word and a virtual word from one word.
拡張ジャッカール係数J’は、ジャッカール係数Jの定義および関数fを用いて数式(3)のように定義される。関数fによって、単語集合Aに含まれる各単語に対応する仮想語が単語集合Aに挿入され、単語集合Bに含まれる各単語に対応する仮想語が単語集合Bに挿入される。そして、仮想語を挿入した単語集合に対してジャッカール係数Jを算出したものが拡張ジャッカール係数J’となる。元の単語集合A,Bに関連語が含まれない場合、J’(A,B)=J(A,B)である。 The extended Jackal coefficient J'is defined as in the equation (3) using the definition of the Jackal coefficient J and the function f. By the function f, the virtual word corresponding to each word included in the word set A is inserted into the word set A, and the virtual word corresponding to each word included in the word set B is inserted into the word set B. Then, the extended Jackal coefficient J'is obtained by calculating the Jackal coefficient J for the word set into which the virtual word is inserted. If the original word sets A and B do not contain related words, then J'(A, B) = J (A, B).
ハッシュ関数を拡張するにあたり、ハッシュ関数毎に数式(4)のように関数h’を定義する。関数hは、単語集合Wに属する単語aを整数nに変換するものであり、拡張前のハッシュ関数で使用される。整数の集合をNとすると、関数hはWからNへの写像である。関数h’は、単語集合Wに属する単語aまたは仮想語集合W’に属する仮想語aを整数nに変換するものであり、拡張後のハッシュ関数で使用される。nを整数集合Nの中の任意の整数とし、N’={n+maxN+1}とすると、関数h’はW∪W’からN∪N’への写像である。整数集合N’は、関数hの値域である整数集合Nを2倍に拡張したときの拡張部分を示している。これは、仮想語集合W’のサイズは単語集合Wのサイズ以下であるためである。関数eは、仮想語集合W’に属する仮想語aを単語集合Wに属する単語に変換するものであり、W’からWへの単射である。関数gは、単語または仮想語と整数との対応関係を入れ替えるものであり、N∪N’からN∪N’への全単射である。 In extending the hash function, the function h'is defined for each hash function as in the equation (4). The function h converts the word a belonging to the word set W into an integer n, and is used in the hash function before expansion. Assuming that the set of integers is N, the function h is a mapping from W to N. The function h'converts a word a belonging to the word set W or a virtual word a belonging to the virtual word set W'to an integer n, and is used in the expanded hash function. If n is an arbitrary integer in the integer set N and N'= {n + maxN + 1}, then the function h'is a mapping from W∪W'to N∪N'. The integer set N'shows an extended portion when the integer set N, which is the range of the function h, is expanded twice. This is because the size of the virtual word set W'is smaller than or equal to the size of the word set W. The function e converts the virtual word a belonging to the virtual word set W'to a word belonging to the word set W, and is an injective function from W'to W. The function g swaps the correspondence between a word or virtual word and an integer, and is a bijection from N∪N'to N∪N'.
すなわち、情報処理装置100は、ハッシュ関数を拡張するにあたり、既存の単語に割り当てられた整数よりも大きい整数を仮想語に割り当てる。仮想語に割り当てる整数は関数e,hを用いて決定される。ある仮想語aから関数eによって一意な既存の単語が選択され、関数hによってその単語に対応付けられた整数h(e(a))に、関数hの値域の最大値maxNと1を加えたものが、仮想語aに割り当てられる。そして、情報処理装置100は、既存の単語と整数との対応関係および仮想語と整数との対応関係を、関数gによってシャッフルして新たな対応関係を生成する。
That is, when expanding the hash function, the
なお、関数eは、入力された仮想語から、当該仮想語が示す関連語グループに属する1つの単語を選択するものであってもよいし、単語集合Wに属する単語をランダムに選択するものであってもよい。また、割り当てる整数を入れ替える関数gは、ランダムに生成してもよい。また、関数eや関数gは、複数のハッシュ関数の間で共通に使用してもよいし、ハッシュ関数毎にランダムに生成するようにしてもよい。 The function e may select one word belonging to the related word group indicated by the virtual word from the input virtual word, or may randomly select a word belonging to the word set W. There may be. Further, the function g for exchanging the integers to be assigned may be randomly generated. Further, the function e and the function g may be used in common among a plurality of hash functions, or may be randomly generated for each hash function.
上記の関数h’から、数式(5)のように拡張後のハッシュ関数H’が定義される。ハッシュ関数H’は、f(A)に含まれる単語および仮想語それぞれに対応する整数を関数h’によって算出し、その中から最小の整数を選択するものである。なお、関数h’の定義域のサイズは関数hの定義域のサイズの高々2倍である。関数h’の値域を1桁大きくするか、または、ハッシュ関数の数kを1つ増やすことで、ハッシュ関数H’のもとでハッシュ値が衝突する確率を元のハッシュ関数と同等に維持することができる。 From the above function h', the extended hash function H'is defined as in the equation (5). The hash function H'calculates an integer corresponding to each of the word and the virtual word included in f (A) by the function h', and selects the smallest integer from the integers. The size of the domain of the function h'is at most twice the size of the domain of the function h. By increasing the range of the function h'by one digit or increasing the number k of the hash function by one, the probability that the hash values collide under the hash function H'is maintained equal to that of the original hash function. be able to.
次に、仮想語を考慮したベクトルの算出例を説明する。
図9は、単語集合からベクトルを算出する例を示す図である。
表60は、単語集合Aに対応するベクトルと単語集合Bに対応するベクトルを算出して比較する過程を示している。単語集合Aは「猫」と「ご飯」を含み、更に仮想語「s1」と「s2」が挿入されている。単語集合Bは「にゃんこ」と「えさ」を含み、更に仮想語「s1」と「s2」が挿入されている。また、単語および仮想語と整数との対応関係が異なる12個のハッシュ関数が定義されており、12個のハッシュ値を列挙したものが、単語集合Aに対応するベクトルおよび単語集合Bに対応するベクトルになる。
Next, an example of vector calculation considering virtual words will be described.
FIG. 9 is a diagram showing an example of calculating a vector from a word set.
Table 60 shows the process of calculating and comparing the vector corresponding to the word set A and the vector corresponding to the word set B. The word set A includes "cat" and "rice", and further inserts virtual words "s 1 " and "s 2 ". The word set B includes "nyanko" and "food", and further inserts virtual words "s 1 " and "s 2 ". Further, 12 hash functions having different correspondences between words and virtual words and integers are defined, and a list of 12 hash values corresponds to the vector corresponding to the word set A and the word set B. Become a vector.
ハッシュ関数H’1で使用される関数h’1は、「猫」に0、「ご飯」に1、「にゃんこ」に2、「えさ」に3、「s1」に4、「s2」に5を割り当てている。よって、単語集合Aに対するハッシュ値は「猫」に対応する0になり、単語集合Bに対するハッシュ値は「にゃんこ」に対応する2になる。また、ハッシュ関数H’2で使用される関数h’2は、「猫」に1、「ご飯」に0、「にゃんこ」に5、「えさ」に4、「s1」に3、「s2」に2を割り当てている。よって、単語集合Aに対するハッシュ値は「ご飯」に対応する0になり、単語集合Bに対するハッシュ値は「s2」に対応する2になる。 The function h'1 used in the hash function H'1 is 0 for "cat", 1 for "rice", 2 for "nyanko", 3 for "food", 4 for "s 1 ", and "s 2 ". Is assigned to 5. Therefore, the hash value for the word set A is 0 corresponding to "cat", and the hash value for the word set B is 2 corresponding to "nyanko". The function h'2 used in the hash function H'2 is 1 for "cat", 0 for "rice", 5 for "nyanko", 4 for "food", 3 for "s 1 ", and "s". 2 is assigned to "2". Therefore, the hash value for the word set A becomes 0 corresponding to "rice", and the hash value for the word set B becomes 2 corresponding to "s 2 ".
また、ハッシュ関数H’5で使用される関数h’5は、「猫」に2、「ご飯」に3、「にゃんこ」に4、「えさ」に5、「s1」に0、「s2」に1を割り当てている。よって、単語集合Aに対するハッシュ値は「s1」に対応する0になり、単語集合Bに対するハッシュ値は「s1」に対応する0になる。このようにして、単語集合Aからはベクトル(0,0,2,2,0,0,0,1,1,0,0,0)が算出される。単語集合Bからはベクトル(2,2,0,0,0,0,1,0,0,0,0,1)が算出される。 The function h'5 used in the hash function H'5 is 2 for "cat", 3 for "rice", 4 for "nyanko", 5 for "food", 0 for "s 1 ", and "s". 1 is assigned to " 2 ". Therefore, the hash value for the word set A becomes 0 corresponding to "s 1 ", and the hash value for the word set B becomes 0 corresponding to "s 1 ". In this way, a vector (0,0,2,2,0,0,0,1,1,0,0,0) is calculated from the word set A. A vector (2,2,0,0,0,0,1,0,0,0,0,1) is calculated from the word set B.
元の単語集合A,Bの間には共通する単語が存在しないものの、12個のハッシュ関数のうちハッシュ関数H’5,H’6,H’10,H’11のハッシュ値が一致しており、ハッシュ値の一致割合が0.33になっている。仮に、仮想語を使用しない場合はハッシュ値の一致割合が0.00になる。よって、発話の類似性を適切に評価することができる。 Although there is no common word between the original word sets A and B, the hash values of the hash functions H'5 , H'6 , H'10, and H'11 out of the 12 hash functions match. The hash value match ratio is 0.33. If the virtual word is not used, the hash value match ratio is 0.00. Therefore, the similarity of utterances can be appropriately evaluated.
図10は、問い合わせ発話に対応する返答発話の選択例を示す図である。
前述のように、情報処理装置100は、蓄積された検索対象発話の中から問い合わせ発話に最も類似する検索対象発話を選択し、選択した検索対象発話に対応する返答発話を出力する。一例として、検索対象発話71~73が蓄積されている。
FIG. 10 is a diagram showing a selection example of a response utterance corresponding to an inquiry utterance.
As described above, the
検索対象発話71は「メールを調べて」というメッセージであり、検索対象発話72は「スケジュールの調整」というメッセージであり、検索対象発話73は「打ち合わせを調整したい」というメッセージである。情報処理装置100は予め、検索対象発話71からベクトル74を生成し、検索対象発話72からベクトル75を生成し、検索対象発話73からベクトル76を生成しておく。ベクトル74は(0,0,1,1,2,2,…)という整数の列であり、ベクトル75は(2,2,0,0,1,1,…)という整数の列であり、ベクトル75は(1,2,2,2,1,1,…)という整数の列である。
The
情報処理装置100は、問い合わせ発話77を受け付ける。問い合わせ発話77は、「会議を調整したい」というメッセージである。情報処理装置100は、問い合わせ発話77からベクトル78を生成する。ベクトル78は、(1,1,2,2,1,1,…)という整数の列である。ベクトル74~76のうちベクトル78に最も近似するものはベクトル76である。そこで、情報処理装置100は、検索対象発話73を選択し、検索対象発話73に対応する返答発話79を出力する。返答発話79は、問い合わせ発話77に対する応答であり、「スケジュールを調整します」というメッセージである。「会議」と「打ち合わせ」が類似する意味をもつ関連語であることが予め登録されていれば、情報処理装置100は、検索対象発話73が問い合わせ発話77に類似すると判定できる。
The
なお、探索木142の葉ノードに単一の検索対象発話が対応付けられている場合など、ベクトルを用いた近傍探索によって単一の検索対象発話が検索された場合、情報処理装置100は当該検索対象発話に対応する返答発話を出力すればよい。一方、探索木142の葉ノードに2以上の検索対象発話が対応付けられている場合など、ベクトルを用いた近傍探索によって2以上の検索対象発話が検索された場合、情報処理装置100は何らかの方法で検索対象発話を1つに絞り込むことが考えられる。例えば、情報処理装置100は、ベクトルを用いた簡易的な類似判定とは異なる詳細分析により検索対象発話を絞り込む。
When a single search target utterance is searched by a neighborhood search using a vector, such as when a single search target utterance is associated with the leaf node of the search tree 142, the
次に、情報処理装置100の機能および処理手順について説明する。
図11は、情報処理装置の機能例を示すブロック図である。
情報処理装置100は、発話データベース121、関連語記憶部122、ハッシュ関数記憶部123およびインデックス記憶部124を有する。これらの記憶部は、例えば、RAM102またはHDD103の記憶領域を用いて実現される。また、情報処理装置100は、ハッシュ関数生成部131、インデックス生成部132、問い合わせ受信部133、ハッシュ値算出部134、検索部135および返答出力部136を有する。これらの処理部は、例えば、CPU101が実行するプログラムを用いて実現される。
Next, the functions and processing procedures of the
FIG. 11 is a block diagram showing a functional example of the information processing apparatus.
The
発話データベース121は、複数の検索対象発話とそれに対応する複数の返答発話とが登録された発話テーブル141を記憶する。検索対象発話と返答発話の組は、事前に登録されていてもよいし、情報処理装置100を使用するユーザとの対話を通じて追加されてもよいし、ネットワークから自動的に収集されてもよい。
The
関連語記憶部122は、関連語グループを示す関連語テーブル143を記憶する。関連語グループは、事前に登録されていてもよいし、情報処理装置100を使用するユーザとの対話を通じて追加されてもよいし、ネットワークから自動的に収集されてもよい。
The related
ハッシュ関数記憶部123は、異なる複数のハッシュ関数を記憶する。各ハッシュ関数は、検索対象発話に出現し得る単語および検索対象発話に出現しない仮想語それぞれに対して一意な整数を対応付ける対応関係をもち、単語集合を受け付けて1つのハッシュ値を出力する。異なるハッシュ関数は異なる対応関係をもつ。
The hash
インデックス記憶部124は、問い合わせ発話に類似する検索対象発話を検索するためのインデックスとして探索木142を記憶する。探索木142は、複数のハッシュ関数を用いて検索対象発話から算出されたベクトルに基づいて生成される。
The
ハッシュ関数生成部131は、発話データベース121に記憶された検索対象発話と関連語記憶部122に記憶された関連語テーブル143に基づいて、複数のハッシュ関数を生成し、生成した複数のハッシュ関数をハッシュ関数記憶部123に格納する。
The hash
まず、ハッシュ関数生成部131は、検索対象発話で使用されている単語を抽出し、抽出した単語をランダムに整列して拡張前のハッシュ関数を生成する。また、ハッシュ関数生成部131は、関連語テーブル143に登録された関連語グループと関連語をもたない単語に対して仮想語を割り当てる。ハッシュ関数生成部131は、仮想語に対しても整数が割り当てられるようにハッシュ関数を拡張する。
First, the hash
インデックス生成部132は、発話データベース121に記憶された検索対象発話とハッシュ関数記憶部123に記憶されたハッシュ関数に基づいて、探索木142を生成し、生成した探索木142をインデックス記憶部124に格納する。
The
まず、インデックス生成部132は、検索対象発話毎に単語集合を抽出し、各単語に対応する仮想語を単語集合に追加する。インデックス生成部132は、仮想語を追加した単語集合を複数のハッシュ関数それぞれに入力して、ハッシュ値のベクトルを算出する。インデックス生成部132は、複数の検索対象発話に対応する複数のベクトルを効率的に検索できるように探索木142を生成する。例えば、インデックス生成部132は、ベクトルの中の1つの次元に着目し、ベクトルの集合が二分割されるように当該次元のハッシュ値の閾値を決定することを繰り返す。インデックス生成部132は、探索木142の葉ノードにはできる限り単一のベクトルが対応付けられるように中間ノードを生成する。
First, the
問い合わせ受信部133は、問い合わせ発話を受信する。問い合わせ受信部133は、ユーザから文字列として入力された問い合わせ発話を受信してもよいし、ユーザが口頭で発した問い合わせ発話の音声信号を文字列に変換してもよい。また、問い合わせ受信部133は、他の情報処理装置から文字列または音声信号を受信してもよい。
The
ハッシュ値算出部134は、ハッシュ関数記憶部123に記憶された複数のハッシュ関数に基づいて、問い合わせ発話に対応するベクトルを生成する。まず、ハッシュ値算出部134は、問い合わせ発話から単語集合を抽出し、各単語に対応する仮想語を単語集合に追加する。ハッシュ値算出部134は、仮想語を追加した単語集合を複数のハッシュ関数それぞれに入力して、ハッシュ値のベクトルを算出する。
The hash
検索部135は、インデックス記憶部124に記憶された探索木142と問い合わせ発話のベクトルに基づいて、近傍探索により問い合わせ発話に最も類似する検索対象発話を検索する。問い合わせ発話に最も類似する検索対象発話は、ベクトル同士を比較したときにハッシュ値が一致する次元が最も多い検索対象発話である。検索部135は、問い合わせ発話のベクトルの中の特定の次元のハッシュ値と閾値とを比較しながら、探索木142をルートノードから葉ノードに向かって辿り、特定の葉ノードに到達する。検索部135は、到達した葉ノードに対応する検索対象発話を選択する。なお、到達した葉ノードに2以上の検索対象発話が対応付けられている場合、すなわち、探索木142では検索対象発話を1つに絞り込めない場合、他の方法で検索対象発話を1つ選択する。
The
返答出力部136は、選択された検索対象発話に対応付けられた返答発話を出力する。返答出力部136は、返答発話の文字列をディスプレイ104aに表示してもよいし、返答発話を音声信号に変換してスピーカーにより音声を再生してもよい。また、返答出力部136は、他の情報処理装置に文字列または音声信号を送信してもよい。
The
図12は、インデックス生成の手順例を示すフローチャートである。
(S10)ハッシュ関数生成部131は、発話テーブル141に登録された複数の検索対象発話に含まれる単語を収集して単語集合Wを抽出する。
FIG. 12 is a flowchart showing an example of an index generation procedure.
(S10) The hash
(S11)ハッシュ関数生成部131は、単語集合Wに含まれる単語をランダムに整列し、単語の列の先頭から末尾に向かって整数を小さい順に割り当てる。ハッシュ関数生成部131は、これをk回繰り返してk個のハッシュ関数Hを生成する。
(S11) The hash
(S12)ハッシュ関数生成部131は、単語集合Wに含まれる単語wを1つ選択し、選択した単語wに対応するフラグfwを0に初期化する。
(S13)ハッシュ関数生成部131は、ステップS12で選択した単語wを関連語テーブル143から検索し、単語wが何れかの関連語グループに属するか、すなわち、単語wに類似する意味をもつ関連語が存在するか判断する。関連語がある場合はステップS14に進み、関連語がない場合はステップS15に進む。
(S12) The hash
(S13) The hash
(S14)ハッシュ関数生成部131は、フラグfwを1に更新する。
(S15)ハッシュ関数生成部131は、単語集合Wの中にステップS12でまだ選択していない単語wがあるか判断する。未選択の単語wがある場合はステップS12に進み、未選択の単語wがない場合はステップS16に進む。
(S14) The hash
(S15) The hash
(S16)ハッシュ関数生成部131は、関連語テーブル143に登録された関連語グループそれぞれに対して一意な仮想語sを割り当てる。また、ハッシュ関数生成部131は、fw=0である単語それぞれに対して一意な仮想語sを割り当てる。ここで割り当てる仮想語sは、単語集合Wに含まれないダミー語ないしラベルであり、関連語グループおよびfw=0である単語の間で重複しない。仮想語sは「s1」のような記号でもよい。
(S16) The hash
(S17)ハッシュ関数生成部131は、ステップS11で生成したk個のハッシュ関数Hの中から1つのハッシュ関数Hを選択する。
(S18)ハッシュ関数生成部131は、単語集合Wから単語wを1つ選択する。
(S17) The hash
(S18) The hash
(S19)ハッシュ関数生成部131は、ステップS17で選択したハッシュ関数Hにおいて、ステップS18で選択した単語wに対応付けられている整数h(w)を特定する。そして、ハッシュ関数生成部131は、シャッフル用の所定の関数gを用いて、単語wに対応付ける新たな整数h’(w)=g(h(w))を算出する。
(S19) The hash
(S20)ハッシュ関数生成部131は、単語集合Wの中にステップS18でまだ選択していない単語wがあるか判断する。未選択の単語wがある場合はステップS18に進み、未選択の単語wがない場合はステップS21に進む。
(S20) The hash
図13は、インデックス生成の手順例を示すフローチャート(続き)である。
(S21)ハッシュ関数生成部131は、ステップS16で割り当てた仮想語の集合(仮想語集合W’)の中から仮想語sを1つ選択する。
FIG. 13 is a flowchart (continued) showing an example of the index generation procedure.
(S21) The hash
(S22)ハッシュ関数生成部131は、仮想語を既出の単語に変換する所定の関数eを用いて、ステップS21で選択した仮想語sに対応する単語e(s)を特定する。単語e(s)は、仮想語sに対応する関連語グループの中の1つの単語または仮想語sに対応する単一の単語でもよく、単語集合Wの中からランダムに選択されたものでもよい。ハッシュ関数生成部131は、ステップS17で選択したハッシュ関数Hにおいて、単語e(s)に対応付けられている整数h(e(s))を特定する。ハッシュ関数生成部131は、シャッフル用の所定の関数gを用いて、仮想語sに対応付ける新たな整数h’(s)=g(h(e(s))+maxN+1)を算出する。なお、maxNはハッシュ関数Hが出力し得るハッシュ値(値域)の最大値である。
(S22) The hash
(S23)ハッシュ関数生成部131は、仮想語集合W’の中にステップS21でまだ選択していない仮想語sがあるか判断する。未選択の仮想語sがある場合はステップS21に進み、未選択の仮想語sがない場合はステップS24に進む。
(S23) The hash
(S24)ハッシュ関数生成部131は、ステップS19,S22の結果から、ステップS17で選択したハッシュ関数Hに対応する拡張後のハッシュ関数H’を決定する。
(S25)ハッシュ関数生成部131は、ステップS17でまだ選択していないハッシュ関数Hがあるか判断する。未選択のハッシュ関数Hがある場合はステップS17に進み、未選択のハッシュ関数Hがない場合はステップS26に進む。
(S24) The hash
(S25) The hash
(S26)インデックス生成部132は、発話テーブル141に登録された複数の検索対象発話の中から検索対象発話を1つ選択する。
(S27)インデックス生成部132は、ステップS26で選択した検索対象発話に含まれる単語を抽出し、抽出した単語の集合である単語集合Aを生成する。
(S26) The
(S27) The
(S28)インデックス生成部132は、単語集合Aに含まれる単語それぞれに対応する仮想語を判定し、判定した仮想語を単語集合Aに追加する。何れかの関連語グループに属する単語には、当該関連語グループに対してステップS16で割り当てられた仮想語が追加される。何れの関連語グループにも属さない単語(関連語がない単語)には、当該単語に対してステップS16で割り当てられた仮想語が追加される。
(S28) The
(S29)インデックス生成部132は、仮想語を追加した単語集合Aを、ステップS24で決定された複数のハッシュ関数H’にそれぞれ入力し、複数のハッシュ値を求める。各ハッシュ関数H’は、単語集合Aに含まれる元の単語および仮想語それぞれに対応する整数を判定し、最小の整数をハッシュ値として出力する。インデックス生成部132は、複数のハッシュ値を列挙したベクトルを算出する。
(S29) The
(S30)インデックス生成部132は、ステップS26でまだ選択していない検索対象発話があるか判断する。未選択の検索対象発話がある場合はステップS26に進み、未選択の検索対象発話がない場合はステップS31に進む。
(S30) The
(S31)インデックス生成部132は、ステップS29で算出した複数のベクトルから、検索対象発話のインデックスとしての探索木142を生成する。
図14は、発話検索の手順例を示すフローチャートである。
(S31) The
FIG. 14 is a flowchart showing an example of the procedure for utterance search.
(S40)問い合わせ受信部133は、問い合わせ発話を受信する。
(S41)ハッシュ値算出部134は、ステップS40で受信した問い合わせ発話に含まれる単語を抽出し、抽出した単語の集合である単語集合Bを生成する。
(S40) The
(S41) The hash
(S42)ハッシュ値算出部134は、単語集合Bに含まれる単語それぞれに対応する仮想語を判定し、判定した仮想語を単語集合Bに追加する。何れかの関連語グループに属する単語には、当該関連語グループに対してステップS16で割り当てられた仮想語が追加される。何れの関連語グループにも属さない単語(関連語がない単語)には、当該単語に対してステップS16で割り当てられた仮想語が追加される。
(S42) The hash
(S43)ハッシュ値算出部134は、仮想語を追加した単語集合Bを、ステップS24で決定された複数のハッシュ関数H’にそれぞれ入力し、複数のハッシュ値を求める。各ハッシュ関数H’は、単語集合Bに含まれる元の単語および仮想語それぞれに対応する整数を判定し、最小の整数をハッシュ値として出力する。ハッシュ値算出部134は、複数のハッシュ値を列挙したベクトルを算出する。
(S43) The hash
(S44)検索部135は、ステップS31で生成された探索木142とステップS43で算出されたベクトルとを照合して、最も類似する検索対象発話を判定する。
(S45)返答出力部136は、発話テーブル141からステップS44の検索対象発話に対応付けられた返答発話を取得し、取得した返答発話を出力する。
(S44) The
(S45) The
第2の実施の形態の情報処理装置100によれば、対話システムを実現するために、問い合わせ発話に類似する検索対象発話がデータベースの中から検索される。このとき、各発話に含まれる単語集合から複数のMin-hash関数によりハッシュ値のベクトルが算出され、ベクトル同士の近さによって発話の類似度が評価される。よって、多数の検索対象発話の中から問い合わせ発話に類似するものを高速に検索することができる。
According to the
また、関連語グループを示す関連語辞書を参照して、単語集合に含まれる元の単語を残したまま、当該単語が属する関連語グループを示す仮想語が単語集合に追加される。また、元の単語と仮想語とに異なる整数が割り当てられるように複数のMin-hash関数が拡張される。そして、仮想語を追加した単語集合と拡張した複数のMin-hash関数によりベクトルが算出される。これにより、問い合わせ発話と検索対象発話が同一の単語を含まないものの近い意味をもつ関連語を含む場合に、両者の類似度を適切に評価することができる。 Further, referring to the related word dictionary indicating the related word group, a virtual word indicating the related word group to which the word belongs is added to the word set while keeping the original word included in the word set. Also, multiple Min-hash functions are extended so that different integers are assigned to the original word and the virtual word. Then, the vector is calculated by the word set to which the virtual word is added and a plurality of extended Min-hash functions. Thereby, when the inquiry utterance and the search target utterance do not include the same word but include related words having similar meanings, the similarity between the two can be appropriately evaluated.
例えば、単語間の意味の近さを無視する場合よりも類似度が高く評価され、関連語を同一視する場合よりも類似度が低く評価される。その結果、異なる表現を使用する問い合わせ発話と検索対象発話の類似度を適切に評価することができ、問い合わせ発話に類似する検索対象発話を効率的に絞り込むことが可能となる。また、Min-hash関数のハッシュ値のベクトルを使用するため、検索の高速性を維持することができる。 For example, the similarity is evaluated higher than the case of ignoring the closeness of meaning between words, and the similarity is evaluated lower than the case of equating related words. As a result, the similarity between the inquiry utterance and the search target utterance using different expressions can be appropriately evaluated, and the search target utterance similar to the inquiry utterance can be efficiently narrowed down. In addition, since the hash value vector of the Min-hash function is used, the search speed can be maintained.
10 類似テキスト検索装置
11 記憶部
12 処理部
13 関連語辞書
14,15a,15b テキスト
16,17a,17b 単語集合
18,19a,19b 特徴情報
10 Similar
Claims (6)
第1のテキストの入力を受け付け、
前記第1のテキストに含まれる2以上の第1の単語を抽出し、関連する単語のグループを示す関連語辞書を参照して、前記2以上の第1の単語のうち何れかのグループに属する第1の単語に対して当該グループを示す第1のダミー語を割り当て、
前記2以上の第1の単語および前記第1のダミー語を含む第1の単語集合に応じた第1の特徴情報を生成し、
複数の第2のテキストそれぞれに対応して記憶された、当該第2のテキストに含まれる2以上の第2の単語および何れかの第2の単語が属するグループを示す第2のダミー語を含む第2の単語集合に応じた第2の特徴情報と、前記第1の特徴情報との間の比較に基づいて、前記第1のテキストに類似する第2のテキストを検索する、
類似テキスト検索方法。 The computer
Accept the input of the first text,
Extracting two or more first words included in the first text, referring to a related word dictionary showing a group of related words, and belonging to any group of the two or more first words. Assign the first dummy word indicating the group to the first word,
The first feature information corresponding to the first word set including the two or more first words and the first dummy word is generated.
Includes two or more second words contained in the second text and a second dummy word indicating a group to which any second word belongs, which is stored corresponding to each of the plurality of second texts. Searching for a second text similar to the first text, based on a comparison between the second feature information according to the second word set and the first feature information.
Similar text search method.
前記第2の特徴情報は、前記複数のハッシュ関数によって前記第2の単語集合から算出される複数のハッシュ値を含む第2のベクトルである、
請求項1記載の類似テキスト検索方法。 The first feature information is a first vector containing a plurality of hash values calculated from the first word set by a plurality of different hash functions.
The second feature information is a second vector containing a plurality of hash values calculated from the second word set by the plurality of hash functions.
The similar text search method according to claim 1.
請求項2記載の類似テキスト検索方法。 Each of the plurality of hash functions has a correspondence relationship in which a unique value is associated with each word and a dummy word, and is the smallest value among the values corresponding to the word and the dummy word included in the input word set. Is output as a hash value,
The similar text search method according to claim 2.
前記検索された第2のテキストに対応付けられて記憶された第3のテキストを、前記第1のテキストに対する応答として出力する、
請求項1記載の類似テキスト検索方法。 The computer further
The third text stored in association with the searched second text is output as a response to the first text.
The similar text search method according to claim 1.
第1のテキストの入力を受け付け、前記第1のテキストに含まれる2以上の第1の単語を抽出し、前記関連語辞書を参照して前記2以上の第1の単語のうち何れかのグループに属する第1の単語に対して当該グループを示す第1のダミー語を割り当て、前記2以上の第1の単語および前記第1のダミー語を含む第1の単語集合に応じた第1の特徴情報を生成し、前記第2の特徴情報と前記第1の特徴情報との間の比較に基づいて前記第1のテキストに類似する第2のテキストを検索する処理部と、
を有する類似テキスト検索装置。 A related word dictionary showing a group of related words is stored, and two or more second words contained in the second text and any second word corresponding to each of the plurality of second texts are stored. A storage unit that stores a second feature information corresponding to a second word set including a second dummy word indicating a group to which the word belongs, and a storage unit that stores the second feature information.
The input of the first text is accepted, two or more first words included in the first text are extracted, and any group of the two or more first words is referred to with reference to the related word dictionary. A first dummy word indicating the group is assigned to the first word belonging to the above, and the first feature corresponding to the first word set including the two or more first words and the first dummy word. A processing unit that generates information and searches for a second text similar to the first text based on a comparison between the second feature information and the first feature information.
Similar text search device with.
第1のテキストの入力を受け付け、
前記第1のテキストに含まれる2以上の第1の単語を抽出し、関連する単語のグループを示す関連語辞書を参照して、前記2以上の第1の単語のうち何れかのグループに属する第1の単語に対して当該グループを示す第1のダミー語を割り当て、
前記2以上の第1の単語および前記第1のダミー語を含む第1の単語集合に応じた第1の特徴情報を生成し、
複数の第2のテキストそれぞれに対応して記憶された、当該第2のテキストに含まれる2以上の第2の単語および何れかの第2の単語が属するグループを示す第2のダミー語を含む第2の単語集合に応じた第2の特徴情報と、前記第1の特徴情報との間の比較に基づいて、前記第1のテキストに類似する第2のテキストを検索する、
処理を実行させる類似テキスト検索プログラム。 On the computer
Accept the input of the first text,
Extracting two or more first words included in the first text, referring to a related word dictionary showing a group of related words, and belonging to any group of the two or more first words. Assign the first dummy word indicating the group to the first word,
The first feature information corresponding to the first word set including the two or more first words and the first dummy word is generated.
Includes two or more second words contained in the second text and a second dummy word indicating a group to which any second word belongs, which is stored corresponding to each of the plurality of second texts. Searching for a second text similar to the first text, based on a comparison between the second feature information according to the second word set and the first feature information.
A similar text search program that executes processing.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018123365A JP7032650B2 (en) | 2018-06-28 | 2018-06-28 | Similar text search method, similar text search device and similar text search program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018123365A JP7032650B2 (en) | 2018-06-28 | 2018-06-28 | Similar text search method, similar text search device and similar text search program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2020004107A JP2020004107A (en) | 2020-01-09 |
| JP7032650B2 true JP7032650B2 (en) | 2022-03-09 |
Family
ID=69100059
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2018123365A Expired - Fee Related JP7032650B2 (en) | 2018-06-28 | 2018-06-28 | Similar text search method, similar text search device and similar text search program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7032650B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12413413B2 (en) | 2021-05-13 | 2025-09-09 | Nec Corporation | Similarity degree derivation system and similarity degree derivation method |
| CN114116971B (en) * | 2021-11-17 | 2025-10-24 | 招联消费金融股份有限公司 | Model training method, device and computer equipment for generating similar text |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005251038A (en) | 2004-03-05 | 2005-09-15 | Just Syst Corp | Document search device, document search method, and document search program |
| JP2013175038A (en) | 2012-02-24 | 2013-09-05 | Nec Personal Computers Ltd | Content recommending device, content recommending system, control method, and program |
| US20150278200A1 (en) | 2014-04-01 | 2015-10-01 | Microsoft Corporation | Convolutional Latent Semantic Models and their Applications |
| WO2018097091A1 (en) | 2016-11-25 | 2018-05-31 | 日本電信電話株式会社 | Model creation device, text search device, model creation method, text search method, data structure, and program |
-
2018
- 2018-06-28 JP JP2018123365A patent/JP7032650B2/en not_active Expired - Fee Related
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005251038A (en) | 2004-03-05 | 2005-09-15 | Just Syst Corp | Document search device, document search method, and document search program |
| JP2013175038A (en) | 2012-02-24 | 2013-09-05 | Nec Personal Computers Ltd | Content recommending device, content recommending system, control method, and program |
| US20150278200A1 (en) | 2014-04-01 | 2015-10-01 | Microsoft Corporation | Convolutional Latent Semantic Models and their Applications |
| WO2018097091A1 (en) | 2016-11-25 | 2018-05-31 | 日本電信電話株式会社 | Model creation device, text search device, model creation method, text search method, data structure, and program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2020004107A (en) | 2020-01-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11461388B2 (en) | Generating a playlist | |
| KR102324048B1 (en) | Method, apparatus, computer device and storage medium for verifying community question answer data | |
| CN107609101B (en) | Intelligent interaction method, equipment and storage medium | |
| WO2022271304A1 (en) | Self-supervised document-to-document similarity system | |
| US20120290561A1 (en) | Information processing apparatus, information processing method, program, and information processing system | |
| US9576050B1 (en) | Generating a playlist based on input acoustic information | |
| CN106649605B (en) | Method and device for triggering promotion keywords | |
| KR20190136911A (en) | method and device for retelling text, server and storage medium | |
| CN110717038B (en) | Object classification method and device | |
| CN111241310A (en) | Deep cross-modal Hash retrieval method, equipment and medium | |
| JP2003196280A (en) | Text generating method and text generating device | |
| CN109933660A (en) | The API information search method based on handout and Stack Overflow towards natural language form | |
| CN118503390A (en) | An automatic optimization method and system based on intelligent data memory | |
| JP2024174145A (en) | Acoustic signal search device, acoustic signal search method, data search device, data search method, and program | |
| JP7032650B2 (en) | Similar text search method, similar text search device and similar text search program | |
| JP2009535671A (en) | System and method for associating category label of one user with category label defined by other user | |
| CN113535883A (en) | Business premises entity linking method, system, electronic device and storage medium | |
| JP6260678B2 (en) | Information processing apparatus, information processing method, and information processing program | |
| 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 | |
| CN119513330B (en) | An intelligent agent method for complex question-answering reasoning based on a large-scale character knowledge graph | |
| CN114625845B (en) | Information retrieval method, intelligent terminal and computer-readable storage medium | |
| CN119066179B (en) | Question and answer processing method, computer program product, device and medium | |
| JP7283718B2 (en) | Acoustic signal retrieval device, acoustic signal retrieval method, data retrieval device, data retrieval method, program | |
| JP2015018372A (en) | Expression extraction model learning device, expression extraction model learning method and computer program | |
| JP7477744B2 (en) | Information processing device, control method, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210310 |
|
| RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20210324 |
|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20210324 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20220119 |
|
| 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: 20220125 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220207 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7032650 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |