JP2001067378A - Calculation method and device for similarity of character string and recording medium - Google Patents

Calculation method and device for similarity of character string and recording medium

Info

Publication number
JP2001067378A
JP2001067378A JP2000188490A JP2000188490A JP2001067378A JP 2001067378 A JP2001067378 A JP 2001067378A JP 2000188490 A JP2000188490 A JP 2000188490A JP 2000188490 A JP2000188490 A JP 2000188490A JP 2001067378 A JP2001067378 A JP 2001067378A
Authority
JP
Japan
Prior art keywords
character string
similarity
character
strings
score
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.)
Pending
Application number
JP2000188490A
Other languages
Japanese (ja)
Inventor
Kyoji Umemura
恭司 梅村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sumitomo Electric Industries Ltd
Original Assignee
Sumitomo Electric Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sumitomo Electric Industries Ltd filed Critical Sumitomo Electric Industries Ltd
Priority to JP2000188490A priority Critical patent/JP2001067378A/en
Publication of JP2001067378A publication Critical patent/JP2001067378A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To calculate the similarity of character strings with emphasis put on words and to retrieve a document without analyzing a morpheme. SOLUTION: In this calculation method of similarity of character strings, an input character string and a document of a document data base are defined as two character strings and the similarity of both character strings is calculated by a similarity calculation part 14. A coincident character string similarity calculation part 21 of the part 14 calculates the character string score to a partial character string that is common to both character strings and adds this score to the similarity of the remaining partial strings. An optional character string similarity calculation part 22 shifts the correspondence relation of both character strings to calculates a larger degree of similarity, and a maximum value selection part 23 selects the larger degree of similarity. These processes are repeated to totalize the score of partial character strings adaptive to the sequences of two character strings, i.e., the partial character strings which are common to each other and to calculate the final similarity. A retrieval result output part 13 selects a document of a high degree of similarity out of a document data base as a retrieval result.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、情報検索の分野に
関するものであり、特に、入力された文字列とデータベ
ースに登録された文書との類似判定に用いると好適であ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the field of information retrieval, and is particularly suitable for use in determining similarity between an input character string and a document registered in a database.

【0002】[0002]

【従来の技術】言葉を用いて表現された文書のデータベ
ースから、所望の文書(ドキュメント)を取り出す情報
検索が良く行われている。かかる情報検索において、言
葉は、複数の文字からなる単語を組合せた文字列として
扱う。そして、文字列同士を比較して類似度を算出する
ことで所望の内容との適合度を求めたり、最も類似度の
高い文字列を一つ、あるいは、類似度の高い文字列を幾
つか選び出すことで情報検索を行っている。以下では、
特に断らない限り、類似度を示す値は0以上であって、
値が大きいほど類似度が高いものとする。
2. Description of the Related Art Information retrieval for extracting a desired document (document) from a database of documents expressed using words is often performed. In such information retrieval, words are treated as character strings obtained by combining words composed of a plurality of characters. Then, the character strings are compared with each other to calculate the similarity, thereby obtaining the degree of conformity with the desired content, or selecting one character string having the highest similarity or selecting some character strings having the highest similarity. The information is searched by doing. Below,
Unless otherwise specified, the value indicating the similarity is 0 or more,
The larger the value, the higher the similarity.

【0003】文字列同士の類似度は、大きく分けて、形
態素解析を用いる方法と、nグラムによる方法の2通り
がある。
[0003] The similarity between character strings is roughly classified into two types: a method using morphological analysis and a method using n-grams.

【0004】形態素解析を用いる方法は、例えば、Gera
rd Salton and Christopher Buckley, Term-Weighting
Approaches in Automatic Text Retrieval, Informatio
n Proceeding and Management, 24, pp.513-523, 1988.
に開示されている。この方法で二つの文字列同士の類似
度を求めるには、まず、両方の文字列を、辞書と文法知
識を用いた形態素解析により単語の列(単語列)に分解
する。次に、両方の単語列を比較して、一致する単語を
求める。そして、一致する単語に対して重みを設定す
る。それから、この重みを、全ての一致する単語に関し
て加算する。この加算の結果得られた総和が、形態素解
析による類似度である。
A method using morphological analysis is described, for example, in Gera
rd Salton and Christopher Buckley, Term-Weighting
Approaches in Automatic Text Retrieval, Informatio
n Proceeding and Management, 24, pp.513-523, 1988.
Is disclosed. In order to determine the similarity between two character strings by this method, first, both character strings are decomposed into word strings (word strings) by morphological analysis using a dictionary and grammatical knowledge. Next, both word strings are compared to find a matching word. Then, weights are set for the matching words. This weight is then added for all matching words. The sum obtained as a result of this addition is the similarity obtained by morphological analysis.

【0005】nグラムによる方法は、例えばYasushi Og
awa and Toru Matsuda, Overlapping statistical word
indexing: A new indexing method for Japanese tex
t, Inproceeding of SIGIR'97, Philadelphia PA, USA,
pp.226-234, 1997.に開示されている。この方法は、形
態素解析を用いない方法である。この方法で文字列同士
の類似度を求めるには、まず、両方の文字列の一致する
部分を求める。そして、この一致する部分に対して重み
を設定する。それから、この重みを、全ての一致する部
分に関して加算する。この加算の結果得られた総和が、
nグラムによる類似度である。
[0005] The method using n-grams is described in, for example, Yasushi Og
awa and Toru Matsuda, Overlapping statistical word
indexing: A new indexing method for Japanese tex
t, Inproceeding of SIGIR'97, Philadelphia PA, USA,
pp.226-234, 1997. This method does not use morphological analysis. To determine the similarity between character strings by this method, first, a matching part of both character strings is determined. Then, a weight is set for the matching part. This weight is then added for all matching parts. The sum obtained as a result of this addition is
It is a similarity based on n-grams.

【0006】以上の形態素解析による方法とnグラムに
よる方法は、文書を構成するキーワードに関する加算と
なっており、これが情報検索において一般的である。し
かしながら、これらの加算では、キーワードが出現する
順序が類似度に反映されることがない。
[0006] The above-described method based on morphological analysis and the method based on n-grams are additions regarding keywords constituting a document, and this is common in information retrieval. However, in these additions, the order in which the keywords appear is not reflected on the similarity.

【0007】また、日本語では情報検索の最初のステッ
プで文書を単語列に分解することが行われているが、こ
れを正しく行うことは簡単ではない。単語の切り出しを
誤ると、それは効果的な情報検索のキーワードの切り出
しを失敗したことを意味しており、情報検索の性能を低
下させる結果をもたらす。
[0007] In Japanese, a document is decomposed into a word string in the first step of information retrieval, but it is not easy to correctly perform this. Incorrect word segmentation means that keyword segmentation for effective information retrieval has failed, resulting in a decrease in information retrieval performance.

【0008】また一方、単語という境界をもたないパタ
ーンに関して、情報検索に有益な部分を特定することは
さらに難しい。文字列は、文字が一次元的に繋がったパ
ターンとみなすこともできる。しかし、たとえ一次元の
パターンであっても、パターンの分割の難しさが一つの
原因で情報検索の方法論の適用が難しかった。
On the other hand, it is more difficult to specify a portion useful for information retrieval for a pattern having no word boundary. A character string can be regarded as a pattern in which characters are connected one-dimensionally. However, even for a one-dimensional pattern, it is difficult to apply the information retrieval methodology due to one of the difficulties in dividing the pattern.

【0009】その様な背景から、類似度をダイナミック
プログラミング(Dynamic Programming。以下、DPと
も記す。)による合算で求める方法がある。これには、
単純加算による方法と、文字に重みを加える方法の2つ
の方法がある。
[0009] From such a background, there is a method of calculating the similarity by summation by dynamic programming (hereinafter also referred to as DP). This includes
There are two methods, a simple addition method and a method of adding weight to a character.

【0010】単純な加算による方法は、例えばRobert
R. Korfhage, Information Storageand Retrieval, pp3
00-304, Wiley Computer Publishing, 1997.に開示され
ている。この方法による文字列同士の類似度(以下、加
算DP類似度)の求め方は、以下の通りである。ここ
で、α、βを文字列とし、x、yを長さ1の異なる文字列
とする(説明の便宜上、文字を、長さ1の文字列とも呼
ぶことにする)。""は長さ0の文字列(以下、空文字
列)とする。関数MAXは、実数の引数から実数を求める
関数であって、引数のうちで最大の値を求める関数であ
るとする(関数MAXについては、特に断らない限り、他
の類似度を求める場合にも同じ関数とする)。
A simple addition method is described, for example, by Robert
R. Korfhage, Information Storage and Retrieval, pp3
00-304, Wiley Computer Publishing, 1997. The method of calculating the similarity between character strings (hereinafter referred to as added DP similarity) by this method is as follows. Here, α and β are character strings, and x and y are character strings having different lengths 1 (characters are also referred to as character strings of length 1 for convenience of description). "" Is a character string of length 0 (hereinafter, an empty character string). The function MAX is a function that calculates a real number from a real number argument, and is a function that calculates the maximum value of the arguments. (The function MAX is also used to calculate other similarities unless otherwise specified.) The same function).

【0011】加算DP類似度SIM1は、引数の文字の部分
に関する一致のパターンに応じて、以下の式を再帰的に
当てはめることで求める。まず、引数の両方が空文字列
のときは、 SIM1("","")=0.0 (1) とする。長さ1文字以下の異なる文字列のときは、 SIM1(x,y)=0.0 (2) とする。先頭の1文字が同じときは、 SIM1(xα,xβ)=MAX(SIM1(α,xβ),SIM1(xα,β),1.0+SIM1(α,β)) (3) とする。先頭の1文字が異なるときは、 SIM1(xα,yβ)=MAX(SIM1(α,yβ),SIM1(xα,β),SIM1(α,β)) (4) とする。式(3)と(4)は、既知のDP手法によって効率的
に計算を行う。
The additional DP similarity SIM 1 is obtained by recursively applying the following equation according to the matching pattern for the character part of the argument. First, when both arguments are empty strings, SIM 1 ("", "") = 0.0 (1). For a different character string having a length of one character or less, SIM 1 (x, y) = 0.0 (2). If the first character is the same, SIM 1 (xα, xβ) = MAX (SIM 1 (α, xβ), SIM 1 (xα, β), 1.0 + SIM 1 (α, β)) (3) If the first character is different, SIM 1 (xα, yβ) = MAX (SIM 1 (α, yβ), SIM 1 (xα, β), SIM 1 (α, β)) (4). Equations (3) and (4) are efficiently calculated by the known DP method.

【0012】文字に重みを加える方法は、例えばH.Berg
hel and D.Roach, An Extension ofUkkonen's Enhanced
Dynamic Programming ASM Algorithm, ACM Transactio
nson Information Systems, Vol.14, No.1, pp.94-106,
January 1996.に開示されている。この方法による文字
列同士の類似度(以下、文字重みDP類似度)の求め方
は、以下の通りである。ここで、α、βを文字列とし、
x、yを長さ1の異なる文字列とする。""は空文字列とす
る。Score(x)は、文字列xから正の実数値を求める関数
とする。
A method of adding weight to a character is described in, for example, H. Berg
hel and D. Roach, An Extension of Ukkonen's Enhanced
Dynamic Programming ASM Algorithm, ACM Transactio
nson Information Systems, Vol.14, No.1, pp.94-106,
January 1996. The method of calculating the similarity between character strings (hereinafter, character weight DP similarity) by this method is as follows. Here, α and β are character strings,
Let x and y be different character strings of length 1. "" Is an empty string. Score (x) is a function for obtaining a positive real value from the character string x.

【0013】文字重みDP類似度SIM2は、引数の文字の
部分に関する一致のパターンに応じて、以下の式を再帰
的に当てはめることで求める。まず、引数の両方が空文
字列のときは、 SIM2("","")=0.0 (5) とする。長さ1の異なる文字列のときは、 SIM2(x,y)=0.0 (6) とする。先頭の1文字が同じときは、 SIM2(xα,xβ)=MAX(SIM2(α,xβ),SIM2(xα,β),Score(x)+SIM2(α,β)) (7) とする。先頭の1文字が異なるときは SIM2(xα,yβ)=MAX(SIM2(α,yβ),SIM2(xα,β),SIM2(α,β)) (8) とする。式(7)と(8)が、既知のDP手法によって効率的
に計算できるのは、加算DP類似度の場合と同様であ
る。
The character weight DP similarity SIM 2 is obtained by recursively applying the following equation according to the matching pattern for the character part of the argument. First, when both arguments are empty strings, SIM 2 ("", "") = 0.0 (5). If the character strings have different lengths, SIM 2 (x, y) = 0.0 (6). When the first character is the same, SIM 2 (xα, xβ) = MAX (SIM 2 (α, xβ), SIM 2 (xα, β), Score (x) + SIM 2 (α, β)) (7) And If the first character is different, SIM 2 (xα, yβ) = MAX (SIM 2 (α, yβ), SIM 2 (xα, β), SIM 2 (α, β)) (8). Equations (7) and (8) can be efficiently calculated by the known DP method, as in the case of the added DP similarity.

【0014】ここで用いたScore(x)関数は、長さ1の文
字列(文字)xの重みを与えている。式(3)と式(7)を比
較して分かるように、Score(x)関数を使って文字に重み
を与える点が、文字重みDP類似度の特徴である。
The Score (x) function used here gives a weight of a character string (character) x having a length of one. As can be seen by comparing Equations (3) and (7), the point of giving weight to a character using the Score (x) function is a feature of the character weight DP similarity.

【0015】[0015]

【発明が解決しようとする課題】形態素解析を用いる方
法は、頻繁に使われる単語を使うと情報検索がうまく行
えないという問題がある。なぜなら、かかる単語は、多
くの文字列にありふれて含まれるので、かかる単語の有
無だけでは、文書を選び出す決め手とはならないからで
ある。また、単語の出現順序が情報検索に反映されてい
ないという問題がある。
The method using morphological analysis has a problem that information retrieval cannot be performed well when frequently used words are used. This is because such words are commonly included in many character strings, and the presence or absence of such words alone is not a deciding factor in selecting a document. Another problem is that the order of appearance of words is not reflected in information retrieval.

【0016】さらに、形態素解析を利用しているので、
この形態素解析が不首尾だと情報検索が不調に終わると
いう本質的な制約を有している。形態素解析の精度を上
げるには、単語辞書や文法規則などが大規模にならざる
を得ず、簡便に情報検索を利用することが難しい。それ
から、流行語、造語、限られた分野でのみ使われる専門
用語が出現する文書では、単語辞書の整備の手間が大き
な負担となる。
Further, since morphological analysis is used,
If this morphological analysis is unsuccessful, there is an inherent restriction that information retrieval will end abnormally. In order to increase the accuracy of morphological analysis, a word dictionary and grammar rules must be large-scale, and it is difficult to use information retrieval easily. In addition, for documents in which buzzwords, coined words, and technical terms used only in limited fields appear, the burden of maintaining a word dictionary is a large burden.

【0017】これに対して、nグラムによる方法は、形
態素解析を要しないので、簡便に利用し得る。しかし、
単語に重点を置かない検索のため、僅かな文字列の不一
致、例えば、単語の活用形の相違でも一致したものとみ
なさず、内容を的確に捉えた検索は困難である。
On the other hand, the method using the n-gram does not require morphological analysis, and can be easily used. But,
Since the search does not focus on the word, it is difficult to perform a search that accurately grasps the content without considering a slight mismatch of character strings, for example, a difference in the inflected form of the word as a match.

【0018】一方、ダイナミックプログラミングによる
方法としてあげた2つの方法のうち、単純加算による方
法は、文字列を1文字ずつ比較をしていき、1文字一致
したら得点として1が加算される。また、文字に重みを
加える方法は、同じく文字列を1文字ずつ比較をしてい
き、1文字一致したら得点を加えるが、1ではなく、文
字による重みが加算される。この方法は、単純加算によ
る方法を発展させたものということができる。
On the other hand, of the two methods listed as the method based on dynamic programming, the method based on simple addition compares character strings one character at a time, and if one character matches, one is added as a score. In addition, a method of adding weight to a character is to compare the character strings one by one, and if one character matches, add a score, but the weight of the character, not 1, is added. This method can be said to be an extension of the simple addition method.

【0019】どちらの方法でも、1文字一致するたび
に、類似度に値が加算される。しかし、前後の文字も一
致したか否かは考慮されていない。そのため、一致した
文字の連続性が加味されず、場合によっては全く異なる
文字列を、完全に一致した文字列と判断してしまう可能
性もある。
In either method, a value is added to the similarity every time one character matches. However, it is not considered whether the characters before and after also match. Therefore, the continuity of the matched characters is not taken into account, and in some cases, a completely different character string may be determined as a completely matched character string.

【0020】本発明は、これらの課題を解決するために
創作されたものであり、文字ではなく、文字列に対して
類似度を与えることでこれらの問題を解決することを目
的としている。
The present invention has been made to solve these problems, and has as its object to solve these problems by giving similarities not to characters but to character strings.

【0021】[0021]

【課題を解決するための手段】かかる目的に対して、第
1の発明は、二つの文字列の類似度を算出する方法にお
いて、前記二つの文字列それぞれにおける順序に適合す
る部分文字列であって、前記二つの文字列に共通する、
部分文字列を複数求め、前記複数求めた部分文字列に対
してそれぞれ重みを定め、前記重みを総和することで類
似度を算出することを特徴とする文字列類似度算出方法
である。
According to a first aspect of the present invention, there is provided a method for calculating a similarity between two character strings, wherein the partial character string conforming to the order of each of the two character strings. And common to the two strings
A character string similarity calculation method, wherein a plurality of partial character strings are obtained, a weight is determined for each of the plurality of obtained partial character strings, and a similarity is calculated by summing the weights.

【0022】第2の発明は、第1の発明において、前記
部分文字列に対する重みが、前記部分文字列を二つ以上
に分割して得られる部分文字列に対する重みの総和より
も、より重い場合があることを特徴とする文字列類似度
算出方法である。
In a second aspect based on the first aspect, the weight of the partial character string is heavier than the sum of the weights of the partial character strings obtained by dividing the partial character string into two or more. There is a character string similarity calculation method characterized by the following.

【0023】第3の発明は、第1又は第2の発明におい
て、前記二つの文字列の一方が文書データベースから選
ばれたものであり、前記重みが、前記文書データベース
における部分文字列の情報量に対応することを特徴とす
る文字列類似度算出方法である。
In a third aspect based on the first or second aspect, one of the two character strings is selected from a document database, and the weight is the information amount of the partial character string in the document database. Is a character string similarity calculation method.

【0024】第4の発明は、第1から第3のいずれかの
発明において、前記重みが、前記文書データベースにお
ける部分文字列の情報量、および部分文字列の出現集中
度に対応することを特徴とする文字列類似度算出方法で
ある。
According to a fourth aspect of the present invention, any one of the first to third aspects is provided.
In the invention, the weight is stored in the document database.
Of substring information and the concentration of occurrence of substrings
Character string similarity calculation method
is there.

【0025】第5の発明は、第1から第4のいずれかの
発明において、前記類似度が最も高くなるように、部分
文字列を分割することなく複数求めることを特徴とする
文字列類似度算出方法である。
According to a fifth aspect of the present invention, in any one of the first to fourth aspects, a plurality of character string similarities are obtained without dividing the partial character string so that the similarity is the highest. This is a calculation method.

【0026】第6の発明は、二つの文字列の類似度を算
出する方法において、前記二つの文字列それぞれにおけ
る順序に適合する部分文字列であって、同義語辞書の要
素に含まれる、部分文字列を複数求め、前記複数求めた
部分文字列に対応する同義語辞書の要素に対してそれぞ
れ重みを定め、前記重みを総和することで類似度を算出
することを特徴とする文字列類似度算出方法である。
According to a sixth aspect of the present invention, in the method for calculating the similarity between two character strings, a partial character string conforming to the order of each of the two character strings is included in an element of the synonym dictionary. Character string similarity, wherein a plurality of character strings are obtained, a weight is determined for each of the elements of the synonym dictionary corresponding to the plurality of obtained partial character strings, and a similarity is calculated by summing up the weights. This is a calculation method.

【0027】第7の発明は、第6の発明において、前記
二つの文字列の一方が文書データベースから選ばれたも
のであり、前記重みが、前記文書データベースにおける
同義語辞書の要素の情報量に対応することを特徴とする
文字列類似度算出方法である。
According to a seventh aspect , in the sixth aspect , one of the two character strings is selected from a document database, and the weight is determined by an information amount of a synonym dictionary element in the document database. This is a character string similarity calculation method that is characterized by being compatible.

【0028】第8の発明は、第6又は第7の発明におい
て、前記二つの文字列が異なる言語で表されており、前
記同義語辞書の要素は、前記異なる言語の同義語を含む
ことを特徴とする文字列類似度算出方法である。
In an eighth aspect based on the sixth or seventh aspect , the two character strings are expressed in different languages, and the elements of the synonym dictionary include synonyms of the different languages. This is a character string similarity calculation method as a feature.

【0029】第9の発明は、第1から第4、第6から第
のいずれかの発明において、前記類似度が最も高くな
るように、部分文字列の分割を許容して複数求めること
を特徴とする文字列類似度算出方法である。
The ninth invention is directed to the first to fourth and sixth to fourth embodiments .
8. A character string similarity calculating method according to any one of the eighth to eighth aspects, wherein a plurality of partial character strings are allowed to be divided so as to obtain the highest similarity.

【0030】第10の発明は、二つの文字列の類似度を
算出する文字列類似度算出装置において、二つの文字列
に共通する部分文字列の重みを定める文字列スコア算出
部と、前記重みに、残りの部分文字列の類似度を加算し
て類似度を求める一致文字列類似度算出部と、二つの文
字列のいずれか又は両方において1文字ずつ減らした文
字列同士の類似度のうち最も高い類似度を求める任意文
字列類似度算出部と、求まった前記類似度のうち最も高
い類似度を選ぶ選択部と、を有することを特徴とする文
字列類似度算出装置である。
According to a tenth aspect , in the character string similarity calculating apparatus for calculating the similarity between two character strings, a character string score calculating unit for determining a weight of a partial character string common to the two character strings; And a matching character string similarity calculating unit that calculates the similarity by adding the similarity of the remaining partial character strings, and the similarity of the character strings reduced by one character in one or both of the two character strings. A character string similarity calculating apparatus, comprising: an arbitrary character string similarity calculating unit that obtains the highest similarity; and a selecting unit that selects the highest similarity among the obtained similarities.

【0031】第11の発明は、第10の発明において、
前記二つの文字列の一方が文書データベースから選ばれ
たものであり、前記重みが、前記文書データベースにお
ける部分文字列の情報量に対応することを特徴とする文
字列類似度算出装置である。
According to an eleventh aspect , in the tenth aspect ,
A character string similarity calculating apparatus, wherein one of the two character strings is selected from a document database, and the weight corresponds to an information amount of a partial character string in the document database.

【0032】第12の発明は、第11の発明において、
前記重みが、前記文書データベースにおける部分文字列
の情報量、および部分文字列の出現集中度に対応するこ
とを特徴とする文字列類似度算出装置である。
According to a twelfth aspect, in the eleventh aspect,
The weight is a partial character string in the document database.
Information volume and the degree of concentration of substrings
And a character string similarity calculation device.

【0033】第13の発明は、二つの文字列の類似度を
算出する文字列類似度算出装置において、二つの文字列
の部分文字列であって、同義語辞書の要素に含まれる、
部分文字列に対応する同義語辞書の要素の重みを定める
同義語スコア算出部と、前記重みに、残りの部分文字列
の類似度を加算して類似度を求める一致文字列類似度算
出部と、二つの文字列のいずれか又は両方において1文
字ずつ減らした文字列同士の類似度のうち最も高い類似
度を求める任意文字列類似度算出部と、求まった前記類
似度のうち最も高い類似度を選ぶ選択部と、を有するこ
とを特徴とする文字列類似度算出装置である。
According to a thirteenth aspect , in the character string similarity calculating apparatus for calculating the similarity between two character strings, a partial character string of the two character strings is included in an element of the synonym dictionary.
A synonym score calculating unit that determines the weight of an element of the synonym dictionary corresponding to the partial character string, and a matching character string similarity calculating unit that calculates the similarity by adding the similarity of the remaining partial character strings to the weight. An arbitrary character string similarity calculating unit for obtaining the highest similarity among the character strings reduced by one character in one or both of the two character strings, and the highest similarity among the obtained similarities And a selecting unit for selecting a character string similarity.

【0034】第14の発明は、第13の発明において前
記二つの文字列の一方が文書データベースから選ばれた
ものであり、前記重みが、前記文書データベースにおけ
る同義語辞書の要素の情報量に対応することを特徴とす
る文字列類似度算出装置である。
According to a fourteenth aspect , in the thirteenth aspect , one of the two character strings is selected from a document database, and the weight corresponds to an information amount of a synonym dictionary element in the document database. This is a character string similarity calculation device characterized in that:

【0035】第15の発明は、検索文章に類似した文書
を文書データベースの中から選ぶ文章検索装置であっ
て、前記検索文章と、前記文書データベースの中の文書
を、二つの文字列として第10から第14のいずれかの
発明である文字列類似度算出装置により類似度を求め、
前記求めた類似度が高い文書を、文書データベースの中
から選ぶことを特徴とする文書検索装置である。
A fifteenth invention is a text search apparatus for selecting a document similar to a search text from a document database, wherein the search text and the document in the document database are converted into two character strings in a tenth character string . A similarity calculated by the character string similarity calculating apparatus according to the fourteenth aspect of the present invention,
A document search apparatus characterized in that a document having a high degree of similarity is selected from a document database.

【0036】第16の発明は、二つの文字列の類似度を
算出する文字列類似度算出プログラムであって、前記二
つの文字列を対比させる部分を逐次設定する対比設定過
程と、前記対比させる部分から始まる部分文字列であっ
て、二つの文字列に共通する部分文字列を特定する共通
部分文字列特定過程と、前記特定された部分文字列の重
みを定める文字列スコア設定過程と、前記重みを類似度
に加算する文字列スコア加算過程と、類似度が高くなる
ようにこれらの過程を進める進行処理過程とをコンピュ
ータに実行させるための文字列類似度算出プログラムを
記録したコンピュータ読み取り可能な記録媒体である。
A sixteenth invention is a character string similarity calculation program for calculating the similarity between two character strings, wherein a comparison setting step of sequentially setting a part for comparing the two character strings is performed. A partial character string starting from a part, a common partial character string specifying step of specifying a partial character string common to the two character strings, a character string score setting step of determining a weight of the specified partial character string, A computer readable recording of a character string similarity calculation program for causing a computer to execute a character string score adding step of adding weight to the similarity and a progress processing step of advancing these steps to increase the similarity. It is a recording medium.

【0037】第17の発明は、第16の発明に記載の文
字列類似度算出プログラムにおいて、前記二つの文字列
の一方が文書データベースから選ばれたものであり、前
記重みが、前記文書データベースにおける部分文字列の
情報量に対応することを特徴とする文字列類似度算出プ
ログラムを記録したコンピュータ読み取り可能な記録媒
体である。
According to a seventeenth aspect , in the character string similarity calculation program according to the sixteenth aspect , one of the two character strings is selected from a document database, and the weight is set in the document database. This is a computer-readable recording medium that records a character string similarity calculation program, which corresponds to the information amount of a partial character string.

【0038】第18の発明は、第17の発明に記載の文
字列類似度算出プログラムにおいて、前記重みが、前記
文書データベースにおける部分文字列の情報量、および
部分文字列の出現集中度に対応することを特徴とする文
字列類似度算出プログラムを記録したコンピュータ読み
取り可能な記録媒体である。
According to an eighteenth aspect, a sentence according to the seventeenth aspect is provided.
In the character string similarity calculation program, the weight may be
The amount of substring information in the document database, and
Sentence characterized by corresponding to the occurrence concentration of substring
Computer reading recorded character string similarity calculation program
It is a removable recording medium.

【0039】第19の発明は、第17又は第18の発明
に記載の文字列類似度算出プログラムにおいて、前記文
字列スコア設定過程が、サフィックスファイルを利用し
て前記情報量を求めることを特徴とする文字列類似度算
出プログラムを記録したコンピュータ読み取り可能な記
録媒体である。
A nineteenth invention is directed to the character string similarity calculation program according to the seventeenth or eighteenth invention, wherein
The character string score setting step is a computer readable recording medium storing a character string similarity calculation program, wherein the information amount is obtained by using a suffix file.

【0040】第20の発明は、二つの文字列の類似度を
算出する文字列類似度算出プログラムであって、前記二
つの文字列を対比させる部分を逐次設定する対比設定過
程と、前記対比させる部分から始まる部分文字列であっ
て、同義語辞書の要素に含まれる部分文字列を特定する
同義語特定過程と、前記特定された部分文字列に対応す
る同義語辞書の要素の重みを定める同義語スコア設定過
程と、前記重みを類似度に加算する同義語スコア加算過
程と、類似度が高くなるようにこれらの過程を進める進
行処理過程とをコンピュータに実行させるための文字列
類似度算出プログラムを記録したコンピュータ読み取り
可能な記録媒体である。
A twentieth aspect of the present invention is a character string similarity calculation program for calculating the similarity between two character strings, wherein a comparison setting step for sequentially setting a part for comparing the two character strings is performed. A synonym specifying step of specifying a substring that is a substring starting from a part and included in an element of the synonym dictionary, and synonym determining a weight of an element of the synonym dictionary corresponding to the specified substring. A character string similarity calculation program for causing a computer to execute a word score setting step, a synonym score adding step of adding the weight to the similarity, and a progress processing step of advancing these steps to increase the similarity. Is a computer-readable recording medium having recorded thereon.

【0041】第21の発明は、第20の発明に記載の文
字列類似度算出プログラムにおいて、前記二つの文字列
の一方が文書データベースから選ばれたものであり、前
記重みが、前記文書データベースにおける同義語辞書の
要素の情報量に対応することを特徴とする文字列類似度
算出プログラムを記録したコンピュータ読み取り可能な
記録媒体である。
[0041] 21 invention, in string similarity calculation program according to the twentieth aspect of the present invention, which one of the two strings is selected from the document database, the weight is in the document database A computer-readable storage medium storing a character string similarity calculation program, which corresponds to the information amount of elements of a synonym dictionary.

【0042】第22の発明は、第21の発明に記載の文
字列類似度算出プログラムにおいて、前記同義語スコア
設定過程が、サフィックスファイルを利用して前記情報
量を求めることを特徴とする文字列類似度算出プログラ
ムを記録したコンピュータ読み取り可能な記録媒体。
The twenty-second aspect of the present invention, the string similarity calculation program according to the twenty-first aspect, the synonym score
A computer-readable recording medium recording a character string similarity calculation program, wherein the setting step obtains the information amount using a suffix file.

【0043】第23の発明は、第16から第22のいず
れかの発明に記載の文字列類似度算出プログラムにおい
て、前記進行処理過程がダイナミックプログラミング手
法によることを特徴とする文字列類似度算出プログラム
を記録したコンピュータ読み取り可能な記録媒体であ
る。
The twenty-third invention, in the string similarity calculation program according sixteenth to any one of aspects 22, string similarity calculation program the traveling process is characterized in that with dynamic programming techniques Is a computer-readable recording medium having recorded thereon.

【0044】第24の発明は、検索文章に類似した文書
を文書データベースの中から選ぶ文章検索プログラムで
あって、前記検索文章と、前記文章データベースの中の
文書を、二つの文字列として第16から第23のいずれ
かの発明に記載の文字列類似度算出プログラムにより類
似度を求め、前記求めた類似度が高い文書を、文書デー
タベースの中から選ぶことをコンピュータに実行させる
ための文書検索プログラムを記録したコンピュータ読み
取り可能な記録媒体である。
A twenty-fourth aspect of the present invention is a text search program for selecting a document similar to a search text from a document database, wherein the search text and the document in the text database are converted into two character strings as a sixteenth character string . A document search program for causing a computer to calculate similarity by the character string similarity calculation program according to any one of the twenty-third to twenty-third aspects, and to select, from a document database, a document having the high calculated similarity. Is a computer-readable recording medium having recorded thereon.

【0045】[0045]

【発明の実施の形態】(第1実施例)DESCRIPTION OF THE PREFERRED EMBODIMENTS (First Embodiment)

【0046】まず、本発明による第1の類似度(以下で
は、文字列重みDP類似度と呼ぶ)を求める式を説明す
る。
First, an expression for obtaining a first similarity (hereinafter, referred to as a character string weight DP similarity) according to the present invention will be described.

【0047】α、β、γ、δを長さ0以上の文字列と
し、ξを長さ1以上の文字列とし、""を空文字列とす
る。また、x、yとzを長さ1の文字列とする。複数の文
字列(例えば、γとδ)を繋げた文字列(例えば、ξ)
は、要素となる文字列の記号を続けて書くことで示す
(例えば、ξ=γδ)。
Α, β, γ, and δ are character strings having a length of 0 or more, ξ is a character string having a length of 1 or more, and “” is an empty character string. Also, let x, y and z be character strings of length 1. A character string (for example, ξ) connecting a plurality of character strings (for example, γ and δ)
Is indicated by writing a symbol of a character string to be an element successively (for example, ξ = γδ).

【0048】文字列重みDP類似度SIM3は、引数の文字
の部分に関する一致のパターンに応じて、以下の式を再
帰的に当てはめることで求める。まず、両方とも空文字
のときは、 SIM3("","")=Score("") (9) とする。それ以外のときは、 SIM3(α,β)=MAX(SIM3s(α,β), SIM3g(α,β)) (10) とする。
The character string weight DP similarity SIM 3 is obtained by recursively applying the following expression according to the matching pattern for the character part of the argument. First, when both are empty characters, SIM 3 ("", "") = Score ("") (9). Otherwise, SIM 3 (α, β) = MAX (SIM 3s (α, β), SIM 3g (α, β)) (10).

【0049】ここで、SIM3sは、一致している最大の文
字列をξとして、 SIM3s(ξα,ξβ)=MAX(Score(γ)+SIM3(δα, δβ)) (11) がξ=γδとなる全てのγとδに関して成り立つように
求め、そのような文字列ξが存在しないときは、 SIM3s(α,β)=0.0 (12) とする。
Here, SIM 3s is defined as follows: SIM 3s (ξα, ξβ) = MAX (Score (γ) + SIM 3 (δα, δβ)) (11) It is determined to hold for all γ and δ that become γδ, and if there is no such character string ξ, SIM 3s (α, β) = 0.0 (12).

【0050】また、SIM3gは、任意の文字列について SIM3g(xα,yβ)=MAX(SIM3(α,yβ),SIM3(xα,β),SIM3(α,β)) (13) とする。この式は、二つの文字列(xαとyβ)のいずれ
か又は両方において1文字ずつ減らした残りに相当する
文字列同士(αとyβ、xαとβ、αとβ)の類似度のう
ち、最も高い類似度を採用することを意味する。
Further, SIM 3g is obtained by calculating SIM 3g (xα, yβ) = MAX (SIM 3 (α, yβ), SIM 3 (xα, β), SIM 3 (α, β)) for an arbitrary character string. ). This expression is the similarity between the character strings (α and yβ, xα and β, and α and β) corresponding to the rest of one or both of the two character strings (xα and yβ) reduced by one character. This means that the highest similarity is adopted.

【0051】以上の式を再帰的に適用することで、二つ
の文字列それぞれの順序に適合する共通の部分文字列が
複数求められ、かつ、類似度が最大となる。この際、式
(11)から分かるように、共通の部分文字列をさらに分割
することを許容している。本実施例で示した文字列重み
DP類似度は、従来技術で示した文字重みDP類似度に
比べると、文字列の重み(以下、文字列スコア)を示す
Score関数の定義域が、文字(長さ1の文字列)ではな
く、長さ1以上の文字列になっている点に、特徴があ
る。
By applying the above expression recursively, a plurality of common partial character strings conforming to the respective orders of the two character strings are obtained, and the similarity is maximized. At this time, the formula
As can be seen from (11), the common partial character string is allowed to be further divided. The character string weight DP similarity shown in the present embodiment indicates a character string weight (hereinafter, character string score) as compared with the character weight DP similarity shown in the related art.
The feature is that the domain of the Score function is not a character (a character string of length 1) but a character string of length 1 or more.

【0052】文書の総数をNとし、df(ξ)を文字列ξを
含む文書の数とし、Lを文字列ξの長さとする。文字列
に重みを与えるScore(ξ)関数は、ξが空文字のとき
は、 Score("")=0.0 (14) とし、ξが空文字でないときは、 Score(ξ)=L×idf(ξ)=L×log2(N/df(ξ)) (15) とすることで、実施できる。
It is assumed that the total number of documents is N, df (ξ) is the number of documents including the character string 、, and L is the length of the character string ξ. The Score (ξ) function that weights the character string is as follows: Score (“”) = 0.0 (14) when ξ is an empty character, and Score (ξ) = L × idf (ξ) when ξ is not an empty character. = L × log 2 (N / df (ξ)) (15).

【0053】ここで、idf(ξ)は、情報理論で言うとこ
ろの、ξの情報量に対応する値となっている。すなわ
ち、総数がNの文書の中から、df(ξ)個の文書を特定す
るのに必要なビット数log2(N/df(ξ))に、対応してい
る。これは、多くの文書に現れる文字列は検索に有益で
はなく、逆に少ない文書に現れる文字列は検索に有益で
あるという性質を反映したものである。
Here, idf (ξ) is a value corresponding to the information amount of ξ in information theory. That is, it corresponds to the number of bits log 2 (N / df (ξ)) required to specify df (ξ) documents from among the documents having the total number N. This reflects the property that character strings appearing in many documents are not useful for searching, and conversely, character strings appearing in few documents are useful for searching.

【0054】Score関数は、上式に限らず、文字列に関
する非負の関数であって、文字列が長い程、単純に加算
するよりも値が増える傾向を有していれば実施できる。
すなわち、2つの文字列zとγを繋げたzγに関して、 Score(zγ)>Score(z)+Score(γ) (16) が成り立つものであれば良い。つまり、部分文字列の重
み(例えば、Score(zγ))が、部分文字列を二つ以上
に分割して得られる部分文字列に対する重みの総和(例
えば、二つに分割するならScore(z)+Score(γ))より
も、より重ければ良い。この式(16)の不等号が成り立つ
ことにより、文字列重みDP類似度は、より長い文字列
で一致するほど、より類似度が高いという性質を有す
る。
The Score function is not limited to the above formula, but is a non-negative function relating to a character string. The function can be implemented as long as the character string has a tendency to increase in value as compared to simple addition.
That is, it is sufficient that Score (zγ)> Score (z) + Score (γ) (16) holds for zγ connecting two character strings z and γ. That is, the weight of the partial character string (for example, Score (zγ)) is the sum of the weights of the partial character strings obtained by dividing the partial character string into two or more (for example, Score (z) + Score (γ)). By the inequality of the expression (16) being satisfied, the character string weight DP similarity has a property that the similarity is higher as the match is made with a longer character string.

【0055】より詳細には、Score関数は文字列重みD
P類似度を求める際に何度も使用される。式(16)は、最
終的な文字列重みDP類似度に対して寄与したScore関
数の総合的な性質として成り立てば、本発明は実施でき
る。そのため、式(16)の不等号が成り立たない場合を含
んでいても良い。
More specifically, the Score function calculates the character string weight D
Used many times to determine the P similarity. The present invention can be implemented if Expression (16) is established as an overall property of the Score function that has contributed to the final character string weight DP similarity. Therefore, a case where the inequality expression (16) does not hold may be included.

【0056】例えば、一般的には、長い文字列zγより
も短い文字列zとγの方が、文書に出現する回数が多い
ため式(16)が成り立つ。ところが、文字列zもγもzγ
も同じ回数だけ文書に出現する場合は、 Score(zγ)=Score(z)+Score(γ) (17) となる。
For example, in general, the character strings z and γ, which are shorter than the long character string zγ, appear in the document more frequently, so that Expression (16) holds. However, the character strings z and γ are both zγ
If the same number of times appears in the document, Score (zγ) = Score (z) + Score (γ) (17)

【0057】また、長い文字列zγが文書に稀に(例え
ば1回)しか出現しない場合は、それは単語ではなく、
検索に役立たないかもしれない。かかる場合は、Score
(zγ)=0.0とすると、検索に有益である。しかし、文
字列zと文字列γが文書に頻繁に出現するなら、 Score(zγ)<Score(z)+Score(γ) (18) となる。
When a long character string zγ rarely appears (for example, once) in a document, it is not a word, but
May not be useful for search. In such cases, Score
Setting (zγ) = 0.0 is useful for searching. However, if the character string z and the character string γ frequently appear in the document, Score (zγ) <Score (z) + Score (γ) (18).

【0058】この様に、式(17)、式(18)が成り立つ場合
が含まれていても、一般的に、式(16)が成り立っている
ので、式(15)によって本発明は実施できる。
As described above, even when the cases where the expressions (17) and (18) are satisfied, since the expression (16) is generally satisfied, the present invention can be implemented by the expression (15). .

【0059】また、Score関数は、文字列の情報量およ
び出現集中度に対応させるのでも良い。例えば、データ
ベース中の特定の文書に文字列が集中して出現する度合
いを示す値として、出現集中度W(ξ)を W(ξ)=(df2 (ξ)/df1 (ξ))/(df1 (ξ)/N) (36) で定義する。ただし、df1 (ξ)=0のときは、 W(ξ)=0.0 (37) とする。そして、式(15)のScore(ξ)の代わりに、W(ξ)
≧Kならば、 Score(ξ)=idf(ξ) (38) とし、W(ξ)<Kならば Score(ξ)=0.0 (39) とすることでも、本発明は実施できる。ただし、Kは正
の実定数(例えば、2.0)であり、df1 (ξ)はdf(ξ)と同
じく、文字列ξを含む文書の数を示し、df2 (ξ)は文字
列ξを2つ以上含む文書の数を示す。
The Score function calculates the information amount of a character string and
Or the degree of appearance concentration. For example, data
Degree of occurrence of the character string concentrated in a specific document in the base
As a value indicating the degree of appearance, the degree of appearance concentration W (ξ) is defined as W (ξ) = (df 2 (ξ) / df 1 (ξ)) / (df 1 (ξ) / N) (36) . However, when df 1 (ξ) = 0, W (ξ) = 0.0 (37) . Then, instead of Score (ξ) in equation (15), W (ξ)
If ≧ K, Score (ξ) = idf (ξ) (38) , and if W (ξ) <K, Score (ξ) = 0.0 (39) , the present invention can be implemented. Where K is positive
Df 1 (ξ) is the same as df (ξ).
The number of documents containing the character string ξ, df 2 (ξ)
Indicates the number of documents containing two or more columns ξ.

【0060】この出現集中度は、ある文字列がある文書
にどのくらいの集中度で出現するかを表しており、通常
の文字列であれば式(36)の値は1.0に近い値となる。と
ころが、検索に有効な文字列(キーワード、主題を表す
文字列、技術論分の場合は専門用語)は、ある文書にひ
とたびその文字列が出現すると、同じ文書に2回以上出
現する確率が高い。そのため、式(36)の値は1.0より十
分大きな値になるという性質を有する。従って、出現集
中度により、式(38)と式(39)を切り換えることによっ
て、検索により有効な文字列をより多くScoreへ寄与さ
せることができ、検索精度を向上することができる。こ
れは、Score関数が、文書データベースにおける部分文
字列の出現集中度に応じて、情報量を加算して得られる
ようにした例である。
The degree of appearance concentration is based on a document having a certain character string.
The degree of concentration that appears in
If the character string is, the value of Expression (36) is a value close to 1.0. When
Rolls are valid strings for search (keywords,
Text, or technical terminology for technical discussions)
When that character string appears, it appears twice or more in the same document.
High probability of appearing. Therefore, the value of equation (36) is less than 1.0.
It has the property that the value becomes larger. Therefore, the appearance collection
By switching between Equation (38) and Equation (39),
Search to provide more effective strings to Score
And the search accuracy can be improved. This
This is because the Score function is a sub-sentence in the document database.
It can be obtained by adding the amount of information according to the appearance concentration of the character string
This is an example.

【0061】Score関数への情報量と出現集中度の対応
のさせ方は上記の例に限らず、種々の変形が可能であ
る。例えば出現集中度を使う他の実施例としては、式(3
8)と式(39)の代わりに、W(ξ)≧1の時は、 Score(ξ)=log2 (W(ξ))×idf(ξ) (40) W(ξ)<1の時は、 Score(ξ)=0.0 (41) とすることができる。このようにidf(ξ)とW(ξ)の値に
対応してScore関数が定まる。その結果、検索により有
効な文字列をより多くScoreへ寄与させることができ、
検索精度を向上することができる。
Correspondence of Information Amount and Appearance Concentration to Score Function
The method of applying is not limited to the above example, and various modifications are possible.
You. For example, as another embodiment using the degree of occurrence concentration, the expression (3
8) and Equation (39), when W (ξ) ≧ 1, Score (ξ) = log 2 (W (ξ)) × idf (ξ) (40) When W (ξ) <1 Can be set as Score (ξ) = 0.0 (41) . Thus, the values of idf (ξ) and W (ξ)
Score function is determined correspondingly. As a result,
More effective strings can contribute to Score,
Search accuracy can be improved.

【0062】なお、以上では、類似度を示す値は0以上
であって、値が大きいほど類似度が高い場合で説明し
た。もし、類似度の値と類似度の高さの対応関係を変え
るなら、Score関数は非負の関数に限られなくなる。例
えば、類似度の値が小さいほど類似度も高いとするな
ら、式(15)の符号を反転させたScore関数で実施でき
る。この場合は、式(16)の符号は逆向きになり、MAX関
数の代わりに、引数のうちで最小の値を求める関数MIN
を使う。この様に類似度を示す値の性質によって、実施
態様も異なるが、以下では、類似度を示す値は0以上で
あって、値が大きいほど類似度が高い場合で代表して説
明する。
In the above description, the value indicating the similarity is 0 or more, and the larger the value, the higher the similarity. If the correspondence between the value of the similarity and the height of the similarity is changed, the Score function is not limited to a non-negative function. For example, if it is assumed that the smaller the value of the similarity is, the higher the similarity is, it can be implemented by a Score function in which the sign of Expression (15) is inverted. In this case, the sign of equation (16) is reversed, and instead of the MAX function, the function MIN that calculates the minimum value of the arguments is used.
use. As described above, although the embodiment differs depending on the nature of the value indicating the similarity, the following description will be made on the assumption that the value indicating the similarity is 0 or more, and the larger the value, the higher the similarity.

【0063】次に、文字列重みDP類似度により、入力
された文字列と最も類似度の高い文書を検索する文書検
索装置の実施例を図1に示す。この文書検索装置は、文
書データベース10、文字列入力部11、検索制御部1
2、検索結果出力部13、類似度算出部14、及び、再
帰実行制御部15から構成されている。
Next, FIG. 1 shows an embodiment of a document search apparatus for searching for a document having the highest similarity to an input character string by using a character string weight DP similarity. This document search device includes a document database 10, a character string input unit 11, a search control unit 1,
2. It comprises a search result output unit 13, a similarity calculation unit 14, and a recursive execution control unit 15.

【0064】文書データベース10には、検索対象とな
る複数の文書10a、10b、…、10cが登録されて
いる。検索のためには、キーワード、語、語句、文、文
章などを入力する(以下、代表して検索文章と呼ぶ)。
文字列入力部11は、検索文章を文字列aとして類似度
算出部14に与える。検索制御部12は、文書10a、
10b、…、10cを順に取り出し、文字列bとして、
類似度算出部14に与える。検索結果出力部13は、類
似度算出部14から得られた類似度が最も高い文書を選
択し、検索結果として出力する。検索結果出力部13が
選択して出力する文書は、最も類似度の高い1つの文書
だけではなく、類似度が所定の値以上の文書を全て、あ
るいは、類似度の高い順に選んだ所定の数の文書するの
でも良い。
In the document database 10, a plurality of documents 10a, 10b,..., 10c to be searched are registered. For the search, a keyword, a word, a phrase, a sentence, a sentence, and the like are input (hereinafter, referred to as a search sentence).
The character string input unit 11 gives the search sentence to the similarity calculation unit 14 as a character string a. The search control unit 12 includes a document 10a,
.., 10c are taken out in order, and as a character string b,
This is given to the similarity calculation unit 14. The search result output unit 13 selects a document having the highest similarity obtained from the similarity calculation unit 14 and outputs it as a search result. The search result output unit 13 selects and outputs not only one document having the highest similarity but also all the documents whose similarity is equal to or more than a predetermined value, or a predetermined number of documents selected in descending order of similarity. You can also write a document.

【0065】類似度算出部14は、式(9)又は(10)に基
づいて、類似度を算出する。この類似度を算出する途中
で、一部分の文字列について同様に類似度を求める必要
がある。これは、再帰実行制御部15により、類似度算
出部14を繰り返し用いることで実施する。式(10)〜(1
3)の記号の表記に従って説明するため、図1では、同じ
文字列に対して異なる記号を割り当て直している部分が
ある。例えば、類似度算出部14が最初に受け取る文字
列aとbは、類似度算出部14の中ではαとβで示してい
る(以下、同様)。文字列を分離するに従って、類似度
算出部14は繰り返し用いるが、その際に受け取る文字
列α、βは、最初に受け取る文字列a、bとは異なってく
る。
The similarity calculator 14 calculates the similarity based on the equation (9) or (10). In the process of calculating the similarity, it is necessary to similarly calculate the similarity for a part of the character string. This is performed by the recursive execution control unit 15 using the similarity calculation unit 14 repeatedly. Expressions (10) to (1
In order to explain according to the notation of the symbol of 3), there is a portion in FIG. 1 where different symbols are reassigned to the same character string. For example, the character strings a and b received first by the similarity calculation unit 14 are represented by α and β in the similarity calculation unit 14 (the same applies hereinafter). As the character strings are separated, the similarity calculation unit 14 is used repeatedly, but the character strings α and β received at this time are different from the character strings a and b received first.

【0066】類似度算出部14は、一致文字列類似度算
出部21、任意文字列類似度算出部22、最大値選択部
23により実施されている。一致文字列類似度算出部2
1は、式(10)のSIM3s(α,β)を算出する。任意文字列類
似度算出部22は、式(10)のSIM3g(α,β)を算出する。
最大値選択部23は、これらに対して関数MAXを実施す
ることで、式(10)のSIM3(α,β)を算出する。なお、類
似度算出部14の受け取った文字列α、βの両方が空文
字のときは、再帰実行制御部15によりSIM3(α,β) =
0.0とする。この際、一致文字列類似度算出部21、任
意文字列類似度算出部22、最大値選択部23は動作さ
せない。言うまでもなく、このSIM3(α,β) =0.0とい
う値は、式(9)と(14)を実施するものである。
The similarity calculating section 14 is implemented by a matching character string similarity calculating section 21, an arbitrary character string similarity calculating section 22, and a maximum value selecting section 23. Matching character string similarity calculator 2
1 calculates SIM 3s (α, β) in equation (10). The arbitrary character string similarity calculation unit 22 calculates SIM 3g (α, β) in Expression (10).
The maximum value selection unit 23 calculates SIM 3 (α, β) in Expression (10) by performing the function MAX on these. When both of the character strings α and β received by the similarity calculation unit 14 are empty characters, the recursive execution control unit 15 sets SIM 3 (α, β) =
Set to 0.0. At this time, the matching character string similarity calculating unit 21, the arbitrary character string similarity calculating unit 22, and the maximum value selecting unit 23 are not operated. Needless to say, this value of SIM 3 (α, β) = 0.0 implements equations (9) and (14).

【0067】一致文字列類似度算出部21は、文字列分
離制御部31、文字列分離類似度算出部32、最大値選
択部33により実施されており、式(11)のSIM3s(ξα,
ξβ)を算出する。文字列分離類似度算出部32は、文
字列分離部41、文字列スコア算出部42、類似度算出
部43、加算部44により実施されている。
The matching character string similarity calculation unit 21 is implemented by a character string separation control unit 31, a character string separation similarity calculation unit 32, and a maximum value selection unit 33, and SIM 3s (ξα,
ξβ) is calculated. The character string separation similarity calculation unit 32 is implemented by a character string separation unit 41, a character string score calculation unit 42, a similarity calculation unit 43, and an addition unit 44.

【0068】まず、文字列分離制御部31は、一致文字
列類似度算出部21が受け取った文字列ξα、ξβにお
いて、一致する文字列ξがない場合、すなわち、一致す
る文字列ξが空文字列の場合は、式(12)に従い、SIM
3s(ξα,ξβ)=0.0とする。この場合、文字列分離類似
度算出部32、最大値選択部33は動作させない。
First, the character string separation control unit 31 determines if there is no matching character string に お い て in the character strings ξα and ξβ received by the matching character string similarity calculating unit 21, that is, if the matching character string ξ is an empty character string In the case of, according to equation (12), SIM
3s (ξα, ξβ) = 0.0. In this case, the character string separation similarity calculation unit 32 and the maximum value selection unit 33 are not operated.

【0069】次に、文字列分離制御部31は、一致文字
列類似度算出部21が受け取った文字列ξα、ξβにお
いて、一致する文字列ξがある場合は、ξ=γδとなる
全てのγとδに関して、文字列分離類似度算出部32を
動作させて、式(11)に含まれるScore(γ)+SIM3(δα,
δβ)を計算させる。そして、最も大きな値を最大値選
択部33により選択する。このことにより、式(11)に示
すSIM3s(ξα,ξβ)が求まる。
Next, if there is a matching character string 、 in the character strings ξα and ξβ received by the matching character string similarity calculating section 21, the character string separation control section 31 sets all γs in which ξ = γδ. And δ, the character string separation similarity calculation unit 32 is operated, and Score (γ) + SIM 3 (δα,
δβ). Then, the largest value is selected by the maximum value selector 33. Thereby, SIM 3s (ξα, ξβ) shown in Expression (11) is obtained.

【0070】文字列分離部41は、文字列ξをγとδに
分離して、γを文字列スコア算出部42に与え、δαと
δβを類似度算出部43に与える。文字列スコア算出部
42は、式(15)に基づき、文書データベース10を参照
して式(11)のScore(γ)を算出する。類似度算出部43
は、式(11)のSIM3(δα,δβ)を算出する。類似度算出
部43は、実際には、再帰実行制御部15により、類似
度算出部14をδαとδβに対して適用することで、実
施する。加算部44は、式(11)の加算を行う。
The character string separating section 41 separates the character string に into γ and δ, gives γ to the character string score calculating section 42, and gives δα and δβ to the similarity calculating section 43. The character string score calculation unit 42 calculates Score (γ) of Expression (11) with reference to the document database 10 based on Expression (15). Similarity calculator 43
Calculates SIM 3 (δα, δβ) in equation (11). The similarity calculation unit 43 is actually implemented by the recursion execution control unit 15 applying the similarity calculation unit 14 to δα and δβ. The adding unit 44 performs addition of Expression (11).

【0071】任意文字列類似度算出部22は、類似度算
出部51〜53、最大値選択部54により実施されてお
り、式(13)のSIM3g(xα,yβ)を算出する。受け取った文
字列xα、yβの先頭の1文字x、yの有無に関する各場合
に対応して、類似度算出部51、52、53は、それぞ
れ式(13)のSIM3(α,yβ)、SIM3(xα,β)、SIM3(α,β)
を求める。類似度算出部51〜53は、実際には、再帰
実行制御部15により、類似度算出部14を、αとy
β、xαとβ、αとβのそれぞれに対して適用すること
で、実施する。最大値選択部54は、式(13)の関数MAX
を実施する。
The arbitrary character string similarity calculating section 22 is implemented by the similarity calculating sections 51 to 53 and the maximum value selecting section 54, and calculates SIM 3g (xα, yβ) of the equation (13). Corresponding to each case regarding the presence or absence of the first character x, y of the received character strings xα, yβ, the similarity calculation units 51, 52, and 53 respectively calculate SIM 3 (α, yβ), SIM 3 (xα, β), SIM 3 (α, β)
Ask for. Actually, the similarity calculation units 51 to 53 use the recursion execution control unit 15 to set the similarity calculation unit 14 to α and y
This is implemented by applying to each of β, xα and β, and α and β. The maximum value selection unit 54 calculates the function MAX of Expression (13).
Is carried out.

【0072】なお、文字列スコア算出部42は、式(15)
の代わりに、式(36)から(39)、または、式(36)と式(40)
から(41)を用いてScore(γ)を算出することでも、本発
明は実施できる。
Note that the character string score calculation unit 42 calculates the expression (15)
Instead of (36) to (39), or (36) and (40)
By calculating Score (γ) using (41) from
Ming can be implemented.

【0073】(第2実施例)(Second Embodiment)

【0074】第1実施例では、最大の値を求める関数MA
Xを用いているが、これ以外に何らかの代表を行う関数
に変形することができる。例えば、Score(ξ)に、最大
長の文字列の寄与が全体の値を決定するという性質があ
れば、下記の式を再帰的に適用して類似度を求めること
で本発明は実施できる。式(15)に示すScore関数は、こ
の性質を有するので、本実施例においても適用できる。
下記の式(21)は、式(11)のScore(γ)を、一致している
最大長の文字列ξに関するScore(ξ)で代表することに
よって、関数MAXを省いたものである。この実施例は、
連続して一致している文字列ξがあれば、それをさらに
細かく分割することなく、重みScore(ξ)を与える点に
特徴がある。そのため、この実施例は第1実施例に比べ
て計算量が少なく、類似度SIM3aは、第1実施例によるS
IM3の近似となっている。つまり、類似度SIM3aは、SIM3
に比べると、多少の誤差は伴うけれども、計算量を大き
く減らせるという利点がある。
In the first embodiment, the function MA for finding the maximum value
Although X is used, it can be transformed into a function that performs some other representation. For example, if Score (ξ) has a property that the contribution of the character string having the maximum length determines the overall value, the present invention can be implemented by recursively applying the following expression to obtain the similarity. The Score function shown in Expression (15) has this property, and therefore can be applied to the present embodiment.
Expression (21) below eliminates the function MAX by representing Score (γ) in Expression (11) with Score (ξ) relating to the matching maximum length character string ξ. This example is
The feature is that if there is a continuously matching character string ξ, the weight Score (ξ) is given without further dividing the character string ξ. Therefore, this embodiment requires a smaller amount of calculation than the first embodiment, and the similarity SIM 3a is the same as that of the first embodiment.
IM 3 approximation. That is, the similarity SIM 3a is the SIM 3
Compared to, there is an advantage that the amount of calculation can be greatly reduced, though some errors are involved.

【0075】まず、両方とも空文字のときは、 SIM3a("","")=Score("") (19) とする。それ以外のときは、 SIM3a(α,β)=MAX(SIM3as(α,β), SIM3ag(α,β)) (20) とする。First, when both are empty characters, SIM 3a ("", "") = Score ("") (19) Otherwise, SIM 3a (α, β) = MAX (SIM 3as (α, β), SIM 3ag (α, β)) (20).

【0076】ここで、SIM3asは、一致している最大の文
字列をξとして、 SIM3as(ξα,ξβ)=Score(ξ)+SIM3a(α, β) (21) で求め、そのような文字列ξが存在しないときは、 SIM3as(α,β)=0.0 (22) とする。
Here, SIM 3as finds the maximum matching character string as ξ, and obtains SIM 3as (ξα, ξβ) = Score (ξ) + SIM 3a (α, β) (21). If the character string 存在 does not exist, SIM 3as (α, β) = 0.0 (22).

【0077】また、SIM3agは、任意の文字列について SIM3ag(xα,yβ)=MAX(SIM3a(α,yβ),SIM3a(xα,β),SIM3a(α,β)) (23) とする。以上の式を再帰的に適用することで、二つの文
字列それぞれの順序に適合する共通の部分文字列が複数
求められ、かつ、類似度が最大となる。ただし、第1実
施例と異なり、式(21)から分かるように、本実施例では
共通の部分文字列をさらに分割することはない。
Further, SIM 3ag is calculated as follows: SIM 3ag (xα, yβ) = MAX (SIM 3a (α, yβ), SIM 3a (xα, β), SIM 3a (α, β)) (23) ). By applying the above expression recursively, a plurality of common partial character strings conforming to the respective orders of the two character strings are obtained, and the similarity is maximized. However, unlike the first embodiment, as can be seen from Expression (21), in this embodiment, the common partial character string is not further divided.

【0078】この類似度SIM3aにより、入力された文字
列と最も類似度の高い文書を検索する文書検索装置の実
施例を図2に示す。この文書検索装置は、文書データベ
ース10、文字列入力部11、検索制御部12、検索結
果出力部13、類似度算出部16、及び、再帰実行制御
部17から構成されている。図中10から13までの符
号を付した部分は、図1の同符号を付した部分と同じ機
能・構成を有するので、説明を省略する。
FIG. 2 shows an embodiment of a document search apparatus for searching for a document having the highest similarity to the input character string by using the similarity SIM 3a . This document search device includes a document database 10, a character string input unit 11, a search control unit 12, a search result output unit 13, a similarity calculation unit 16, and a recursion execution control unit 17. In the figure, portions denoted by reference numerals 10 to 13 have the same functions and configurations as the portions denoted by the same reference numerals in FIG.

【0079】類似度算出部16は、式(19)又は(20)に基
づいて、類似度を算出する。この類似度を算出する途中
で、一部分の文字列について同様に類似度を求める必要
がある。これは、再帰実行制御部17により、類似度算
出部16を繰り返し用いることで実施する。式(20)〜(2
3)の記号の表記に従って説明するため、図2で同じ文字
列に対して異なる記号を割り当て直している部分がある
のは、図1と同様である。
The similarity calculator 16 calculates the similarity based on the equation (19) or (20). In the process of calculating the similarity, it is necessary to similarly calculate the similarity for a part of the character string. This is performed by the recursive execution control unit 17 using the similarity calculation unit 16 repeatedly. Equations (20) to (2
In order to explain according to the notation of the symbol of 3), the same character string is reassigned with a different symbol in FIG. 2 as in FIG.

【0080】類似度算出部16は、一致文字列類似度算
出部24、任意文字列類似度算出部25、最大値選択部
26により実施されている。一致文字列類似度算出部2
4は、式(20)のSIM3as(α,β)を算出する。任意文字列
類似度算出部25は、式(20)のSIM3ag(α,β)を算出す
る。最大値選択部26は、これらに対して関数MAXを実
施することで、式(20)のSIM3a(α,β)を算出する。な
お、類似度算出部16の受け取った文字列α、βの両方
が空文字のときは、再帰実行制御部17によりSIM
3 a(α,β) =0.0とする。この際、一致文字列類似度算
出部24、任意文字列類似度算出部25、最大値選択部
26は動作させない。言うまでもなく、このSIM3a(α,
β) =0.0という値は、式(19)と(14)を実施するもので
ある。
The similarity calculating section 16 is implemented by a matching character string similarity calculating section 24, an arbitrary character string similarity calculating section 25, and a maximum value selecting section 26. Matching character string similarity calculator 2
4 calculates SIM 3as (α, β) in equation (20). The arbitrary character string similarity calculation unit 25 calculates SIM 3ag (α, β) in Expression (20). The maximum value selection unit 26 calculates SIM 3a (α, β) in Expression (20) by performing the function MAX on these. If both of the character strings α and β received by the similarity calculation unit 16 are null characters, the recursive execution control unit 17
3 Let a (α, β) = 0.0. At this time, the matching character string similarity calculating unit 24, the arbitrary character string similarity calculating unit 25, and the maximum value selecting unit 26 are not operated. Needless to say, this SIM 3a (α,
The value β) = 0.0 implements equations (19) and (14).

【0081】一致文字列類似度算出部24は、一致文字
列判定部34、文字列スコア算出部45、類似度算出部
46、加算部44により実施されている。
The matching character string similarity calculating section 24 is implemented by a matching character string determining section 34, a character string score calculating section 45, a similarity calculating section 46, and an adding section 44.

【0082】まず、一致文字列判定部34は、一致文字
列類似度算出部24が受け取った文字列ξα、ξβにお
いて、一致する文字列ξがない場合、すなわち、一致す
る文字列ξが空文字列の場合は、式(22)に従い、SIM3as
(ξα,ξβ)=0.0とする。この際、文字列スコア算出部
45、類似度算出部46、加算部47は動作させない。
First, the matching character string determining unit 34 determines that there is no matching character string に お い て in the character strings ξα and ξβ received by the matching character string similarity calculating unit 24, that is, the matching character string ξ is an empty character string. In the case of, according to equation (22), SIM 3as
(ξα, ξβ) = 0.0. At this time, the character string score calculator 45, the similarity calculator 46, and the adder 47 are not operated.

【0083】次に、一致文字列判定部34は、一致文字
列類似度算出部24が受け取った文字列ξα、ξβにお
いて、一致する文字列ξがある場合は、文字列スコア算
出部45、類似度算出部46、加算部47を動作させ
て、式(21)のScore(ξ)+SIM3a(α,β)を計算させる。
具体的には、文字列スコア算出部45は、式(15)に基づ
き、文書データベース10を参照して式(11)のScore
(ξ)を算出する。類似度算出部46は、実際には、再帰
実行制御部17により、類似度算出部16をαとβに対
して適用することで、実施する。加算部は、式(21)の加
算を行う。こうして、式(21)に示すSIM3as(ξα,ξβ)
が求まる。
Next, if there is a matching character string in the character strings {α and {β ”received by the matching character string similarity calculating section 24, the matching character string determining section The degree calculating unit 46 and the adding unit 47 are operated to calculate Score (ξ) + SIM 3a (α, β) in Expression (21).
Specifically, the character string score calculation unit 45 refers to the document database 10 based on Expression (15), and calculates the Score of Expression (11).
Calculate (ξ). The similarity calculation unit 46 is actually implemented by the recursion execution control unit 17 applying the similarity calculation unit 16 to α and β. The addition unit performs addition of Expression (21). Thus, SIM 3as (ξα, ξβ) shown in equation (21)
Is found.

【0084】任意文字列類似度算出部25は、類似度算
出部55〜57、最大値選択部58により実施されてお
り、式(23)のSIM3ag(xα,yβ)を算出する。受け取った
文字列xα、yβの先頭の1文字x、yの有無に関する各場
合に対応して、類似度算出部55、56、57は、それ
ぞれ式(23)のSIM3a(α,yβ)、SIM3a(xα,β)、SIM
3a(α,β)を求める。類似度算出部55〜57は、実際
には、再帰実行制御部17により、類似度算出部16
を、αとyβ、xαとβ、αとβのそれぞれに対して適用
することで、実施する。最大値選択部58は、式(23)の
関数MAXを実施する。
The arbitrary character string similarity calculating section 25 is implemented by the similarity calculating sections 55 to 57 and the maximum value selecting section 58, and calculates SIM 3ag (xα, yβ) of the equation (23). Corresponding to each case regarding the presence or absence of the first character x, y of the received character strings xα, yβ, the similarity calculation units 55, 56, and 57 respectively calculate SIM 3a (α, yβ), SIM 3a (xα, β), SIM
3a Find (α, β). Actually, the recursive execution control unit 17 causes the similarity calculating units 55 to 57 to
Is applied to each of α and yβ, xα and β, and α and β. The maximum value selection unit 58 implements the function MAX of Expression (23).

【0085】なお、文字列スコア算出部45は、式(15)
の代わりに、式(36)から(39)、または、式(36)と式(40)
から(41)を用いてScore(ξ)を算出することでも、本発
明は実施できる。
Note that the character string score calculation unit 45 calculates the expression (15)
Instead of (36) to (39), or (36) and (40)
By calculating Score (ξ) using (41) from
Ming can be implemented.

【0086】(第3実施例)(Third Embodiment)

【0087】次に、同義語辞書情報を用いた本発明の実
施例を説明する。同義語辞書に記載されたある文字列の
集合に属する文字列は、同義であるとする。また、記法
として、ξ,η,…ζを長さ1以上の同義の文字列とす
る。すなわち、同義語辞書Dの要素に、ある文字列の集
合Tが存在していて、ξ,η,…ζがTの要素であるとす
る。式で表せば、 D={{ξ,η,…ζ}…} (24) である。
Next, an embodiment of the present invention using synonym dictionary information will be described. Character strings belonging to a certain set of character strings described in the synonym dictionary are assumed to be synonymous. In addition, as a notation, {, η, ...} is a synonymous character string having a length of 1 or more. That is, it is assumed that a set T of a certain character string exists in the elements of the synonym dictionary D, and ξ, η,. Expressed as an equation, D = {{ξ, η,...}} (24)

【0088】αとβを文字列とし、""は空文字列とす
る。また、xとyを長さ1の文字列とする。Tは同義語辞
書Dの要素である文字列の集合とする。
Α and β are character strings, and “” is an empty character string. Also, x and y are character strings of length 1. T is a set of character strings that are elements of the synonym dictionary D.

【0089】本実施例による類似度(以下、同義語辞書
情報のある文字列重みのあるDP類似度)SIM4は、以下
の式を再帰的に適用することで求める。
The similarity (hereinafter, referred to as DP similarity having a character string weight having synonym dictionary information) SIM 4 according to the present embodiment is obtained by recursively applying the following equation.

【0090】まず、空文字列のときは SIM4("","")=0.0 (25) とする。それ以外のときは、 SIM4(α,β)=MAX(SIM4s(α,β),SIM4g(α,β)) (26) とする。First, in the case of an empty character string, SIM 4 ("", "") = 0.0 (25). Otherwise, SIM 4 (α, β) = MAX (SIM 4s (α, β), SIM 4g (α, β)) (26).

【0091】ここで、SIM4s(α,β)は、同義の単語ξと
ηが先頭にあるときは、 SIM4s(α,β)=MAX(SynonymScore(T)+SIM4(γ,δ)) (27) がα=ξγ、β=ηδ、ξ∈T、η∈Tとなる全てのξと
ηに関して成り立つように求め、そのようなξとηがな
いとき、 SIM4s(α,β)=0.0 (28) とする。
Here, SIM 4s (α, β) means that when words ξ and η having the same meaning are at the head, SIM 4s (α, β) = MAX (SynonymScore (T) + SIM 4 (γ, δ)) (27) is determined to hold for all ξ and η such that α = ξγ, β = ηδ, ξ∈T, η 、 T, and when there is no such ξ and η, SIM 4s (α, β) = Set to 0.0 (28).

【0092】また、SIM4g(xα,yβ)は、任意の文字列に
対して、 SIM4g(xα,yβ)=MAX(SIM4g(α,yβ), SIM4g(xα,β),SIM4g(α,β)) (29) とする。以上の式を再帰的に適用することで、二つの文
字列それぞれの順序に適合し、同義語となっている部分
文字列が複数求められ、かつ、類似度が最大となる。
Further, SIM 4g (xα, yβ) is calculated as follows: SIM 4g (xα, yβ) = MAX (SIM 4g (α, yβ), SIM 4g (xα, β), SIM 4g (α, β)) (29). By applying the above formula recursively, a plurality of partial character strings that match the order of each of the two character strings and are synonymous are obtained, and the similarity is maximized.

【0093】同義語辞書を考慮した重み(以下、同義語
スコア)を与える関数SynonymScoreは、df(ξ,η,…ζ)
をξ,η又はζが含まれる文書の数とし、ξ,η,…ζをT
の要素とし、Lを対象となった文字列の長さとすると、 SynonymScore(T)=L×idf(ξ,η,…ζ)=L×log2(N/df(ξ,η,…ζ)) (30) で実施できる。また、これ以外にも文字列の集合に関す
る関数で実施することもできる。
A function SynonymScore for giving a weight (hereinafter, synonym score) considering the synonym dictionary is df (ξ, η,...)
Is the number of documents containing ξ, η or ζ, and ξ, η,… ζ is T
Let L be the length of the target string, SynonymScore (T) = L × idf (ξ, η,...) = L × log 2 (N / df (ξ, η,...)) ) (30). In addition, it can also be implemented by a function relating to a set of character strings.

【0094】この様にして同義語辞書を用いることで、
全角と半角などのコードの対応関係を加味した検索や、
名前の読みや別名のある情報の検索を実現できる。
By using the synonym dictionary in this way,
Searches that take into account the correspondence between codes such as full-width and half-width,
You can read names and search for information with aliases.

【0095】次に、同義語辞書情報のある文字列重みの
あるDP類似度SIM4により、入力された文字列と最も類
似度の高い文書を検索する文書検索装置の実施例を図3
に示す。この文書検索装置は、文書データベース10、
文字列入力部11、検索制御部12、検索結果出力部1
3、類似度算出部18、再帰実行制御部19、及び同義
語辞書20から構成されている。図中10から13まで
の符号を付した部分は、図1の同符号を付した部分と同
じ機能・構成を有するので、説明を省略する。
Next, an embodiment of a document search apparatus for searching for a document having the highest similarity to an input character string by using a DP similarity SIM 4 having a character string weight with synonym dictionary information is shown in FIG.
Shown in This document search device includes a document database 10,
Character string input unit 11, search control unit 12, search result output unit 1
3, a similarity calculation unit 18, a recursive execution control unit 19, and a synonym dictionary 20. In the figure, portions denoted by reference numerals 10 to 13 have the same functions and configurations as the portions denoted by the same reference numerals in FIG.

【0096】類似度算出部18は、式(25)又は(26)に基
づいて、類似度を算出する。この類似度を算出する途中
で、一部分の文字列について同様に類似度を求める必要
がある。これは、再帰実行制御部19により、類似度算
出部18を繰り返し用いることで実施する。式の記号の
表記に従って説明するため、図3で同じ文字列に対して
異なる記号を割り当て直している部分があるのは、図1
と同様である。
The similarity calculating section 18 calculates the similarity based on the equation (25) or (26). In the process of calculating the similarity, it is necessary to similarly calculate the similarity for a part of the character string. This is performed by the recursive execution control unit 19 using the similarity calculation unit 18 repeatedly. In order to explain according to the notation of the expression symbol, there is a portion in FIG. 3 where different symbols are reassigned to the same character string in FIG.
Is the same as

【0097】同義語辞書20は、同義語を登録してお
く。例えば、日本語では「米国」「合衆国」「アメリ
カ」「アメリカ合衆国」「メリケン」は同義なので、日
本語で検索するならこれらを同義語辞書20の要素にT
={米国,合衆国,アメリカ,アメリカ合衆国,メリケン}を
登録しておく。表記のバラツキやよくある誤りに対応す
るために、読みを表す平仮名の「べいこく」や誤記「合
州国」を要素に加えておいても良い。同様に例えば、英
語なら「United States」「United States of Americ
a」「America」「U.S.A.」「U.S.」は同義なので、英語
で検索するなら同義語辞書20の要素にT={United Sta
tes, United States of America, America, U.S.A., U.
S.}を登録しておく。文字コードの相違に対応するに
は、例えば、1バイト文字(半角文字)で表した「U.S.
A.」に加えて、2バイト文字(全角文字)で表した
「U.S.A.」を要素に加えておくと好ましい。
The synonym dictionary 20 registers synonyms. For example, in Japanese, "US", "US", "USA", "USA" and "MERIKEN" are synonymous.
= Register {United States, United States, United States, United States, Meriken}. In order to cope with variations in notation and common errors, it is also possible to add the hiragana “beikoku” or the erroneous notation “United States of America” as an element. Similarly, for example, in English, "United States""United States of Americ"
"a", "America", "USA", and "US" are synonymous, so if you search in English, the element of the synonym dictionary 20 will be
tes, United States of America, America, USA, U.
S.} is registered. To cope with the difference in character codes, for example, "US" represented by one-byte characters (half-width characters)
A. ”is preferably added to the element in addition to“ USA ”represented by two-byte characters (full-width characters).

【0098】検索の目的にもよるが、語の意味の広狭も
許容することもできる。例えば、「帝都」「東京」「京
浜」「関東」は広狭はあるが、いずれも東京地方を示す
語である。この場合、同義語辞書20の要素にT={帝
都,東京,京浜,関東}を登録すれば良い。この様に、同義
語辞書20に、検索する手がかりとして有益な語(キー
ワード)の同義語を数多く登録しておくと、検索の漏れ
が少なくなって好適である。
Depending on the purpose of the search, the meaning of the word can be widened or narrowed. For example, "Teito", "Tokyo", "Keihin", and "Kanto" are words that indicate the Tokyo area, although they are wide and narrow. In this case, T = {Teito, Tokyo, Keihin, Kanto} may be registered as an element of the synonym dictionary 20. As described above, it is preferable to register many synonyms of useful words (keywords) as clues to be searched in the synonym dictionary 20, because omission of search is reduced.

【0099】類似度算出部18は、同義語類似度算出部
28、任意文字列類似度算出部29、最大値選択部30
により実施されている。同義語類似度算出部28は、式
(26)のSIM4s(α,β)を算出する。任意文字列類似度算出
部29は、式(26)のSIM4g(α,β)を算出する。最大値選
択部30、これらに対して関数MAXを実施することで、
式(26)のSIM4(α,β)を算出する。なお、類似度算出部
18の受け取った文字列α、βの両方が空文字のとき
は、再帰実行制御部19によりSIM4(α,β) =0.0とす
ることで、式(25)を実施する。この際、同義語類似度算
出部28、任意文字列類似度算出部29、最大値選択部
30は動作させない。
The similarity calculator 18 includes a synonym similarity calculator 28, an arbitrary character string similarity calculator 29, and a maximum value selector 30.
Has been implemented. The synonym similarity calculation unit 28 calculates the expression
The SIM 4s (α, β) of (26) is calculated. The arbitrary character string similarity calculation unit 29 calculates SIM 4g (α, β) in Expression (26). By performing the function MAX on the maximum value selection unit 30 and these,
Calculate SIM 4 (α, β) in equation (26). When both the character strings α and β received by the similarity calculation unit 18 are empty characters, the recursive execution control unit 19 sets SIM 4 (α, β) = 0.0 to execute the equation (25). . At this time, the synonym similarity calculator 28, the arbitrary character string similarity calculator 29, and the maximum value selector 30 are not operated.

【0100】同義語類似度算出部28は、同義語分離制
御部61、同義語分離類似度算出部62、最大値選択部
63により実施されており、式(26)のSIM4s(α,β)を算
出する。同義語分離類似度算出部62は、同義語分離部
71、同義語スコア算出部72、類似度算出部73、加
算部74により実施されている。
The synonym similarity calculating section 28 is implemented by a synonym separation controlling section 61, a synonym separating similarity calculating section 62, and a maximum value selecting section 63. The SIM 4s (α, β) ) Is calculated. The synonym separation similarity calculation section 62 is implemented by a synonym separation section 71, a synonym score calculation section 72, a similarity calculation section 73, and an addition section 74.

【0101】まず、同義語分離部71は、同義語辞書2
0を参照し、その要素Tに含まれるξとηを用いて、同
義語類似度算出部28が受け取った文字列α、βをα=
ξγ、β=ηδに分離することを試みる。かかる分離が
できない場合、同義語分離制御部61は、式(28)に従い
SIM4s(α,β)=0.0とする。この場合、同義語分離制御
部61は、文字列分離類似度算出部32、最大値選択部
33をそれ以上動作させない。
First, the synonym separation section 71 sets the synonym dictionary 2
0, and the character strings α and β received by the synonym similarity calculation unit 28 are calculated using α and η included in the element T as α = β.
Try to separate 分離 γ, β = ηδ. If such separation is not possible, the synonym separation control unit 61
SIM 4s (α, β) = 0.0. In this case, the synonym separation control unit 61 does not operate the character string separation similarity calculation unit 32 and the maximum value selection unit 33 any more.

【0102】一方、かかる分離ができる場合は、同義語
分離制御部61は、α=ξγ、β=ηδとなる全てのξ
とηに関して、同義語分離類似度算出部62を動作させ
て、式(27)に含まれるSynonymScore(T)+SIM4(γ,δ)を
計算させる。そして、最も大きな値を最大値選択部63
により選択する。このことにより、式(27)に示すSIM
4 s(α,β)が求まる。
On the other hand, if such separation can be performed, the synonym separation control unit 61 determines that all the ξ that satisfy α = ξγ and β = ηδ
With respect to and η, the synonym separation similarity calculation unit 62 is operated to calculate SynonymScore (T) + SIM 4 (γ, δ) included in Expression (27). Then, the largest value is set to the maximum value selection unit 63.
Select by. This allows the SIM shown in equation (27)
4 s (α, β) is obtained.

【0103】同義語分離部71は、文字列αとβを、
ξ、γ、η、δに分離して、ξとγが属する同義語辞書
Dの要素Tを同義語スコア算出部72に与え、γとδを類
似度算出部73に与える。同義語スコア算出部72は、
式(30)に基づき、文書データベース10を参照して式(2
7)のSynonymScore(T)を算出する。類似度算出部73
は、式(27)のSIM4(γ,δ)を算出する。類似度算出部7
3は、実際には、再帰実行制御部19により、類似度算
出部18をγとδに対して適用することで、実施する。
加算部74は、式(27)の加算を行う。
The synonym separation section 71 converts the character strings α and β into
Separately into ξ, γ, η, δ, synonym dictionary to which ξ and γ belong
The element T of D is provided to the synonym score calculation unit 72, and γ and δ are provided to the similarity calculation unit 73. The synonym score calculation unit 72
Based on the expression (30), referring to the document database 10, the expression (2
7) SynonymScore (T) is calculated. Similarity calculator 73
Calculates SIM 4 (γ, δ) in equation (27). Similarity calculator 7
3 is actually implemented by the recursion execution control unit 19 applying the similarity calculation unit 18 to γ and δ.
The adding unit 74 performs addition of Expression (27).

【0104】任意文字列類似度算出部29は、類似度算
出部81〜83、最大値選択部84により実施されてお
り、式(29)のSIM4g(xα,yβ)を算出する。受け取った文
字列xα、yβの先頭の1文字x、yの有無に関する各場合
に対応して、類似度算出部81、82、83は、それぞ
れ式(29)のSIM4(α,yβ)、SIM4(xα,β)、SIM4(α,β)
を求める。類似度算出部81〜83は、実際には、再帰
実行制御部19により、類似度算出部18を、αとy
β、xαとβ、αとβのそれぞれに対して適用すること
で、実施する。最大値選択部84は、式(29)の関数MAX
を実施する。
The arbitrary character string similarity calculating section 29 is implemented by the similarity calculating sections 81 to 83 and the maximum value selecting section 84, and calculates SIM 4g (xα, yβ) of the equation (29). In each case regarding the presence or absence of the first character x, y of the received character strings xα, yβ, the similarity calculation units 81, 82, 83 respectively calculate SIM 4 (α, yβ), SIM 4 (xα, β), SIM 4 (α, β)
Ask for. Actually, the similarity calculation units 81 to 83 use the recursive execution control unit 19 to set the similarity calculation unit 18 to α and y
This is implemented by applying to each of β, xα and β, and α and β. The maximum value selecting unit 84 calculates the function MAX of Expression (29).
Is carried out.

【0105】(第4実施例)(Fourth embodiment)

【0106】同義語辞書情報のある文字列重みのあるD
P類似度において、同義語辞書として対訳辞書を用いれ
ば、異なる言語の文書の類似度を求めることができる。
このことにより、検索文章と異なる言語の文書の検索、
いわゆる言語横断情報検索(Cross Lingual Informatio
n Retrieval)を行う装置の実施例を図4に示す。
Character string weighted D with synonym dictionary information
In P similarity, if a bilingual dictionary is used as a synonym dictionary, the similarity between documents in different languages can be obtained.
This allows you to search for documents in a language different from the search sentence,
Cross-lingual information retrieval (Cross Lingual Informatio
n Retrieval) is shown in FIG.

【0107】この言語横断情報検索装置は、文書データ
ベース10、文字列入力部11、検索制御部12、検索
結果出力部13、類似度算出部18、再帰実行制御部1
9、対訳辞書91から構成されている。図中10から1
3までの符号を付した部分は図1の同符号を付した部分
と同じ機能・構成を有し、図中18と19の符号を付し
た部分は図3の同符号を付した部分と同じ機能・構成を
有するので、説明を省略する。
This cross-language information search device includes a document database 10, a character string input unit 11, a search control unit 12, a search result output unit 13, a similarity calculation unit 18, and a recursive execution control unit 1.
9, a bilingual dictionary 91. 10 to 1 in the figure
3 have the same functions and configurations as the parts with the same reference numerals in FIG. 1, and the parts with the reference numerals 18 and 19 in the figure are the same as the parts with the same reference numerals in FIG. Since it has a function and a configuration, the description is omitted.

【0108】この言語横断情報検索装置は、文字列入力
部11から入力された検索文章と、最も類似度の高い文
書を文書データベース10から検索して出力する。検索
文章と、文書データベース10の文書は異なる言語で記
載する。例えば、前者は日本語で、後者は英語で記載す
る。すると、日本語の文書を文字列入力部11から入力
することで、最も類似した英語の文書を文書データベー
ス10から検索することが実施できる。
This cross-language information search device searches the document database 10 for a document having the highest similarity to the search sentence input from the character string input unit 11 and outputs it. The search text and the document in the document database 10 are described in different languages. For example, the former is written in Japanese and the latter is written in English. Then, by inputting a Japanese document from the character string input unit 11, the most similar English document can be searched from the document database 10.

【0109】対訳辞書91は、図3に示す同義語辞書2
0と同様の機能を有するが、登録されている同義語が異
なる言語の組合せになっている点で異なる。それぞれの
言語は、文字列入力部11から入力する検索文章の言語
と、文書データベース10の文書の言語に一致させるの
は、言うまでもない。例えば、日本語の「アメリカ人」
は、英語の「American」と同義なので、T={アメリカ人,
American}を対訳辞書の要素として登録しておく。もち
ろん、複数の同義語を含めて、例えば、T={アメリカ人,
米国人,American}としておくと、検索の漏れが少なくな
ってより好ましい。
The bilingual dictionary 91 is a synonym dictionary 2 shown in FIG.
It has the same function as 0, but differs in that registered synonyms are combinations of different languages. It goes without saying that each language matches the language of the search sentence input from the character string input unit 11 and the language of the document in the document database 10. For example, "American" in Japanese
Is synonymous with "American" in English, so T = {American,
American} is registered as a bilingual dictionary element. Of course, including multiple synonyms, for example, T = {American,
It is more preferable to set "American" as the number of search omissions is reduced.

【0110】(第5実施例)(Fifth Embodiment)

【0111】次に本発明による文章検索をソフトウエア
により実施する例を説明する。図5に、ソフトウエアの
実行に用いる計算機システムの一例を示す。この計算機
システムは、ディスプレイ101、プリンタ102、キ
ーボード103、フロッピー(登録商標)ディスク装置
104、CD−ROM(Compact Disk− Read Only Mem
ory)装置105、読み出し専用メモリ(Read Only Mem
ory。以下、ROM)106、読み書き可能なランダム
アクセスメモリ(Random Access Memory。以下、RA
M)107、磁気ディスク装置108、中央処理装置
(Central Processing Unit。以下、CPU)、通信イ
ンターフェイス110、及び、これらを接続するバス1
11から構成されている。フロッピーディスク装置10
4はフロッピーディスク112の読み書きを行い、CD
−ROM装置104はCD−ROM113の読み出しを
行う。また、通信インターフェイス110により、本計
算機システムは通信ネットワーク114に接続されてい
る。
Next, an example in which the text search according to the present invention is implemented by software will be described. FIG. 5 shows an example of a computer system used for executing software. This computer system includes a display 101, a printer 102, a keyboard 103, a floppy (registered trademark) disk device 104, a CD-ROM (Compact Disk-Read Only Mem).
ory) device 105, read only memory (Read Only Mem)
ory. ROM) 106, a readable / writable random access memory (Random Access Memory; hereinafter, RA)
M) 107, magnetic disk device 108, central processing unit (Central Processing Unit; hereinafter, CPU), communication interface 110, and bus 1 connecting these.
11. Floppy disk drive 10
4 reads and writes the floppy disk 112, and
The ROM device 104 reads the CD-ROM 113; The computer system is connected to a communication network 114 via a communication interface 110.

【0112】本発明を実施する文章検索プログラムは、
ROM106に記憶しておく。あるいは、フロッピーデ
ィスク112、CR−ROM113、又は、磁気ディス
ク装置108に文章検索プログラムを記憶しておき、R
AM107に転送した後、CPU109が実行するので
も良い。CPU109は、RAM107を作業領域に使
って文章検索プログラムを実行する。必要に応じて、磁
気ディスク装置108を作業領域に使っても良い。文章
検索プログラムの実行の指示はキーボード103から行
い、実行結果は、ディスプレイ101、又は、プリンタ
102に出力する。文章検索プログラムの実行を、フロ
ッピーディスク112から指示することや、実行結果を
フロッピーディスク112に書き込んでも良いのは言う
までもない。
A sentence search program for implementing the present invention is:
It is stored in the ROM 106. Alternatively, a text search program is stored in the floppy disk 112, the CR-ROM 113, or the magnetic disk device 108, and the
After the transfer to the AM 107, the CPU 109 may execute the processing. The CPU 109 executes the text search program using the RAM 107 as a work area. If necessary, the magnetic disk device 108 may be used as a work area. An instruction to execute the text search program is issued from the keyboard 103, and the execution result is output to the display 101 or the printer 102. It goes without saying that the execution of the text search program may be instructed from the floppy disk 112 and the execution result may be written to the floppy disk 112.

【0113】文書データベースと、同義語辞書(必要な
場合)は、フロッピーディスク112、CD−ROM1
13、又は、磁気ディスク108に蓄えておく。高速な
アクセスのためにRAM107に転送しておくのでも良
い。RAM107に転送する際に、容易に処理できる形
式に変換するのも良い。また、文章検索プログラム、文
書データベース、同義語辞書(必要な場合)、又は、実
行の指示を、ネットワーク114経由で本計算機システ
ムに入力したり、実行の結果をネットワーク114経由
で本計算機システムから出力したりしても良いことは、
もちろんである。
The document database and the synonym dictionary (if necessary) are stored on the floppy disk 112, CD-ROM 1
13 or on the magnetic disk 108. The data may be transferred to the RAM 107 for high-speed access. When transferring the data to the RAM 107, the data may be converted into a format that can be easily processed. In addition, a text search program, a document database, a synonym dictionary (if necessary), or an execution instruction is input to the computer system via the network 114, and an execution result is output from the computer system via the network 114. What you can do is
Of course.

【0114】また、図に示されたものに限らず、各種の
記録媒体、入力手段、出力手段を用いて、本計算機シス
テムへの入力と出力を行うなど各種の実施態様への変形
が可能なことは言うまでもない。これらの、記録媒体、
入力手段、出力手段は本計算機システムが直接アクセス
するものの他、通信ネットワークを経由してアクセスす
るものであっても良いのはもちろんである。
The present invention is not limited to those shown in the figures, and various recording media, input means, and output means can be used to input and output to the computer system, and can be modified into various embodiments. Needless to say. These recording media,
It goes without saying that the input means and the output means may be those directly accessed by the computer system, or those accessed via a communication network.

【0115】文字列重みのあるDP類似度SIM3による文
書検索プログラムの処理フローを図6から図10に示
す。本プログラムは、検索文章を入力し、文章データベ
ースを検索し、類似度の高い複数の文書を出力する。
FIGS. 6 to 10 show the processing flow of the document search program using the DP similarity SIM 3 having a character string weight. This program inputs a search sentence, searches a sentence database, and outputs a plurality of documents having high similarity.

【0116】図6は、検索文章に基づいて文書データベ
ースを検索し、類似度の高い文書を選び出して出力する
処理のフローを示す。まず、ステップS11(以下、S
11と略記)で、ある文字列の出現回数を効率よく計算
する準備のために、文書データベースに含まれる全文書
を総合してサフィックスファイル(Suffix File)を作
成する。サフィックスファイルの作り方と利用の仕方
は、例えばMikio Yamamoto and Kenneth W.Church, Usi
ng Suffix Arrays to Compute Term Frequency and Doc
ument Frequency for All Substrings in a Corpus, In
proceeding of 6th Workshop on Very Large Corpora,
Ed. Eugene Charniak, Motreal, pp28-37, 1998に開示
されている。
FIG. 6 shows a flow of processing for searching a document database based on a search sentence, selecting and outputting a document having a high degree of similarity. First, step S11 (hereinafter, S
11), a suffix file (Suffix File) is created by combining all documents included in the document database in order to efficiently calculate the number of appearances of a certain character string. For details on how to create and use suffix files, see Mikio Yamamoto and Kenneth W. Church, Usi
ng Suffix Arrays to Compute Term Frequency and Doc
ument Frequency for All Substrings in a Corpus, In
proceeding of 6th Workshop on Very Large Corpora,
Ed. Eugene Charniak, Motreal, pp 28-37, 1998.

【0117】サフィックスファイルを使うと、ある文字
列が文書に出現する回数を高速に求めることができる。
サフィックスファイルは、全ての文書において生じうる
部分文字列を、文字コードに従ってソートして(文字コ
ードの順に並べ替えて)、通し番号(サフィックス)を
付けておくことで実施する。文字列が文書に出現する回
数は、その文字列と一致する文字列がサフィックスファ
イルの中にいくつあるかを算出することで求められる。
By using a suffix file, the number of times a character string appears in a document can be obtained at high speed.
The suffix file is implemented by sorting partial character strings that can occur in all documents according to character codes (sorting them in the order of character codes) and adding serial numbers (suffixes). The number of times a character string appears in a document can be obtained by calculating the number of character strings that match the character string in the suffix file.

【0118】具体的には、まず、一致する文字列をサフ
ィックスファイルの先頭から探してそのサフィックスmi
nを求める。もし、一致する文字列がないなら、文書に
出現する回数は0である。次に、一致する文字列をサフ
ィックスファイルの末尾から探してそのサフィックスma
xを求める。すると、文字列が文書に出現する回数tf
は、 tf=max−min+1 (31) で求められる。なお、文書データベースの文書は、文書
番号(Document ID)によって互いに区別するものとす
る。サフィックスファイルに登録する部分文字列には、
この文書番号を付けておき、その部分文字列がどの文書
に由来するかが分かるようにしておく。
Specifically, first, a matching character string is searched from the head of the suffix file, and the suffix mi is searched.
Find n. If there is no matching string, the number of occurrences in the document is zero. Next, search for a matching string from the end of the suffix file,
Find x. Then, the number of times the character string appears in the document tf
Is obtained by tf = max−min + 1 (31). The documents in the document database are distinguished from each other by a document number (Document ID). The substring registered in the suffix file contains
This document number is assigned so that the document from which the partial character string is derived can be known.

【0119】次にS12で、検索文章を文字列Xに読み
込む。S13では、文書データベースの文書から、ある
一つの文書を選んで文字列Yに読み込む。次にS14
で、文字列Xと文字列Yの類似度を計算する。S14で行
う処理は、図7を用いて後述する。S15では、求めた
類似度と文書番号を組として文書管理テーブルに登録す
る。S16では、文書データベースに含まれる全ての文
書について類似度を計算したかどうか判定する。もし、
まだ全ての文書について計算していなければ、計算を未
だ行っていない文書をS13で選んで文字列Yに読み込
み、S15までの処理を繰り返す。もし、全ての文書に
ついて計算していれば、S17で、登録したテーブルを
類似度の高い順に並び替える。S18では類似の高い文
書を出力する処理を行う。出力する文書は、一つだけに
する、あるいは、所定の複数にする、あるいは、所定の
類似度以上の全ての文書にする、など種々の態様が可能
である。
Next, in step S12, the search text is read into the character string X. In S13, a certain document is selected from the documents in the document database and read into the character string Y. Next, S14
Calculates the similarity between the character strings X and Y. The processing performed in S14 will be described later with reference to FIG. In S15, the obtained similarity and the document number are registered as a set in the document management table. In S16, it is determined whether or not the similarity has been calculated for all the documents included in the document database. if,
If the calculation has not been performed for all the documents, a document that has not been calculated is selected in S13 and read into the character string Y, and the processing up to S15 is repeated. If the calculation has been performed for all the documents, the registered tables are sorted in descending order of similarity in S17. In S18, a process of outputting a document having a high similarity is performed. Various modes are possible, such as outputting only one document, a plurality of documents, or all documents having a predetermined similarity or more.

【0120】類似度は、式(15)に示す文字列スコアScor
e(ξ)を足し合わせることによって求める。この足し合
わせの途中の値を以下では、スコアと呼ぶ。式(11)と(1
3)の関数MAXから分かるように、文字列スコアを加算し
たスコアや長さを1文字ずつ変えた部分文字列に対する
スコアを計算し、それらの最大値を選択する必要があ
る。その計算と選択を効率よく進めるために、図11に
示すスコア表を利用する。このスコア表は、横方向が文
字列Xに、縦方向が文字列Yに対応している。以下では、
文字列Xの長さをx_lenとし、文字列Yの長さをy_lenと
する。このスコア表に対して、左上から右下に向かって
値が増えるようにスコアを埋めることで、式(10)、(1
1)、(13)の関数MAXを実施する。
The similarity is calculated using the character string score Scor shown in equation (15).
It is obtained by adding e (ξ). The value in the middle of this addition is hereinafter referred to as a score. Equations (11) and (1
As can be seen from the function MAX of 3), it is necessary to calculate the score obtained by adding the character string score and the score for the partial character string whose length is changed one character at a time, and select the maximum value. In order to efficiently advance the calculation and selection, a score table shown in FIG. 11 is used. In this score table, the horizontal direction corresponds to the character string X, and the vertical direction corresponds to the character string Y. Below,
The length of the character string X is x_len, and the length of the character string Y is y_len. By filling the score in this score table so that the value increases from the upper left to the lower right, Expressions (10) and (1
The function MAX of (1) and (13) is performed.

【0121】具体的には、文字列Xのi文字目までと、文
字列Yのj文字目までに対応するスコアをscore[i][j]と
する。文字列Xと文字列Yにおいて、一致する部分の文
字列γが、文字列Xのi文字目からi+m文字目までと文
字列Yのj文字目からj+n文字目までであり、score[i]
[j]に部分文字列γの文字列スコアを加算した値をvalue
とする。そして、 score[i+m+1][j+n+1]≧value (32) という関係を成り立たせるため、score[i+m+1][j+n
+1]がvalueより小さければ、valueをscore[i+m+1][j
+n+1]に書き込む。この処理を全ての部分文字列γに
関して行えば、式(11)の関数MAXと、式(10)のSIM3s(α,
β)に関する関数MAXの実施となる。
More specifically, scores corresponding to the i-th character of the character string X and the j-th character of the character string Y are score [i] [j]. In the character string X and the character string Y, the matching character strings γ are the i-th to i + m-th characters of the character string X and the j-th to j + n-th characters of the character string Y, and score [i]
Value obtained by adding the character string score of substring γ to [j]
And Then, score [i + m + 1] [j + n to satisfy the relationship of score [i + m + 1] [j + n + 1] ≧ value (32)
If +1] is smaller than value, the value is score [i + m + 1] [j
+ N + 1]. If this processing is performed for all the partial character strings γ, the function MAX of Expression (11) and the SIM 3s (α,
The function MAX for β) is implemented.

【0122】また、 score[i+1][j]≧score[i][j] (33) score[i][j+1]≧score[i][j] (34) score[i+1][j+1]≧score[i][j] (35) という関係を成り立たせるため、score[i+1][j]、scor
e[i][j+1]、score[i+1][j+1]がscore[i][j]よりも小
さければ、それぞれscore[i][j]を書き込む。iとjを逐
次増やしながらこの処理を行えば、式(13)の関数MAX
と、式(10)のSIM3g(α,β)に関する関数MAXの実施とな
る。
Score [i + 1] [j] ≧ score [i] [j] (33) score [i] [j + 1] ≧ score [i] [j] (34) score [i + 1] [j + 1] ≧ score [i] [j] (35) In order to hold the relationship, score [i + 1] [j], scor
If e [i] [j + 1] and score [i + 1] [j + 1] are smaller than score [i] [j], write score [i] [j] respectively. If this process is performed while sequentially increasing i and j, the function MAX of Expression (13) is obtained.
Then, the function MAX relating to SIM 3g (α, β) in Expression (10) is performed.

【0123】これらの比較と書きこみを、図7に示すフ
ローに従って順に処理を進め、スコア表を完成させる。
すると、図11の右下のscore[x_len][y_len]がスコア
表の中で最も大きな値となり、これが求めるべき類似度
SIM3(X,Y)となる。なお、このスコア表により類似度を
求める手順は、DP手法の実施例となっている。
The comparison and writing are sequentially processed according to the flow shown in FIG. 7 to complete the score table.
Then, score [x_len] [y_len] at the lower right of FIG. 11 becomes the largest value in the score table, and this is the similarity to be obtained.
SIM 3 (X, Y). The procedure for obtaining the similarity from the score table is an example of the DP method.

【0124】図7は、検索文章を読み込んだ文字列X
と、文書データベースの文書を読み込んだ文字列Yの類
似度を求める処理のフローを示す。以下では、文字列X
のi文字目からm文字の部分文字列をX[i,m]で、文字列Y
のj文字目からn文字の部分文字列をY[j,n]で示す。例え
ば、文字列Xの先頭の2文字からなる部分文字列は、X
[0,2]である。
FIG. 7 shows a character string X from which a search sentence is read.
5 shows a flow of processing for calculating the similarity of a character string Y obtained by reading a document in a document database. In the following, the character string X
X [i, m] is a substring of m characters from the i-th character of
A partial character string of n characters from the jth character of is denoted by Y [j, n]. For example, the substring consisting of the first two characters of the character string X is X
[0,2].

【0125】まず始めに、図7に示すS21で、文字列
Xと文字列Yのスコア表score[i][j]の全ての値を0に初
期化する。次に、S22では、文字列Xから部分文字列
を取り出す先頭を示すiを0に設定する。S23では、文
字列Yから部分文字列を取り出す先頭を示すjを0に設定
する。S24では、スコア表において現在着目している
スコアscore[i][j]を、処理の便宜のために、一時的な
変数currentに記憶する。
First, at S21 shown in FIG.
Initialize all values of score table score [i] [j] of X and character string Y to 0. Next, in S22, i indicating the head of extracting a partial character string from the character string X is set to 0. In S23, j indicating the beginning of extracting the partial character string from the character string Y is set to 0. In S24, the score score [i] [j] currently focused on in the score table is stored in a temporary variable current for convenience of processing.

【0126】S25では、文字列Xと文字列Yの一致して
いる部分の長さを示すkを0に設定する。S26では、文
字列Xにおいて一致を判定する部分を示すi+kが文字列X
の長さx_len未満であり、かつ、文字列X、Yそれぞれの
1文字X[i+k,1]、Y[i+k,1]が一致しているかを判定し
ている。もし、この条件が成り立つならS27へ進み、
この条件が成り立たなければS32へ進む。
In S25, k indicating the length of the portion where the character strings X and Y match is set to 0. In S26, i + k indicating the part for which a match is determined in the character string X is the character string X
Is smaller than the length x_len, and whether the characters X [i + k, 1] and Y [i + k, 1] of the character strings X and Y match each other. If this condition is satisfied, proceed to S27,
If this condition is not satisfied, the process proceeds to S32.

【0127】S27からS31は、一致している部分に
関して文字列スコアをスコア表に加味しながら、一致し
ている部分の長さを逐次増やす処理である。S26から
S27に進んだときは、部分文字列X[i,k+1]と部分文
字列Y[j,k+1]は一致している。まず、S26で、部分
文字列X[i,k+1]の文字列スコアを求める。これは式(1
5)のScore(ξ)を求める処理であり、図8から図10を
用いて後述する。この文字列スコアをtmp_scoreとす
る。次に、S28で、tmp_scoreを現在着目しているス
コア(current)に加算して、この値を一時的な変数value
に記憶する。S29とS30は、式(32)を成り立たせる
ための、比較と書き込みである。S31では、一致して
いる部分を長くしてS26からS30を繰り返すために
kを1増やす。
Steps S27 to S31 are processes for sequentially increasing the length of the matching portion while adding the character string score to the score table for the matching portion. When the process proceeds from S26 to S27, the partial character string X [i, k + 1] matches the partial character string Y [j, k + 1]. First, in S26, a character string score of the partial character string X [i, k + 1] is obtained. This is given by equation (1
This is the process of calculating Score (ξ) in 5) , which will be described later with reference to FIGS. Let this character string score be tmp_score. Next, in S28, tmp_score is added to the score (current) currently focused on, and this value is added to a temporary variable value
To memorize. S29 and S30 are comparison and writing for satisfying the expression (32). In S31, in order to lengthen the matching part and repeat S26 to S30,
Increase k by 1.

【0128】S32とS33、S34とS35、S36
とS37は、それぞれ、式(33)、式(34)、式(35)を成り
立たせるための、比較と書き込みである。
S32 and S33, S34 and S35, S36
Steps S37 and S37 are comparison and writing, respectively, for satisfying the equations (33), (34), and (35).

【0129】S38では、文字列Yから部分文字列を取
り出す先頭を示すjが文字列Yの長さy_len未満であるか
を判定している。もし、この条件が成り立つなら、S3
9でjを1増やしてS24からS37までの処理を繰り返
す。文字列Yの末尾まで処理が終われば、S38からS
40へ進む
In S38, it is determined whether j indicating the head of extracting the partial character string from the character string Y is less than the length y_len of the character string Y. If this condition holds, S3
In step 9, j is incremented by 1 and the processing from S24 to S37 is repeated. If the processing is completed up to the end of the character string Y, S38 to S
Proceed to 40

【0130】S40では、文字列Xから部分文字列を取
り出す先頭を示すiが文字列Xの長さx_len未満であるか
を判定している。もし、この条件が成り立つ場合は、S
41でiを1増やして、S23からS38までの処理を繰
り返す。文字列Xの末尾まで処理が終われば、S40か
らS42に進む。
In S40, it is determined whether or not i indicating the head of extracting the partial character string from the character string X is less than the length x_len of the character string X. If this condition holds, S
In step 41, i is incremented by 1 and the processing from S23 to S38 is repeated. When the process is completed up to the end of the character string X, the process proceeds from S40 to S42.

【0131】もし、文字列Xの末尾まで処理が終われ
ば、スコア表は完成している。そこで、S42で、scor
e[x_len][y_len]を文字列Xと文字列Yの類似度として
返す処理を行う。
If the processing is completed up to the end of the character string X, the score table is completed. Therefore, in S42, scor
A process of returning e [x_len] [y_len] as the similarity between the character strings X and Y is performed.

【0132】図8に、サフィックスファイルを利用して
文字列aの文字列スコアscを算出する処理のフローを示
す。文字列aには、図7のS27で、部分文字列X[i,k+
1]が与えられている。まず、図8のS51で、文字列a
の出現する文書の数dfを求める。S51の具体的な処理
は、図9を用いて後述する。次にS52で、全文書にお
いて文字列aの出現する回数tfを求める。S52の具体
的な処理は、図10を用いて後述する。
FIG. 8 shows a flow of processing for calculating the character string score sc of the character string a using the suffix file. In the character string a, the partial character string X [i, k +
1] is given. First, in S51 of FIG.
Find the number df of documents in which appears. The specific processing of S51 will be described later with reference to FIG. Next, in S52, the number of occurrences tf of the character string a in all documents is obtained. The specific processing of S52 will be described later with reference to FIG.

【0133】S53では、文字列の出現回数tfが回未
満かどうかを判定し、回未満ならS54で一時的な変
数scに0.0を与える。これは、文書中に稀にしか現れな
い文字列は、意味のある語ではない、すなわち、情報検
索に有益ではないと考えられるからである。文字列の出
現回数tfが2回以上の場合は、S55の判定を行う。
[0133] In S53, the number of occurrences tf of string it is determined whether or not less than 2 times, giving a 0.0 to a temporary variable sc in if less than 2 times S54. This is because a character string that appears rarely in a document is not a meaningful word, that is, it is not considered useful for information retrieval. If the number of appearances tf of the character string is two or more, the determination in S55 is performed.

【0134】S55は、全文書の数Nに対する、文字列a
の出現する文書の数dfの比が、5%より大きいかを判定
する処理である。5%よりも大きい場合には、S54
スコアscに0.0を与える。これは、文書中に頻出する文
字列は、区切りの働きをする語(ストップワード)であ
って有用な文字列ではない、すなわち、情報検索に有益
ではないと考えられるからである。
At S55, the character string a for the number N of all documents
Is a process for determining whether or not the ratio of the number df of documents in which. When than 5% larger, giving a 0.0 <br/> score sc in S54. This is because a character string that frequently appears in a document is a word (stop word) serving as a delimiter and is not a useful character string, that is, it is not considered useful for information retrieval.

【0135】Nとdfの比が5%以下の場合にはS56
で、式(15)によりスコアscを求める計算を行う。最後
に、S57でscを文字列スコアとして返す。
If the ratio between N and df is 5% or less, the flow goes to S56.
Then, calculation for obtaining the score sc is performed by the equation (15). Finally, sc is returned as a character string score in S57.

【0136】図9に、文字列aの出現する文書の数dfを
求める処理のフローを示す。この処理では、同一の文字
列に対する処理時間を短縮するために、文字列aと計算
したdfを、文書の数を記憶するためのハッシュテーブル
(以下、文書数ハッシュテーブル)に登録することで、
再度の計算を不要としている。まず、S61で、文字列
aが文書数ハッシュテーブルに登録されているかを判定
し、もし、登録済みならS62で登録されているdfを求
める。一方、文書数ハッシュテーブルに登録されてない
なら、S63からS68においてdfを算出する。
FIG. 9 shows a flow of processing for obtaining the number df of documents in which the character string a appears. In this processing, in order to reduce the processing time for the same character string, the character string a and the calculated df are registered in a hash table for storing the number of documents (hereinafter, a document number hash table).
It eliminates the need for recalculation. First, in S61, a character string
It is determined whether or not a is registered in the document number hash table. If registered, df registered in S62 is obtained. On the other hand, if it is not registered in the document number hash table, df is calculated in S63 to S68.

【0137】S63は、サフィックスファイルの先頭か
ら順に文字列aを探し、そのサフィックスをminとおく処
理である。minが求まらない場合、すなわち、サフィッ
クスファイルに文字列aが含まれていない場合は、文字
列aが文書に出現しない場合である。これは、S64で
判定して、S65でdfを0とする。
In step S63, a character string a is searched in order from the beginning of the suffix file, and the suffix is set to min. When min cannot be obtained, that is, when the character string a is not included in the suffix file, the character string a does not appear in the document. This is determined in S64, and df is set to 0 in S65.

【0138】S64は、サフィックスファイルの末尾か
ら順に文字列aを探し、そのサフィックスをmaxとおく処
理である。サフィックスファイルにおいて、サフィック
スがminからmaxまでの範囲が、文字列aと一致する文字
列である。S67は、これらの文字列に付された文書番
号で相異なるものの数を求める処理である。この数が、
文字列aの出現する文書の数dfになる。
Step S64 is a process for sequentially searching for a character string a from the end of the suffix file and setting the suffix to max. In the suffix file, the range of the suffix from min to max is a character string that matches the character string a. S67 is a process of calculating the numbers of different document numbers assigned to these character strings. This number is
The number of documents in which the character string a appears is df.

【0139】S68では、文字列aと文書の数dfを文書
数ハッシュテーブルに登録する処理である。S69は、
文書の数dfを返す処理である。
In step S68, the character string a and the number of documents df are registered in the document number hash table. S69 is
This is the process of returning the number of documents df.

【0140】図10に、全文書において文字列aの出現
する回数tfを求める処理のフローを示す。S71は、サ
フィックスファイルの先頭から順に文字列aを探し、そ
のサフィックスをminとおく処理である。minが求まらな
い場合、すなわち、サフィックスファイルに文字列aが
含まれていない場合は、文字列aが文書に出現しない場
合である。これは、S72で判定して、S73でtfを0
とする。
FIG. 10 shows a flow of processing for obtaining the number of times tf that the character string a appears in all the documents. S71 is a process of searching for a character string a in order from the beginning of the suffix file and setting the suffix to min. When min cannot be obtained, that is, when the character string a is not included in the suffix file, the character string a does not appear in the document. This is determined in S72, and tf is set to 0 in S73.
And

【0141】S74は、サフィックスファイルの末尾か
ら順に文字列aを探し、そのサフィックスをmaxとおく処
理である。S75では、式(31)の計算を行う。S76
は、出現する回数tfを返す処理である。
S74 is a process of searching for a character string a in order from the end of the suffix file and setting the suffix to max. In S75, calculation of Expression (31) is performed. S76
Is a process for returning the number of appearances tf.

【0142】なお、式(15)の代わりに、式(36)から(39)
を用いて実施する場合には、図8と図9に示すフローの
代わりに、それぞれ図12と図13に示すフローを用い
れば良い。式(36)と式(40)から(41)を使う場合も同様の
フローを用いて実現できる。図12のS82、S83、
S84、S85、S89に示す処理は、それぞれ、図8
におけるS52、S53、S54、S55、S57に示
す処理と同等なので、説明は省略する。図12のS81
は、文字列aが出現する文書の数df1 と、文字列aが2回
以上出現する文書の数df2 を求める。S81の具体的な
処理は、図13を用いて後述する。図12のS86で
は、式(36)に示す出現集中度を求めている。S87は、
出現集中度を正の実定数K(例えば、2.0)と比較する
処理であり、その大小関係に応じてS88又はS84に
進む。S88は式(38)に従って文字列スコアを求める処
理であり、S84は式(39)に従って文字列スコアを0.0
とする処理である。
It should be noted that instead of equation (15), equations (36) to (39)
In the case of using the method shown in FIG. 8 and FIG.
Instead, the flow shown in FIGS. 12 and 13, respectively, is used.
Just do it. The same applies when using Equation (36) and Equations (40) to (41).
It can be realized using a flow. S82 and S83 in FIG.
The processes shown in S84, S85, and S89 are respectively performed in FIG.
Shown in S52, S53, S54, S55 and S57
Since the processing is the same as the above, the description is omitted. S81 in FIG.
Is the number of documents in which character string a appears df 1 and character string a occurs twice
Determine the number of document df 2 occurs more than. Specific of S81
The processing will be described later with reference to FIG. In S86 of FIG.
Obtains the appearance concentration degree shown in Expression (36). S87 is
Compare the occurrence concentration with a positive real constant K (for example, 2.0)
The processing is performed in S88 or S84 according to the magnitude relation.
move on. S88 is a process for obtaining a character string score according to equation (38).
In S84, the character string score is set to 0.0 according to the equation (39).
Is the processing to be performed.

【0143】図13に、文字列aの出現する文書の数df1
と、文字列aが2回以上出現する文書の数df2 を求める処
理のフローを示す。この処理は、図9に示した処理と同
様に、同一の文字列に対する処理時間を短縮するために
文書数ハッシュテーブルを用いるが、文字列aとdf1 と共
にdf2 も登録する点で異なっている。まず、S91で、
文字列aが文書数ハッシュテーブルに登録されているか
を判定し、もし、登録済みならS92で登録されている
df1 とdf2 を求める。一方、文書数ハッシュテーブルに登
録されてないなら、S93からS99において、df1 とd
f2 を算出する。図13に示すS93、S94、S96、
S97は、それぞれ図9に示すS63、S64、S6
6、S67に示す処理と同じなので、説明は省略する。
図13に示すS95は、文字列aが文書に出現しない場
合に、df1 とdf2 を0にする処理である。S93とS96
により求まったminからmaxまでの範囲が、サフィックス
ファイルにおいて、文字列aと一致する文字列である。
S98では、これらの文字列に付された文書番号を参照
し、同一の文書番号が2つ以上存在するものの数を求め
る処理である。この数が、文字列aが2回以上出現する
文書の数df2 になる。S99では、文字列aと文書の数df
1 、df2 を文書数ハッシュテーブルに登録する処理であ
る。S100は、df1 、df2 をそれぞれ、文字列aの出現
する文書の数、文字列aが2回以上出現する文書の数と
して返す処理である。
[0143]FIG. 13 shows the number of documents df 1 in which the character string a appears.
And the number of documents in which the character string a appears twice or more df 2 Where to seek
The flow of the processing is shown. This processing is the same as the processing shown in FIG.
To reduce the processing time for the same character string
Use document count hash table, but with strings a and df 1 With
To df 2 Are also different in that they are also registered. First, in S91,
Whether the character string a is registered in the document count hash table
Is determined, and if registered, registered in S92.
df 1 And df 2 Ask for. On the other hand, the
If it has not been recorded, in steps S93 to S99, df 1 And d
f 2 Is calculated. S93, S94, S96 shown in FIG.
S97 corresponds to S63, S64, S6 shown in FIG.
6, since the processing is the same as that shown in S67, the description is omitted.
S95 shown in FIG. 13 is used when character string a does not appear in the document.
If df 1 And df 2 Is a process of setting the value to 0. S93 and S96
The range from min to max determined by is the suffix
This is a character string that matches the character string a in the file.
In S98, reference is made to the document numbers assigned to these character strings.
Then, find the number of documents with two or more identical document numbers.
This is the process to be performed. This number indicates that the character string a appears twice or more
Number of documents df 2 become. In S99, the character string a and the number of documents df
1 , Df 2 Is registered in the document count hash table.
You. S100 is df 1 , Df 2 Each occurrence of the string a
The number of documents to be written, the number of documents where the character string a appears twice or more,
And return it.

【0144】(第6実施例)(Sixth Embodiment)

【0145】次に、類似度SIM3aによる文書検索をソフ
トウエアにより実施する例を説明する。ソフトウエアの
実行に用いる計算機システムは、前述した図5に示すも
のを用いる。文書検索プログラム等を記録媒体に記録し
ておける点は、第5実施例と同様である。文書検索プロ
グラムのフローは、図6、図14、図8から図10に示
される。図8と図9に示すフローの代わりに、それぞれ
図12と図13に示すフローを用いても良いのは第5実
施例の場合と同様である。この実施例は、文字列重みの
あるDP類似度SIM3に比べると、図7に示すフローの代
わりに図14に示すフローを用いる点で異なる。そこ
で、共通する説明は割愛し、以下では図14のフローの
み説明する。
Next, an example in which a document search by the similarity SIM 3a is performed by software will be described. The computer system shown in FIG. 5 is used for executing the software. The point that a document search program and the like can be recorded on a recording medium is the same as in the fifth embodiment. The flow of the document search program is shown in FIG . 6, FIG. 14 , FIG. 8 to FIG. Instead of the flow shown in FIGS. 8 and 9,
The flow shown in FIGS. 12 and 13 may be used in the fifth embodiment.
This is the same as in the case of the embodiment. This embodiment differs from the DP similarity SIM 3 having a character string weight in that the flow shown in FIG. 14 is used instead of the flow shown in FIG . Therefore, the common description is omitted, and only the flow of FIG. 14 will be described below.

【0146】本実施例において、図14は、図6に示す
S14で行う文字列Xと文字列Yの類似度を計算する処理
のフローを示している。なお、図14に示すS121か
らS142は、それぞれ、図7に示すS21からS42
と関連がある。類似度SIM3aは類似度SIM3に比べて、一
致する文字列の最大長を求めてから文字列スコアを計算
する点で異なっている。図14に示すフローは、図7に
示すフローに比べて、この点で異なっている。図14
示すフローを以下、順に説明する。
FIG. 14 shows the flow of the processing for calculating the similarity between the character strings X and Y performed in S14 shown in FIG. 6 in this embodiment. Note that S121 to S142 shown in FIG. 14 are respectively S21 to S42 shown in FIG.
Related to The similarity SIM 3a is different from the similarity SIM 3 in that a character string score is calculated after obtaining the maximum length of a matching character string. The flow shown in FIG. 14 is different in this point from the flow shown in FIG. The flow shown in FIG. 14 will be described below in order.

【0147】まず、S121で、文字列Xと文字列Yのス
コア表score[i][j]の全ての値を0に初期化する。次
に、S122では、文字列Xから部分文字列を取り出す
先頭を示すiを0に設定する。S123では、文字列Yか
ら部分文字列を取り出す先頭を示すjを0に設定する。S
124では、スコア表において現在着目しているスコア
score[i][j]を、処理の便宜のために、一時的な変数cur
rentに記憶する。
First, in S121, all values of the score tables score [i] [j] of the character strings X and Y are initialized to zero. Next, in S122, i indicating the head of extracting a partial character string from the character string X is set to 0. In S123, j indicating the beginning of extracting the partial character string from the character string Y is set to 0. S
At 124, the score currently focused on in the score table
score [i] [j] is a temporary variable cur for convenience of processing
Remember in rent.

【0148】S125では、文字列Xと文字列Yの一致し
ている部分の長さを示すkを0に設定する。S126で
は、文字列Xにおいて一致を判定する部分を示すi+kが
文字列Xの長さx_len未満であり、かつ、文字列X、Yそれ
ぞれの1文字X[i+k,1]、Y[i+k,1]が一致しているかを
判定している。もし、この条件が成り立つならS131
へ進んで再びS126を行う。このことにより、どこま
で一致しているかを探す。一致していなければ、S12
0へ進む。
In S125, k indicating the length of the part where the character strings X and Y match is set to 0. In S126, i + k indicating the part of the character string X for which a match is determined is less than the length x_len of the character string X, and one character of each of the character strings X and Y X [i + k, 1], Y [i + k, 1 ] Are matched. If this condition holds, S131
Then, S126 is performed again. By doing so, a search is made to find out how far they match. If they do not match, S12
Go to 0.

【0149】S120では、一致する部分の有無を判定
している。もし、k>0、すなわち、一致する部分があれ
ば、S127へ進む。一方、一致する部分がなければ、
S132へ進む。
In S120, it is determined whether there is a matching part. If k> 0, that is, if there is a matching part, the process proceeds to S127. On the other hand, if there is no match,
Proceed to S132.

【0150】S127からS130は、一致している部
分に関して文字列スコアをスコア表に加味する処理であ
る。S120からS127に進んだときは、部分文字列
X[i,k+1]と部分文字列Y[j,k+1]は一致している。ま
ず、S127で、部分文字列X[i,k+1]の文字列スコア
を求める。これは式(15)のScore(ξ)を求める処理であ
り、図8から図10を用いて前述した。あるいは、式(3
6)から(39)を用いてScore(ξ)を算出する処理であり、
図12、図13、図10に示すフローで実施される。あ
るいは式(36)と式(40)から(41)に示すScore関数を用い
るのでもよい。こうして求められる文字列スコアをtmp_
scoreとする。次に、S128で、tmp_scoreを現在着目
しているスコア(current)に加算して、この値を一時的
な変数valueに記憶する。S129とS130は、式(3
2)を成り立たせるための、比較と書き込みである。その
後、S132へ進む。
Steps S127 to S130 are processing for adding the character string score to the score table for the matching part. When proceeding from S120 to S127, a partial character string
X [i, k + 1] and partial character string Y [j, k + 1] match. First, in S127 , a character string score of the partial character string X [i, k + 1] is obtained. This is a process for obtaining Score (ξ) in Expression (15), which has been described above with reference to FIGS. Alternatively, equation (3
6) is a process of calculating Score (ξ) using (39),
This is carried out according to the flowcharts shown in FIGS. Ah
Alternatively, using the Score function shown in Equation (36) and Equations (40) to (41)
It may be. The calculated string score is tmp_
Score. Next, in S128, tmp_score is added to the current score (current), and this value is stored in a temporary variable value. S129 and S130 are calculated by the formula (3)
Comparison and writing to make 2) hold. Thereafter, the process proceeds to S132.

【0151】S132とS133、S134とS13
5、S136とS137は、それぞれ、式(33)、式(3
4)、式(35)を成り立たせるための、比較と書き込みであ
る。
S132 and S133, S134 and S13
5, S136 and S137 are expressed by equations (33) and (3
4) and comparison and writing to make equation (35) hold.

【0152】S138では、文字列Yから部分文字列を
取り出す先頭を示すjが文字列Yの長さy_len未満である
かを判定している。もし、この条件が成り立つなら、S
139でjを1増やしてS124からS137までの処理
を繰り返す。文字列Yの末尾まで処理が終われば、S1
38からS140へ進む
In S138, it is determined whether or not j indicating the head of extracting the partial character string from the character string Y is less than the length y_len of the character string Y. If this condition holds, S
At 139, j is incremented by 1 and the processing from S124 to S137 is repeated. When the processing is completed up to the end of the character string Y, S1
Proceed from S38 to S140

【0153】S140では、文字列Xから部分文字列を
取り出す先頭を示すiが文字列Xの長さx_len未満である
かを判定している。もし、この条件が成り立つ場合は、
S141でiを1増やして、S123からS138までの
処理を繰り返す。文字列Xの末尾まで処理が終われば、
S140からS142に進む。
In S140, it is determined whether or not i indicating the head of extracting the partial character string from the character string X is less than the length x_len of the character string X. If this condition holds,
In S141, i is increased by 1, and the processing from S123 to S138 is repeated. When processing is completed up to the end of the character string X,
The process proceeds from S140 to S142.

【0154】もし、文字列Xの末尾まで処理が終われ
ば、スコア表は完成している。そこで、S142で、sc
ore[x_len][y_len]を文字列Xと文字列Yの類似度とし
て返す処理を行う。
If the processing is completed up to the end of the character string X, the score table is completed. Therefore, in S142, sc
ore [x_len] [y_len] is returned as the similarity between the character strings X and Y.

【0155】(第7実施例)(Seventh Embodiment)

【0156】次に、同義語辞書情報のある文字列重みの
あるDP類似度SIM4による文書検索をソフトウエアによ
り実施する例を説明する。ソフトウエアの実行に用いる
計算機システムは、前述した図5に示すものを用いる。
文書検索プログラム等を記録媒体に記録しておける点
は、第5実施例と同様である。文書検索プログラムのフ
ローは、図15から図18、図8から図10に示され
る。すなわち、図8から図10に示すスコアを求める処
理は、文字列重みのあるDP類似度SIM3及び類似度SIM
3aと共通している。
Next, an example will be described in which a document search is performed by software using the DP similarity SIM 4 having a character string weight with synonym dictionary information. The computer system shown in FIG. 5 is used for executing the software.
The point that a document search program and the like can be recorded on a recording medium is the same as in the fifth embodiment. The flow of the document search program is shown in FIGS. 15 to 18 and FIGS. 8 to 10. That is, the processing for obtaining the scores shown in FIGS. 8 to 10 is performed by the DP similarity SIM 3 and the similarity SIM
Common to 3a .

【0157】図15は、検索文章に基づいて文書データ
ベースを検索し、類似度の高い文書を選び出して出力す
る処理のフローを示す。なお、図15に示すS211か
らS218は、それぞれ、図6に示すS11からS18
と同等の処理である。
FIG. 15 shows a flow of processing for searching a document database based on a search sentence, selecting and outputting a document having a high degree of similarity. Note that S211 to S218 shown in FIG. 15 correspond to S11 to S18 shown in FIG.
This is the same processing as.

【0158】図15に示すS210で、CD−ROMな
どの記録媒体から同義語に関する情報を読み出して同義
語辞書を作成する。この同義語辞書を作成する処理のフ
ローを図16に示す。この同義語辞書では、辞書の見出
しとなる同義語キーと複数の同義語の組をハッシュテー
ブル(以下、同義語ハッシュテーブル)に登録してい
る。同義語を辞書から検索することは、同義語キーに対
応する同義語を全て取り出すことで実施する。一方、フ
ロッピーディスクやCD−ROMなどの記録媒体は、同
義語辞書の編集や拡張を容易に行うために、同義語キー
に対応する同義語が全て一カ所にまとめて記録してある
とは限らない。ここでは、記録媒体には同義語キーと同
義語とが一つずつ組になって記録されている実施例を説
明する。
In S210 shown in FIG . 15 , information on synonyms is read from a recording medium such as a CD-ROM and a synonym dictionary is created. FIG. 16 shows the flow of the process of creating this synonym dictionary. In this synonym dictionary, a set of a synonym key serving as a dictionary head and a plurality of synonyms is registered in a hash table (hereinafter, synonym hash table). Searching for a synonym from the dictionary is performed by extracting all synonyms corresponding to the synonym key. On the other hand, recording media such as floppy disks and CD-ROMs do not always have all the synonyms corresponding to synonym keys recorded in one place in order to easily edit and expand the synonym dictionary. Absent. Here, a description will be given of an embodiment in which a synonym key and a synonym are recorded in pairs on a recording medium.

【0159】まずS221で、記録媒体から、同義語キ
ーと同義語の組を読み込む。次にS222で、読み込ん
だ同義語キーが既に登録されているか判定する。まだ登
録されていない場合は、S223で同義語キーと同義語
を同義語ハッシュテーブルに登録する。既に同義語キー
が登録されている場合には、S224で、同義語キーに
対応する同義語の後に、「,」(コンマ)や 「\t」(タ
ブ)などの区切り文字と登録すべき同義語が付け加わる
ように、同義語ハッシュテーブルに追加登録する。この
ように登録された一つの同義語、又は、区切り文字で区
切られた複数の同義語を以下では、同義語列と呼ぶこと
にする。
First, in step S221 , a set of a synonym key and a synonym is read from the recording medium. Next, in S222 , it is determined whether the read synonym key is already registered. If not registered, the synonym key and the synonym are registered in the synonym hash table in S223 . If the synonym key has already been registered, in S224 , after the synonym corresponding to the synonym key, a synonym to be registered as a delimiter such as "," (comma) or "\ t" (tab) Register additional words in the synonym hash table so that words are added. In the following, one registered synonym or a plurality of synonyms separated by delimiters will be referred to as a synonym string.

【0160】S223S224の後は、S225で登
録すべき同義語がまだ存在するか判定する。まだ存在す
る場合には、S221からS224までの処理を繰り返
して登録する。言うまでもなく、記録媒体が複数ある場
合(例えば、基本的な同義語を登録したCD−ROM
と、特定の利用分野の同義語を登録するフロッピーディ
スクとを併用する場合)は、全ての記録媒体に対して、
以上の処理を行う。このようにして、全ての同義語を登
録し終えたなら、同義語辞書の作成は終了する。
After S223 and S224 , it is determined in S225 whether a synonym to be registered still exists. If it still exists, the process from S221 to S224 is repeated and registered. Needless to say, when there are a plurality of recording media (for example, a CD-ROM in which basic synonyms are registered)
Is used together with a floppy disk that registers synonyms for a specific field of use).
The above processing is performed. When all the synonyms have been registered in this way, the creation of the synonym dictionary ends.

【0161】次に、図15に示すS211で、ある文字
列の出現回数を効率よく計算する準備のために、文書デ
ータベースに含まれる全文書を総合して、前述したサフ
ィックスファイルを作成する。そして、S212で、検
索文章を文字列Xに読み込む。S213では、文書デー
タベースの文書から、ある一つの文書を選んで文字列Y
に読み込む。次にS214で、文字列Xと文字列Yの類似
度SIM4(X,Y)を計算する。S214で行う処理は、図1
7と図18を用いて後述する。S215では、求めた類
似度と文書番号を組として文書管理テーブルに登録す
る。S216では、文書データベースに含まれる全ての
文書について類似度を計算したかどうか判定する。も
し、まだ全ての文書について計算していなければ、計算
を未だ行っていない文書をS213で選んで文字列Yに
読み込み、S215までの処理を繰り返す。もし、全て
の文書について計算していれば、S217で、登録した
テーブルを類似度の高い順に並び替える。S218では
類似度の高い文書から、一つ又は幾つかを出力する処理
を行う。
Next, in step S211 shown in FIG. 15 , all the documents included in the document database are integrated to create the above-mentioned suffix file in order to efficiently calculate the number of appearances of a certain character string. Then, in S212 , the search text is read into the character string X. In S213 , a certain document is selected from the documents in the document database and the character string Y is selected.
Read in. Next, in S214 , the similarity SIM 4 (X, Y) between the character strings X and Y is calculated. The processing performed in S214 is the same as that in FIG.
7 and FIG . In S215 , the obtained similarity and the document number are registered as a set in the document management table. In S216 , it is determined whether the similarity has been calculated for all the documents included in the document database. If the calculation has not been performed for all the documents, a document that has not been calculated is selected in S213 and read into the character string Y, and the processing up to S215 is repeated. If the calculation has been performed for all the documents, in S217 , the registered tables are rearranged in descending order of similarity. In S218 , a process of outputting one or several documents from a document having a high degree of similarity is performed.

【0162】類似度は、式(30)に示す同義語スコアSyno
nymScore(T)を足し合わせることによって求める。この
足し合わせの途中の値も以下では、スコアと呼ぶ。式(2
6)と(29)の関数MAXから分かるように、同義語スコアを
加算したスコアや長さを1文字ずつ変えた部分文字列に
対してスコアを計算し、それらの最大値を選択する必要
がある。そこで、図11を用いて前述したスコア表を利
用する。本実施例においては、スコア表を完成させる
と、右下のscore[x_len][y_len]が類似度SIM4(X,Y)とな
る。
The similarity is calculated using the synonym score Syno shown in equation (30).
It is determined by adding nymScore (T). In the following, the value in the middle of this addition is also called a score. Equation (2
As can be seen from the functions MAX in (6) and (29), it is necessary to calculate the score for the sum of the synonym scores and for the substring in which the length is changed one character at a time, and select the maximum value. is there. Therefore, the score table described with reference to FIG. 11 is used. In this embodiment, when the score table is completed, the lower right score [x_len] [y_len] becomes the similarity SIM 4 (X, Y).

【0163】図17図18は、検索文章を読み込んだ
文字列Xと、文書データベースの文書を読み込んだ文字
列Yの類似度を求める処理のフローを示す。まず始め
に、図17に示すS231で、文字列Xと文字列Yのスコ
ア表score[i][j]の全ての値を0に初期化する。次に、
S232では、文字列Xから部分文字列を取り出す先頭
を示すiを0に設定する。S233では、文字列Xから取
り出す部分文字列の長さを示すmを1に設定する。
FIGS. 17 and 18 show a flow of processing for obtaining the similarity between the character string X from which the search text has been read and the character string Y from which the document in the document database has been read. First, in S231 shown in FIG. 17 , all values of the score tables score [i] [j] of the character strings X and Y are initialized to zero. next,
In S232, i indicating the beginning of extracting the partial character string from the character string X is set to 0. In S233, m indicating the length of the partial character string extracted from the character string X is set to 1.

【0164】S234では、文字列Xの部分文字列X[i,
m]が同義語ハッシュテーブルの同義語キーに存在するか
を判定する。もし、同義語キーに存在しなければS23
6へ進む。もし、同義語キーに存在すれば、S235
で、X[i,m]に対応する同義語列Aを同義語辞書ハッシュ
テーブルから取り出す。
In S234, the substring X [i,
m] exists in the synonym key of the synonym hash table. If it does not exist in the synonym key, S23
Proceed to 6. If it exists in the synonym key, S235
Then, the synonym string A corresponding to X [i, m] is extracted from the synonym dictionary hash table.

【0165】次にS236では、文字列Yから部分文字
列を取り出す先頭を示すjを0に設定する。S237で
は、スコア表において現在着目しているスコアscore[i]
[j]を、処理の便宜のために、一時的な変数currentに記
憶する。
Next, in S236, j indicating the beginning of extracting the partial character string from the character string Y is set to 0. In S237, the score score [i] currently focused on in the score table
[j] is stored in a temporary variable current for convenience of processing.

【0166】S238では、S234と同じく、文字列
Xの部分文字列X[i,m]が同義語ハッシュテーブルの同義
語キーに存在するかを判定する。もし、同義語キーに存
在しなければ、同義語スコアを検討する必要がないの
で、図18に示すS251に進む。もし、同義語キーに
存在すれば、図17に示すS239からS250におい
て、最大となる同義語スコアを探して処理を行う。これ
は式(27)に相当する処理である。
In step S238, the character string is set in the same manner as in step S234.
It is determined whether the substring X [i, m] of X exists in the synonym key of the synonym hash table. If it does not exist in the synonym key, there is no need to consider the synonym score, so the process proceeds to S251 shown in FIG . If it exists in the synonym key, the processing is performed by searching for the maximum synonym score from S239 to S250 shown in FIG . This is processing corresponding to equation (27).

【0167】S239では、同義語ハッシュテーブルに
登録されている同義語列Aから一つの同義語aを取り出
す。これが文字列Yの部分文字列Y[j,n]と一致するかを
S240からS243で確かめる。S240では、文字
列Yから取り出す部分文字列の長さを示すnを1に設定す
る。そして、S241で部分文字列Y[j,n]が同義語aと
等しい文字列か否かを判定する。等しくなければ、S2
42でj+n < y_lenか、すなわち、部分文字列の末尾が
文字列Yの末尾に至っていないかを判定する。もし、こ
の条件に合うなら、S243でnを1増やすことで部分文
字列の長さを増やし、S241の判定を再度行う。も
し、この条件に合わない場合は、同義語aが部分文字列Y
[j,n]と合わない場合なので、S250に進む。
In S239, one synonym a is extracted from the synonym string A registered in the synonym hash table. It is confirmed from S240 to S243 whether this matches the partial character string Y [j, n] of the character string Y. In S240, n indicating the length of the partial character string extracted from the character string Y is set to 1. Then, in S241, it is determined whether or not the partial character string Y [j, n] is a character string equal to the synonym a. If not equal, S2
At 42, it is determined whether j + n <y_len, that is, whether the end of the partial character string has not reached the end of the character string Y. If this condition is met, the length of the partial character string is increased by increasing n by 1 in S243, and the determination in S241 is performed again. If this condition is not met, the synonym a is
Since it does not match [j, n], the process proceeds to S250.

【0168】S241において、部分文字列Y[j,n]が同
義語aと等しい場合には、S244で同義語aの同義語ス
コアを求める。これは式(30)のSynonymScoreを求める処
理である。式(15)と式(30)が同じ形であることから分か
るように、同義語aに対する文字列スコアを求めると、
それは同義語スコアである。そこで、図8から図10を
用いて前述した処理により、同義語スコアを求める。
If the partial character string Y [j, n] is equal to the synonym a in S241, the synonym score of the synonym a is determined in S244. This is a process for calculating the SynonymScore in Expression (30). As can be seen from the fact that the expressions (15) and (30) have the same form, when the character string score for the synonym a is obtained,
It is a synonym score. Therefore, a synonym score is obtained by the processing described above with reference to FIGS.

【0169】図17のS244では、同義語aの同義語
スコアをtmp_scoreとする。S245ではtmp_scoreが0
であるかどうかを判定する。もし、0ならこの同義語aは
検索には役立たない。そこで、次回のtmp_scoreを求め
る手間を省くため、S246で同義語ハッシュテーブル
から削除する。一方、tmp_score(a)が0でなければ、S
247で現在着目しているスコア(current)に加算し
て、この値を一時的な変数valueに記憶する。S248
とS249は、式(32)を成り立たせるための、比較と書
き込みである。
In S244 of FIG . 17 , the synonym score of the synonym a is set to tmp_score. Tmp_score is 0 in S245
Is determined. If 0, this synonym a is useless for searching. Therefore, in order to save the trouble of obtaining the next time tmp_score, it is deleted from the synonym hash table in S246. On the other hand, if tmp_score (a) is not 0, S
At 247, the value is added to the current score (current), and this value is stored in a temporary variable value. S248
And S249 are comparison and writing for satisfying the expression (32).

【0170】S250では、同義語列Aに含まれている
同義語を、全て取り出したか判定する。全て取り出して
いない場合には、残っている同義語に対してS239か
らS249までの処理を繰り返す。全ての同義語を取り
出した場合には、図18に示すS251に進む。
In S250, it is determined whether all synonyms included in the synonym string A have been extracted. If not all have been extracted, the processing from S239 to S249 is repeated for the remaining synonyms. If all synonyms have been extracted, the process proceeds to S251 shown in FIG .

【0171】S251とS252、S253とS25
4、S255とS256は、それぞれ、式(33)、式(3
4)、式(35)を成り立たせるための、比較と書き込みであ
る。
S251 and S252, S253 and S25
4, S255 and S256 are expressed by equations (33) and (3
4) and comparison and writing to make equation (35) hold.

【0172】S257では、文字列Yから部分文字列を
取り出す先頭を示すjが文字列Yの長さy_len未満である
かを判定している。もし、この条件が成り立つなら、S
258でjを1増やしてS237からS256までの処理
を繰り返す。
In S257, it is determined whether j indicating the head of extracting the partial character string from the character string Y is less than the length y_len of the character string Y. If this condition holds, S
In step 258, j is incremented by 1, and the processing from S237 to S256 is repeated.

【0173】S259では、文字列Xから取り出す部分
文字列Xの文字数mを1増やしている。そしてS260
で、mがMAX_JAよりも小さく、かつ、i+mが文字列Xの長
さx_lenよりも小さいかを判定している。もし、この条
件が成り立つならS234からS259までの処理を繰
り返す。ここで、MAX_JAは、意味のある文字列の最大文
字数を示す。あまり長い文字列からなる同義語は同義語
辞書に載っていない。そこで、かかる長い文字列で同義
語辞書を参照する無駄を省くためにMAX_JAによる制限を
設けておく。日本語を実施する本実施例では、MAX_JAは
20としている。この値は、同義語ハッシュテーブルに登
録した最も長い同義語キーか同義語の長さに設定してお
くと、無駄がなくてより好ましい。
In S259, the number m of characters of the partial character string X extracted from the character string X is increased by one. And S260
It is determined whether m is smaller than MAX_JA and i + m is smaller than the length x_len of the character string X. If this condition is satisfied, the processing from S234 to S259 is repeated. Here, MAX_JA indicates the maximum number of characters of a meaningful character string. Synonyms consisting of too long strings are not listed in the synonym dictionary. Therefore, a limit by MAX_JA is provided in order to eliminate the waste of referring to the synonym dictionary with such a long character string. In this embodiment that implements Japanese, MAX_JA is
20. It is more preferable to set this value to the longest synonym key or the length of the synonym registered in the synonym hash table without waste.

【0174】さて、S260に示す条件が成り立たない
場合は、S261に進む。S261では、文字列Xから
部分文字列を取り出す先頭を示すiが文字列Xの長さx_le
n未満であるかを判定している。もし、この条件が成り
立つ場合は、S262でiを1増やして、S233からS
260までの処理を繰り返す。もし、この条件が成り立
たなければ、スコア表が完成した場合なので、S263
で、score[x_len][y_len]を文字列Xと文字列Yの類似
度として返す処理を行う。
If the condition shown in S260 is not satisfied, the flow advances to S261. In S261, i indicating the beginning of extracting a partial character string from the character string X is the length x_le of the character string X
It is determined whether it is less than n. If this condition is satisfied, i is incremented by 1 in S262, and S233 to S
The processing up to 260 is repeated. If this condition is not satisfied, it means that the score table has been completed.
Then, a process of returning score [x_len] [y_len] as the similarity between the character strings X and Y is performed.

【0175】(第8実施例)(Eighth Embodiment)

【0176】第4実施例において説明したのと同様に、
第7実施例における同義語辞書として、対訳辞書を用い
れば、異なる言語の文書の類似度を求めることができ
る。すなわち、ソフトウエアにより言語横断情報検索を
行う情報検索装置が実施できる。
As described in the fourth embodiment,
If a bilingual dictionary is used as the synonym dictionary in the seventh embodiment, the similarity between documents in different languages can be obtained. That is, an information search device that performs cross-language information search by software can be implemented.

【0177】以上の実施例の説明から分かるように、第
1の発明である文字列類似度算出方法は、第1実施例、
第2実施例、第5実施例、及び、第6実施例で実施され
ている。
As can be seen from the above description of the embodiment, the character string similarity calculation method according to the first invention is the same as that of the first embodiment,
This is performed in the second embodiment, the fifth embodiment, and the sixth embodiment.

【0178】第2の発明である文字列類似度算出方法
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例が、式(16)に示す場合を有するScore関数を用い
ることで実施されている。
The character string similarity calculating method according to the second aspect of the present invention includes a first embodiment, a second embodiment, a fifth embodiment, and a sixth embodiment.
The embodiment is implemented using a Score function having the case shown in equation (16).

【0179】第3の発明である文字列類似度算出方法
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例が、式(15)に示すScore関数を用いることで実施
されている。
The character string similarity calculating method according to the third aspect of the present invention includes the first embodiment, the second embodiment, the fifth embodiment, and the sixth embodiment.
The embodiment is implemented by using the Score function shown in Expression (15).

【0180】第4の発明である文字列類似度算出方法
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例が、式(36)に示す出現集中度に応じて、式(38)に
示すScore関数を用いること、または式(40)に示すScore
関数を用いることで実施されている。
A character string similarity calculation method according to the fourth invention
Are the first embodiment, the second embodiment, the fifth embodiment, and the sixth embodiment.
In the example, the expression (38) is used in accordance with the appearance concentration shown in the expression (36).
Use the Score function shown, or use the Score shown in equation (40)
It is implemented using functions.

【0181】第5の発明である文字列類似度算出方法
は、第2実施例、及び、第6実施例が、式(21)を用いる
ことで実施されている。
In the character string similarity calculating method according to the fifth invention, the second and sixth embodiments are implemented by using equation (21).

【0182】第6の発明である文字列類似度算出方法
は、第3実施例、第4実施例、第7実施例、及び、第8
実施例で実施されている。
The character string similarity calculating method according to the sixth aspect of the present invention includes a third embodiment, a fourth embodiment, a seventh embodiment, and an eighth embodiment.
This is implemented in the embodiment.

【0183】第7の発明である文字列類似度算出方法
は、第3実施例、第4実施例、第7実施例、及び、第8
実施例が、式(30)に示すSynonymScore関数を用いること
で実施されている。
The character string similarity calculating method according to the seventh aspect of the present invention includes a third embodiment, a fourth embodiment, a seventh embodiment, and an eighth embodiment.
The embodiment is implemented by using the SynonymScore function shown in Expression (30).

【0184】第8の発明である文字列類似度算出方法
は、第4実施例、及び、第8実施例が、同義語辞書とし
て対訳辞書を用いることで実施されている。
The character string similarity calculating method according to the eighth aspect of the present invention is implemented in the fourth and eighth embodiments by using a bilingual dictionary as a synonym dictionary.

【0185】第9の発明である文字列類似度算出方法
は、第1実施例、及び、第5実施例が、式(11)を用いる
ことで実施されている。また、第3実施例、第4実施
例、第7実施例、及び、第8実施例が、式(27)を用いる
ことでも実施されている。
The character string similarity calculation method according to the ninth aspect of the present invention is implemented in the first embodiment and the fifth embodiment by using equation (11). Further, the third, fourth, seventh, and eighth embodiments are also implemented by using equation (27).

【0186】第10の発明である文字列類似度算出装置
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例で実施されている。なお、第5実施例において
は、文字列スコア算出部は、図7に示すS27で実施さ
れている。一致文字列類似度算出部は、S28で実施さ
れている。任意文字列類似度算出部は、iとjの値を順次
増加しながら、S32からS37までの処理を繰り返す
ことで実施されている。選択部は、S29とS30、S
32からS37まで、の両方を行うことによって実施さ
れている。第6実施例においては、文字列スコア算出部
は、図14に示すS127で実施されている。一致文字
列類似度算出部は、S128で実施されている。任意文
字列類似度算出部は、iとjの値を順次増加しながら、S
132からS137までの処理を繰り返すことで実施さ
れている。選択部は、S129とS130、S132か
らS137まで、の両方を行うことによって実施されて
いる。
The character string similarity calculating apparatus according to the tenth aspect of the present invention includes a first embodiment, a second embodiment, a fifth embodiment, and a sixth embodiment.
This is implemented in the embodiment. In the fifth embodiment, the character string score calculation unit is performed in S27 shown in FIG. The matching character string similarity calculation unit is performed in S28. The arbitrary character string similarity calculation unit is implemented by repeating the processes from S32 to S37 while sequentially increasing the values of i and j. The selection unit includes S29 and S30, S
This is implemented by performing both of steps S32 to S37. In the sixth embodiment, the character string score calculator is implemented in S127 shown in FIG . The matching character string similarity calculation unit is performed in S128. The arbitrary character string similarity calculator calculates the S while sequentially increasing the values of i and j.
This is implemented by repeating the processes from 132 to S137. The selection unit is implemented by performing both of S129 and S130 and S132 to S137.

【0187】第11の発明である文字列類似度算出装置
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例が、式(15)に示すScore関数を用いることで実施
されている。
The character string similarity calculating apparatus according to the eleventh aspect of the present invention comprises a first embodiment, a second embodiment, a fifth embodiment, and a sixth embodiment.
The embodiment is implemented by using the Score function shown in Expression (15).

【0188】第12の発明である文字列類似度算出装置
は、第1実施例、第2実施例、第5実施例、及び、第6
実施例が、式(36)に示す出現集中度に応じて、式(38)に
示すScore関数を用いること、または式(40)に示すScore
関数を用いることで実施されている。
A character string similarity calculating apparatus according to the twelfth invention
Are the first embodiment, the second embodiment, the fifth embodiment, and the sixth embodiment.
In the example, the expression (38) is used in accordance with the appearance concentration shown in the expression (36).
Use the Score function shown, or use the Score shown in equation (40)
It is implemented using functions.

【0189】第13の発明である文字列類似度算出装置
は、第3実施例、第4実施例、第7実施例、及び、第8
実施例で実施されている。なお、第7実施例において
は、同義語スコア算出部は、図17に示すS244で実
施されている。一致文字列類似度算出部は、S247で
実施されている。任意文字列類似度算出部は、iとjの値
を順次増加しながら、図18に示すS251からS25
6までの処理を繰り返すことで実施されている。選択部
は、図17に示すS248とS249、図18に示すS
251からS256まで、の両方を行うことによって実
施されている。
A character string similarity calculating apparatus according to a thirteenth aspect of the present invention includes a third embodiment, a fourth embodiment, a seventh embodiment, and an eighth embodiment.
This is implemented in the embodiment. In the seventh embodiment, the synonym score calculation unit is performed in S244 shown in FIG . The matching character string similarity calculation unit is performed in S247. The arbitrary character string similarity calculating unit sequentially increases the values of i and j, and proceeds from S251 to S25 shown in FIG.
This is implemented by repeating the processing up to 6. Selecting unit, S248 and S249 shown in FIG. 17, S shown in FIG. 18
251 to S256 are performed.

【0190】第14の発明である文字列類似度算出装置
は、第3実施例、第4実施例、第7実施例、及び、第8
実施例が、式(30)に示すSynonymScore関数を用いること
で実施されている。
The character string similarity calculating apparatus according to the fourteenth aspect of the present invention includes a third embodiment, a fourth embodiment, a seventh embodiment, and an eighth embodiment.
The embodiment is implemented by using the SynonymScore function shown in Expression (30).

【0191】第15の発明である文字列類似度算出装置
は、第1から第8実施例で実施されている。
A character string similarity calculating apparatus according to a fifteenth aspect is implemented in the first to eighth embodiments.

【0192】第16の発明に記載の文字列類似度算出プ
ログラムは、第5実施例、及び、第6実施例で実施され
ている。なお、第5実施例においては、対比設定過程
は、図7に示すS41とS39によってiとjを順に増や
すことで実施されている。共通部分文字列特定過程は、
S25、S26とS31で実施されている。文字列スコ
ア設定過程は、S27で実施されている。文字列スコア
加算過程は、S28で実施されている。進行処理過程
は、S29とS30、S32からS37まで、の両方に
よって実施されている。また、第6実施例においては、
対比設定過程は、図14に示すS141とS139によ
ってiとjを順に増やすことで実施されている。共通部分
文字列特定過程は、S125、S126とS131で実
施されている。文字列スコア設定過程は、S127で実
施されている。文字列スコア加算過程は、S128で実
施されている。進行処理過程は、以上の過程を繰り返し
ながら、S129とS130、S132からS137ま
で、の両方を行うことによって実施されている。
The character string similarity calculation program according to the sixteenth invention is implemented in the fifth embodiment and the sixth embodiment. In the fifth embodiment, the comparison setting process is performed by sequentially increasing i and j in S41 and S39 shown in FIG. The common substring identification process is as follows:
This is performed in S25, S26, and S31. The character string score setting process is performed in S27. The character string score adding process is performed in S28. The progress process is performed by both S29 and S30, and S32 to S37. In the sixth embodiment,
Contrast setting process is performed by increasing the i and j in sequence by S141 and S139 shown in FIG. 14. The common part character string specifying process is performed in S125, S126, and S131. The character string score setting process is performed in S127. The character string score adding process is performed in S128. The progress processing step is performed by repeating both of the above steps and performing both steps S129 and S130 and steps S132 to S137.

【0193】第17の発明に記載の文字列類似度算出プ
ログラムは、第5実施例、及び、第6実施例が、文字列
スコアを定めるために、図8に示すS56を行うことで
実施されている。
The character string similarity calculation program described in the seventeenth invention is implemented by the fifth and sixth embodiments by performing S56 shown in FIG. 8 in order to determine a character string score. ing.

【0194】第18の発明に記載の文字列類似度算出プ
ログラムは、第5実施例、及び、第6実施例が、文字列
スコアを定めるために、図12に示すS87の判定に応
じて、S88を行うことで実施されている。
A character string similarity calculation program according to the eighteenth aspect of the present invention.
The program is the same as the fifth and sixth embodiments except that the character string
In order to determine the score, it is necessary to respond to the determination in S87 shown in FIG.
First, S88 is performed.

【0195】第19の発明に記載の文字列類似度算出プ
ログラムは、第5実施例、及び、第6実施例が、図9と
図10に示す処理を実行することによって実施されてい
る。
The character string similarity calculation program according to the nineteenth aspect of the present invention is implemented by executing the processing shown in FIGS. 9 and 10 in the fifth and sixth embodiments .

【0196】第20の発明に記載の文字列類似度算出プ
ログラムは、第7実施例、及び、第8実施例で実施され
ている。それぞれの実施例において、対比設定過程は、
図18に示すS258とS262によってiとjを順に増
やすことで実施されている。同義語特定過程は、図17
に示すS234とS241で実施されている。同義語ス
コア設定過程は、S244で実施されている。同義語ス
コア加算過程は、S247で実施されている。進行処理
過程は、以上の過程を繰り返しながら、S248とS2
49、図18に示すS251からS256まで、の両方
を行うことによって実施されている。
The character string similarity calculation program according to the twentieth invention is implemented in the seventh and eighth embodiments. In each embodiment, the comparison setting process includes:
This is implemented by sequentially increasing i and j by S258 and S262 shown in FIG . The synonym identification process is shown in FIG.
S234 and S241 shown in FIG. The synonym score setting process is performed in S244. The synonym score adding process is performed in S247. In the progress processing process, S248 and S2
49, and is performed by performing both of S251 to S256 shown in FIG .

【0197】第21の発明に記載の文字列類似度算出プ
ログラムは、第7実施例、及び、第8実施例が、同義語
スコアを求めるために、図8に示すS56を行うことで
実施されている。
The character string similarity calculation program according to the twenty-first invention is implemented by the seventh and eighth embodiments by performing S56 shown in FIG. 8 in order to obtain a synonym score. ing.

【0198】第22の発明に記載の文字列類似度算出プ
ログラムは、第7実施例、及び、第8実施例が、図9と
図10に示す処理を実行することによって実施されてい
る。
The character string similarity calculation program described in the twenty-second invention is implemented by the seventh embodiment and the eighth embodiment by executing the processing shown in FIGS. 9 and 10.

【0199】第23の発明に記載の文字列類似度算出プ
ログラムは、第5から第8実施例が、図11に示すスコ
ア表を用いて、式(32)から(35)を成り立たせるための比
較と書き込みを行うことで実施されている。
The character string similarity calculation program according to the twenty- third aspect is provided so that the fifth to eighth embodiments allow the expressions (32) to (35) to be satisfied by using the score table shown in FIG. It is implemented by comparing and writing.

【0200】第24の発明に記載の文章検索プログラム
は、第5から第8実施例で実施されている。
The text search program according to the twenty-fourth invention is implemented in the fifth to eighth embodiments.

【0201】なお、本発明の技術的範囲は、これら実施
例に限られるものではなく、請求項と均等の範囲内を含
んでおり、発明の趣旨を変えない範囲で、種々の変形が
可能である。
The technical scope of the present invention is not limited to these embodiments, but includes the scope equivalent to the claims and can be variously modified without changing the gist of the invention. is there.

【0202】[0202]

【発明の効果】第1の発明によれば、二つの文字列それ
ぞれにおける順序に適合し、かつ、共通する部分文字列
に着目して類似度を求めることができる。すなわち、文
字列の出現順序を考慮した類似度が求められる。
According to the first aspect of the present invention, the degree of similarity can be obtained by focusing on the common partial character string, which is suitable for the order of the two character strings. That is, the similarity is calculated in consideration of the appearance order of the character strings.

【0203】第2の発明によれば、さらに、共通する部
分文字列が長い方が、重みがより重くなる場合がある。
そのため、類似度も高くなる傾向になる。従って、共通
する部分文字列としてより長いものが選ばれて、求まっ
た類似度はより適切な値となる。
According to the second invention, the longer the common partial character string, the higher the weight may be.
Therefore, the similarity tends to increase. Therefore, a longer one is selected as the common partial character string, and the obtained similarity becomes a more appropriate value.

【0204】第3の発明によれば、さらに、情報量を反
映した類似度を求めることができる。従って、情報量に
関する情報理論の知見を応用しやすくなる。
According to the third aspect, it is possible to further obtain a similarity reflecting the amount of information. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0205】第4の発明によれば、さらに、出現集中度
を反映した類似度を求めることができる。出現集中度を
利用することで、検索により有効な文字列をより多く重
みを与えることができ、検索精度を向上することができ
According to the fourth aspect, the degree of appearance concentration is further improved .
Can be obtained. Concentration of appearance
By using, more effective character strings can be
Can improve the search accuracy
You .

【0206】第5の発明によれば、さらに、共通する部
分文字列を敢えて分割してみることがないので、演算量
が節約できる。
According to the fifth aspect of the present invention, it is not necessary to divide a common partial character string, so that the amount of calculation can be reduced.

【0207】第6の発明によれば、二つの文字列それぞ
れにおける順序に適合し、かつ、同義語辞書の要素であ
る部分文字列に着目して類似度を求めることができる。
従って、同義語が使われている場合であっても、類似度
を適切に求めることができる。
According to the sixth aspect, the degree of similarity can be obtained by focusing on the partial character string which is suitable for the order of each of the two character strings and is an element of the synonym dictionary.
Therefore, even when a synonym is used, the similarity can be appropriately obtained.

【0208】第7の発明によれば、さらに、情報量を反
映した類似度を求めることができる。従って、情報量に
関する情報理論の知見を応用しやすくなる。
According to the seventh aspect , a similarity reflecting the amount of information can be obtained. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0209】第8の発明によれば、異なる言語の文字列
の類似度を求めることができる。
[0209] According to the eighth aspect , the similarity between character strings in different languages can be obtained.

【0210】第9の発明によれば、さらに、類似度が最
大値となるように、部分文字列が求められる。従って、
算出された類似度が最大値であるという点で、合理的な
類似度が求められる。
According to the ninth aspect , further, a partial character string is obtained such that the similarity has the maximum value. Therefore,
A reasonable similarity is obtained in that the calculated similarity is the maximum value.

【0211】第10の発明によれば、二つの文字列それ
ぞれにおける順序に適合し、かつ、共通する部分文字列
に着目して類似度を求める装置が実現できる。すなわ
ち、文字列の出現順序を考慮した類似度が、この装置に
よって求められる。
According to the tenth aspect , it is possible to realize a device that conforms to the order of two character strings and obtains a similarity by focusing on a common partial character string. That is, the similarity in which the appearance order of the character strings is considered is obtained by this device.

【0212】第11の発明によれば、さらに、情報量を
反映した類似度を求める装置が実現できる。従って、情
報量に関する情報理論の知見を応用しやすくなる。
According to the eleventh aspect , it is possible to realize a device for obtaining a similarity reflecting the amount of information. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0213】第12の発明によれば、さらに、出現集中
度を反映した類似度を求める装置が実現できる。出現集
中度を利用することで、検索により有効な文字列をより
多く重みを与えることができ、検索精度を向上すること
ができる。
According to the twelfth aspect, the appearance and concentration
A device that obtains a similarity reflecting the degree can be realized. Appearance collection
By using medium, more effective character strings can be searched
Can give more weight and improve search accuracy
Can be.

【0214】第13の発明によれば、二つの文字列それ
ぞれにおける順序に適合し、かつ、同義語辞書の要素で
ある部分文字列に着目して類似度を求める装置が実現で
きる。従って、同義語が使われている場合であっても、
この装置によって類似度を適切に求めることができる。
According to the thirteenth aspect , it is possible to realize an apparatus which conforms to the order of two character strings and obtains a similarity by focusing on a partial character string which is an element of a synonym dictionary. Therefore, even if synonyms are used,
With this device, the similarity can be determined appropriately.

【0215】第14の発明によれば、さらに、情報量を
反映した類似度を求める装置が実現できる。従って、情
報量に関する情報理論の知見を応用しやすくなる。
[0215] According to the fourteenth aspect, an apparatus for obtaining a similarity reflecting the amount of information can be realized. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0216】第15の発明によれば、さらに、文書デー
タベースの中から、検索文章と類似度の高い文書を、検
索する装置が実現できる。
According to the fifteenth aspect , it is possible to realize an apparatus for searching a document database for a document having a high similarity to a search sentence.

【0217】第16の発明によれば、二つの文字列それ
ぞれにおける順序に適合し、かつ、共通する部分文字列
に着目して類似度を求めるプログラムが実現できる。す
なわち、文字列の出現順序を考慮した類似度が、このプ
ログラムによって求められる。
According to the sixteenth aspect , it is possible to realize a program that matches the order of two character strings and obtains a similarity by focusing on a common partial character string. That is, the similarity in consideration of the appearance order of the character strings is obtained by this program.

【0218】第17の発明によれば、さらに、情報量を
反映した類似度を求めるプログラムが実現できる。従っ
て、情報量に関する情報理論の知見を応用しやすくな
る。
According to the seventeenth aspect , it is possible to realize a program for obtaining a similarity reflecting the amount of information. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0219】第18の発明によれば、さらに、出現集中
度を反映した類似度を求めるプログラムが実現できる。
出現集中度を利用することで、検索により有効な文字列
をより多く重みを与えることができ、検索精度を向上す
ることができる。
According to the eighteenth aspect, the appearance and concentration
A program that obtains a similarity reflecting the degree can be realized.
Character strings that are more effective in searching by using the appearance concentration
Can give more weight and improve search accuracy
Can be

【0220】第19の発明によれば、さらに、サフィッ
クスファイルを使って高速に処理するプログラムが実現
できる。
According to the nineteenth aspect , a program that performs high-speed processing using a suffix file can be realized.

【0221】第20の発明によれば、二つの文字列それ
ぞれにおける順序に適合し、かつ、同義語辞書の要素で
ある部分文字列に着目して類似度を求めるプログラムが
実現できる。従って、同義語が使われている場合であっ
ても、このプログラムによって類似度を適切に求めるこ
とができる。
According to the twentieth aspect , it is possible to realize a program that conforms to the order of two character strings and obtains a similarity by focusing on a partial character string that is an element of a synonym dictionary. Therefore, even when synonyms are used, the similarity can be appropriately obtained by this program.

【0222】第21の発明によれば、さらに、情報量を
反映した類似度を求めるプログラムが実現できる。従っ
て、情報量に関する情報理論の知見を応用しやすくな
る。
According to the twenty-first aspect , a program for obtaining a similarity reflecting an information amount can be realized. Therefore, it becomes easy to apply the knowledge of the information theory regarding the amount of information.

【0223】第22の発明によれば、さらに、サフィッ
クスファイルを使って高速に処理するプログラムが実現
できる。
According to the twenty-second aspect , a program that performs high-speed processing using a suffix file can be realized.

【0224】第23の発明によれば、さらに、ダイナミ
ックプログラミング手法によって高速に処理するプログ
ラムが実現できる。
According to the twenty-third aspect, a program which can be processed at a high speed by the dynamic programming technique can be realized.

【0225】第24の発明によれば、さらに、文書デー
タベースの中から、検索文章と類似度の高い文書を、検
索する装置が実現できる。
According to the twenty-fourth aspect , an apparatus for searching a document database for a document having a high similarity to a search sentence can be realized.

【0226】次に、本発明による検索性能を説明する。
従来技術と本発明の実施例で最も近いもの同士を対比す
るために、文字重みDP類似度SIM2と、文字列重みDP
類似度SIM3の検索性能を図19に示す。重みづけを統一
して比較するために、いずれの類似度に対しても、重み
を与えるScore関数は図8に示すフローで求まるものを
適用した。言うまでもなく、文字重みDP類似度SIM2
求めるときに、図8に示すS51の文字列aに与えるの
は、長さ1の文字列(文字)である。
Next, search performance according to the present invention will be described.
In order to compare the closest ones between the prior art and the embodiment of the present invention, a character weight DP similarity SIM 2 and a character string weight DP
The search performance of the similarity SIM 3 is shown in FIG . In order to unify the weights and compare them, for any similarity, a Score function obtained by the flow shown in FIG. Needless to say, when the character weight DP similarity SIM 2 is obtained, what is given to the character string a in S51 shown in FIG. 8 is a character string (character) of length 1.

【0227】検索文章を種々に変えると、文書データベ
ースの中で関連ある文書(正しく検索されるべき文書)
の数も変化する。これを横軸に示す。縦軸に、正当率
(precision)と再現率(recall)を示す。正当率は、
検索された文書の中で、関連ある文書の数の割合であ
る。もし、関連ない文書を混同することなく関連ある文
書のみ検索ができれば、正当率は1となる。再現率は、
文書データベースの中の全ての関連ある文書の中で、検
索された関連ある文書の数の割合である。もし、関連あ
る文書を文書データベースから漏れなく検索できれば、
再現率は1となる。
When the search text is variously changed, related documents (documents to be correctly searched) in the document database
Also vary. This is shown on the horizontal axis. The vertical axis shows the validity rate (precision) and the recall rate (recall). The legitimate rate is
This is the ratio of the number of relevant documents in the retrieved documents. If only relevant documents can be searched without confusing unrelated documents, the validity rate is 1. The recall is
It is the ratio of the number of relevant documents retrieved among all relevant documents in the document database. If relevant documents can be retrieved from the document database without omission,
The recall is 1.

【0228】従来技術による類似度SIM2の正当率201
に比べて、本発明による類似度SIM3の正当率202は大
幅に向上している。同様に、従来技術による類似度SIM2
の再現率203に比べて、本発明によるSIM3の再現率2
02も大幅に向上している。例えば、関連ある文書の数
が400の場合は、正当率、再現率とも約4倍の検索性能
が得られている。このように、本発明によって、飛躍的
に検索性能を向上させることができる。
The legitimacy rate 201 of the similarity SIM 2 according to the prior art
As compared with the above, the validity rate 202 of the similarity SIM 3 according to the present invention is greatly improved. Similarly, the similarity SIM 2 according to the prior art
Of the SIM 3 according to the present invention as compared with the recall 203 of
02 has also improved significantly. For example, when the number of relevant documents is 400, the search performance is about four times as high in both the correct rate and the recall rate. As described above, according to the present invention, search performance can be dramatically improved.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明による文書検索装置の実施例を示す図で
ある。
FIG. 1 is a diagram showing an embodiment of a document search device according to the present invention.

【図2】本発明による文書検索装置の別の実施例を示す
図である。
FIG. 2 is a diagram showing another embodiment of the document search device according to the present invention.

【図3】本発明による文書検索装置の別の実施例を示す
図である。
FIG. 3 is a diagram showing another embodiment of the document search device according to the present invention.

【図4】本発明による文書検索装置の別の実施例を示す
図である。
FIG. 4 is a diagram showing another embodiment of the document search device according to the present invention.

【図5】本発明により文章検索を行う計算機システムの
実施例を示す図である。
FIG. 5 is a diagram showing an embodiment of a computer system for performing a sentence search according to the present invention.

【図6】本発明の実施例の文章検索を行う処理のフロー
チャートである。
FIG. 6 is a flowchart of a process for performing a sentence search according to the embodiment of this invention.

【図7】本発明の実施例の類似度を求める処理のフロー
チャートである。
FIG. 7 is a flowchart of a process for obtaining a similarity according to the embodiment of the present invention.

【図8】文字列スコア又は同義語スコアを求める処理の
フローチャートである。
FIG. 8 is a flowchart of a process for obtaining a character string score or a synonym score.

【図9】文書の数を求める処理のフローチャートであ
る。
FIG. 9 is a flowchart of a process for obtaining the number of documents.

【図10】出現する回数を求める処理のフローチャート
である。
FIG. 10 is a flowchart of a process for obtaining the number of appearances.

【図11】スコア表を示す図である。 FIG. 11 is a diagram showing a score table.

【図12】文字列スコアを求める処理のフローチャートFIG. 12 is a flowchart of a process for obtaining a character string score.
である。It is.

【図13】文書の数を求める処理のフローチャートであFIG. 13 is a flowchart of a process for obtaining the number of documents.
る。You.

【図14】 本発明の別の実施例の類似度を求める処理の
フローチャートである。
FIG. 14 is a flowchart of a process for obtaining a similarity according to another embodiment of the present invention.

【図15】 本発明の別の実施例の文章検索を行う処理の
フローチャートである。
FIG. 15 is a flowchart of a process for performing a sentence search according to another embodiment of the present invention.

【図16】 同義語辞書を作成する処理のフローチャート
である。
FIG. 16 is a flowchart of a process for creating a synonym dictionary.

【図17】 本発明に別の実施例の類似度を求める処理の
前半フローチャートである。
FIG. 17 is a first half flowchart of a process for obtaining a similarity according to another embodiment of the present invention;

【図18】図17 に続く後半フローチャートである。 FIG. 18 is a second half flowchart following FIG. 17 ;

【図19】 従来技術による検索性能と本発明による検索
性能を示す図である。
FIG. 19 is a diagram showing search performance according to the related art and search performance according to the present invention.

【符号の説明】[Explanation of symbols]

10:文書データベース 10a、10b、10c:文書 11:文字列入力部 12:検索制御部 13:検索結果出力部 14、16、18、43、46、51、52、53、5
5、56、57、73、81:類似度算出部 15、17、19:再帰実行制御部 20:同義語辞書 21、24:一致文字列類似度算出部 22、25、29:任意文字列類似度算出部 23、26、30、33、54、58、63、84:最
大値選択部 28:同義語類似度算出部 31:文字列分離制御部 32:文字列分離類似度算出部 34:一致文字列判定部 42、45:文字列スコア算出部 41:文字列分離部 44、47、74:加算部 61:同義語分離制御部 62:同義語分離類似度算出部 71:同義語分離部 72:同義語スコア算出部 91:対訳辞書 101:ディスプレイ 102:プリンタ 103:キーボード 104:フロッピーディスク装置 105:CD−ROM装置 106:読み出し専用メモリ(ROM) 107:ランダムアクセスメモリ(RAM) 108:磁気ディスク装置 109:中央処理装置(CPU) 110:通信インターフェイス 111:バス 112:フロッピーディスク 113:CD−ROM 114:通信ネットワーク 201:SIM2による正当率 202:SIM3による正当率 203:SIM2による再現率 204:SIM3による再現率
10: Document database 10a, 10b, 10c: Document 11: Character string input unit 12: Search control unit 13: Search result output unit 14, 16, 18, 43, 46, 51, 52, 53, 5
5, 56, 57, 73, 81: Similarity calculating unit 15, 17, 19: Recursive execution control unit 20: Synonym dictionary 21, 24: Matching character string similarity calculating unit 22, 25, 29: Arbitrary character string similarity Degree calculation units 23, 26, 30, 33, 54, 58, 63, 84: maximum value selection unit 28: synonym similarity calculation unit 31: character string separation control unit 32: character string separation similarity calculation unit 34: match Character string determination units 42, 45: Character string score calculation unit 41: Character string separation units 44, 47, 74: Addition unit 61: Synonym separation control unit 62: Synonym separation similarity calculation unit 71: Synonym separation unit 72 : Synonym score calculation unit 91: Bilingual dictionary 101: Display 102: Printer 103: Keyboard 104: Floppy disk device 105: CD-ROM device 106: Read-only memory (ROM) 107: La Dam access memory (RAM) 108: magnetic disk device 109: a central processing unit (CPU) 110: Communication interface 111: bus 112: Floppy disk 113: CD-ROM 114: Communication Network 201: justification rate by SIM 2 202: SIM 3 203: Recall by SIM 2 204: Recall by SIM 3

Claims (24)

【特許請求の範囲】[Claims] 【請求項1】 二つの文字列の類似度を算出する方法に
おいて、 前記二つの文字列それぞれにおける順序に適合する部分
文字列であって、前記二つの文字列に共通する、部分文
字列を複数求め、 前記複数求めた部分文字列に対してそれぞれ重みを定
め、 前記重みを総和することで類似度を算出することを特徴
とする文字列類似度算出方法。
1. A method for calculating a degree of similarity between two character strings, comprising: a plurality of partial character strings conforming to an order in each of the two character strings, the partial character strings being common to the two character strings. A character string similarity calculation method comprising: determining a weight for each of the plurality of obtained partial character strings; and calculating a similarity by summing the weights.
【請求項2】 前記部分文字列に対する重みが、 前記部分文字列を二つ以上に分割して得られる部分文字
列に対する重みの総和よりも、より重い場合があること
を特徴とする請求項1に記載の文字列類似度算出方法。
2. The weight of the partial character string may be heavier than the sum of the weights of the partial character strings obtained by dividing the partial character string into two or more. The character string similarity calculation method described in 1.
【請求項3】 前記二つの文字列の一方が文書データベ
ースから選ばれたものであり、 前記重みが、前記文書データベースにおける部分文字列
の情報量に対応することを特徴とする請求項1又は2に
記載の文字列類似度算出方法。
3. The method according to claim 1, wherein one of the two character strings is selected from a document database, and the weight corresponds to an information amount of a partial character string in the document database. The character string similarity calculation method described in 1.
【請求項4】 前記重みが、前記文書データベースにお
ける部分文字列の情報量、および部分文字列の出現集中
度に対応することを特徴とする請求項3に記載に文字列
類似度算出方法。
4. The method according to claim 1, wherein the weight is stored in the document database.
Of substring information and the concentration of occurrence of substrings
4. The character string according to claim 3, wherein the character string corresponds to a degree.
Similarity calculation method.
【請求項5】 前記類似度が最も高くなるように、部分
文字列を分割することなく複数求めることを特徴とする
請求項1からのいずれかに記載の文字列類似度算出方
法。
5. As the degree of similarity is the highest, the string similarity calculation method according to any one of claims 1 to 4, characterized in that for obtaining a plurality without dividing the partial string.
【請求項6】 二つの文字列の類似度を算出する方法に
おいて、 前記二つの文字列それぞれにおける順序に適合する部分
文字列であって、同義語辞書の要素に含まれる、部分文
字列を複数求め、 前記複数求めた部分文字列に対応する同義語辞書の要素
に対してそれぞれ重みを定め、 前記重みを総和することで類似度を算出することを特徴
とする文字列類似度算出方法。
6. A method for calculating the similarity between two character strings, comprising: a plurality of partial character strings that match the order of each of the two character strings and are included in a synonym dictionary element. A character string similarity calculating method, wherein a similarity is calculated by determining weights for elements of the synonym dictionary corresponding to the plurality of obtained partial character strings, and summing the weights.
【請求項7】 前記二つの文字列の一方が文書データベ
ースから選ばれたものであり、 前記重みが、前記文書データベースにおける同義語辞書
の要素の情報量に対応することを特徴とする請求項
記載の文字列類似度算出方法。
7. A are those where one of the two strings is selected from the document database, claim the weight, characterized in that corresponding to the amount of information elements synonym dictionary in the document database 6 The character string similarity calculation method described in 1.
【請求項8】 前記二つの文字列が異なる言語で表され
ており、 前記同義語辞書の要素は、前記異なる言語の同義語を含
むことを特徴とする請求項6又は7に記載の文字列類似
度算出方法。
Wherein said two strings are represented in different languages, the elements of the synonym dictionary, a character string according to claim 6 or 7, characterized in that it comprises a synonym of said different languages Similarity calculation method.
【請求項9】 前記類似度が最も高くなるように、部分
文字列の分割を許容して複数求めることを特徴とする請
求項1から4、6から8のいずれかに記載の文字列類似
度算出方法。
9. As the degree of similarity is the highest, the string similarity according to any one of claims 1 to 4, 6 8, characterized in that for obtaining a plurality to permit divided substrings Calculation method.
【請求項10】 二つの文字列の類似度を算出する文字
列類似度算出装置において、 二つの文字列に共通する部分文字列の重みを定める文字
列スコア算出部と、 前記重みに、残りの部分文字列の類似度を加算して類似
度を求める一致文字列類似度算出部と、 二つの文字列のいずれか又は両方において1文字ずつ減
らした文字列同士の類似度のうち最も高い類似度を求め
る任意文字列類似度算出部と、 求まった前記類似度のうち最も高い類似度を選ぶ選択部
と、 を有することを特徴とする文字列類似度算出装置。
10. A character string similarity calculating apparatus for calculating a similarity between two character strings, comprising: a character string score calculating unit for determining a weight of a partial character string common to the two character strings; A matching character string similarity calculating unit that calculates the similarity by adding the similarities of the partial character strings; and the highest similarity among the similarities of the character strings reduced by one character at a time in one or both of the two character strings. A character string similarity calculating apparatus, comprising: an arbitrary character string similarity calculating unit that calculates the similarity; and a selecting unit that selects the highest similarity among the obtained similarities.
【請求項11】 前記二つの文字列の一方が文書データ
ベースから選ばれたものであり、 前記重みが、前記文書データベースにおける部分文字列
の情報量に対応することを特徴とする請求項10に記載
の文字列類似度算出装置。
11. are those where one of the two strings is selected from the document database, according to claim 10, wherein the weights, characterized in that corresponding to the information amount of the partial strings in the document database Character string similarity calculation device.
【請求項12】 前記重みが、前記文書データベースに
おける部分文字列の情報量、および部分文字列の出現集
中度に対応することを特徴とする請求項11に記載に文
字列類似度算出装置。
12. The method according to claim 11, wherein the weight is stored in the document database.
Of information on substrings in substrings and appearances of substrings
The statement according to claim 11, characterized in that it corresponds to medium.
Character string similarity calculation device.
【請求項13】 二つの文字列の類似度を算出する文字
列類似度算出装置において、 二つの文字列の部分文字列であって、同義語辞書の要素
に含まれる、部分文字列に対応する同義語辞書の要素の
重みを定める同義語スコア算出部と、 前記重みに、残りの部分文字列の類似度を加算して類似
度を求める一致文字列類似度算出部と、 二つの文字列のいずれか又は両方において1文字ずつ減
らした文字列同士の類似度のうち最も高い類似度を求め
る任意文字列類似度算出部と、 求まった前記類似度のうち最も高い類似度を選ぶ選択部
と、 を有することを特徴とする文字列類似度算出装置。
13. A character string similarity calculating apparatus for calculating a similarity between two character strings, wherein the character string similarity calculating apparatus calculates a partial character string corresponding to a partial character string included in a synonym dictionary element. A synonym score calculating unit that determines the weight of the elements of the synonym dictionary; a matching character string similarity calculating unit that calculates the similarity by adding the similarity of the remaining partial character strings to the weight; An arbitrary character string similarity calculating unit that obtains the highest similarity among the similarities of the character strings reduced by one character in one or both of them; a selecting unit that selects the highest similarity among the obtained similarities; A character string similarity calculation device characterized by having:
【請求項14】 前記二つの文字列の一方が文書データ
ベースから選ばれたものであり、 前記重みが、前記文書データベースにおける同義語辞書
の要素の情報量に対応することを特徴とする請求項13
に記載の文字列類似度算出装置。
14. are those where one of the two strings is selected from the document database, claim the weight, characterized in that corresponding to the amount of information elements synonym dictionary in the document database 13
The character string similarity calculating device according to item 1.
【請求項15】 検索文章に類似した文書を文書データ
ベースの中から選ぶ文章検索装置であって、 前記検索文章と、前記文書データベースの中の文書を、
二つの文字列として請求項10から14のいずれかに記
載の文字列類似度算出装置により類似度を求め、 前記求めた類似度が高い文書を、文書データベースの中
から選ぶことを特徴とする文書検索装置。
15. A sentence search apparatus for selecting a document similar to a search sentence from a document database, wherein the search sentence and a document in the document database are selected.
A character string similarity calculating apparatus according to claim 10 , wherein similarities are obtained as two character strings, and a document having a high calculated similarity is selected from a document database. Search device.
【請求項16】 二つの文字列の類似度を算出する文字
列類似度算出プログラムであって、 前記二つの文字列を対比させる部分を逐次設定する対比
設定過程と、 前記対比させる部分から始まる部分文字列であって、二
つの文字列に共通する部分文字列を特定する共通部分文
字列特定過程と、 前記特定された部分文字列の重みを定める文字列スコア
設定過程と、 前記重みを類似度に加算する文字列スコア加算過程と、 類似度が高くなるようにこれらの過程を進める進行処理
過程と、 をコンピュータに実行させるための文字列類似度算出プ
ログラムを記録したコンピュータ読み取り可能な記録媒
体。
16. A character string similarity calculation program for calculating a similarity between two character strings, comprising: a comparison setting step of sequentially setting a part to be compared with the two character strings; and a part starting from the part to be compared. A character string, a common partial character string specifying step of specifying a partial character string common to the two character strings; a character string score setting step of determining a weight of the specified partial character string; A computer-readable recording medium that records a character string similarity calculation program for causing a computer to execute a character string score adding step of adding a character string score to a computer, and a progress processing step of performing these steps to increase similarity.
【請求項17】 前記二つの文字列の一方が文書データ
ベースから選ばれたものであり、 前記重みが、前記文書データベースにおける部分文字列
の情報量に対応することを特徴とする請求項16に記載
の文字列類似度算出プログラムを記録したコンピュータ
読み取り可能な記録媒体。
17. are those where one of the two strings is selected from the document database, according to claim 16, wherein the weights, characterized in that corresponding to the information amount of the partial strings in the document database A computer-readable recording medium on which a character string similarity calculation program is recorded.
【請求項18】 前記重みが、前記文書データベースに
おける部分文字列の情報量、および部分文字列の出現集
中度に対応することを特徴とする請求項17に記載の文
字列類似度算出プログラムを記録したコンピュータ読み
取り可能な記録媒体。
18. The method according to claim 18, wherein the weight is stored in the document database.
Of information on substrings in substrings and appearances of substrings
The sentence according to claim 17, characterized in that it corresponds to medium.
Computer reading recorded character string similarity calculation program
A removable recording medium.
【請求項19】 請求項17又は18に記載の文字列類
似度算出プログラムにおいて、前記文字列スコア設定過程が 、サフィックスファイルを
利用して前記情報量を求めることを特徴とする文字列類
似度算出プログラムを記録したコンピュータ読み取り可
能な記録媒体。
19. The character string similarity calculation program according to claim 17 , wherein the character string score setting step obtains the information amount by using a suffix file. A computer-readable recording medium on which a program is recorded.
【請求項20】 二つの文字列の類似度を算出する文字
列類似度算出プログラムであって、 前記二つの文字列を対比させる部分を逐次設定する対比
設定過程と、 前記対比させる部分から始まる部分文字列であって、同
義語辞書の要素に含まれる部分文字列を特定する同義語
特定過程と、 前記特定された部分文字列に対応する同義語辞書の要素
の重みを定める同義語スコア設定過程と、 前記重みを類似度に加算する同義語スコア加算過程と、 類似度が高くなるようにこれらの過程を進める進行処理
過程と、をコンピュータに実行させるための文字列類似
度算出プログラムを記録したコンピュータ読み取り可能
な記録媒体。
20. A character string similarity calculation program for calculating a similarity between two character strings, comprising: a comparison setting step of sequentially setting a part to be compared with the two character strings; and a part starting from the part to be compared. A synonym identification step of identifying a character string and a substring included in a synonym dictionary element; and a synonym score setting step of determining a weight of an element of the synonym dictionary corresponding to the identified substring. A character string similarity calculation program for causing a computer to execute a synonym score adding step of adding the weight to the similarity, and a progress processing step of advancing these steps to increase the similarity. Computer readable recording medium.
【請求項21】 前記二つの文字列の一方が文書データ
ベースから選ばれたものであり、 前記重みが、前記文書データベースにおける同義語辞書
の要素の情報量に対応することを特徴とする請求項20
に記載の文字列類似度算出プログラムを記録したコンピ
ュータ読み取り可能な記録媒体。
21. are those where one of the two strings is selected from the document database, claim the weight, characterized in that corresponding to the amount of information elements synonym dictionary in the document database 20
A computer-readable recording medium recording the character string similarity calculation program described in 1. above.
【請求項22】 請求項21に記載の文字列類似度算出
プログラムにおいて、前記同義語スコア設定過程が、 サフィックスファイルを
利用して前記情報量を求めることを特徴とする文字列類
似度算出プログラムを記録したコンピュータ読み取り可
能な記録媒体。
22. The character string similarity calculation program according to claim 21 , wherein the synonym score setting step obtains the information amount using a suffix file. A computer-readable recording medium that has been recorded.
【請求項23】 請求項16から22のいずれかに記載
の文字列類似度算出プログラムにおいて、 前記進行処理過程がダイナミックプログラミング手法に
よることを特徴とする文字列類似度算出プログラムを記
録したコンピュータ読み取り可能な記録媒体。
23. A computer-readable program storing a character string similarity calculation program according to claim 16 , wherein the progress processing step is performed by a dynamic programming method. Recording medium.
【請求項24】 検索文章に類似した文書を文書データ
ベースの中から選ぶ文章検索プログラムであって、 前記検索文章と、前記文章データベースの中の文書を、
二つの文字列として請求項16から23のいずれかに記
載の文字列類似度算出プログラムにより類似度を求め、 前記求めた類似度が高い文書を、文書データベースの中
から選ぶことをコンピュータに実行させるための文書検
索プログラムを記録したコンピュータ読み取り可能な記
録媒体。
24. A sentence search program for selecting a document similar to a search sentence from a document database, wherein the search sentence and a document in the sentence database are
A similarity is calculated by the character string similarity calculation program according to any one of claims 16 to 23 as two character strings, and the computer is caused to select a document having a high calculated similarity from a document database. Computer-readable recording medium on which a document search program for recording is stored.
JP2000188490A 1999-06-23 2000-06-22 Calculation method and device for similarity of character string and recording medium Pending JP2001067378A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000188490A JP2001067378A (en) 1999-06-23 2000-06-22 Calculation method and device for similarity of character string and recording medium

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11-176477 1999-06-23
JP17647799 1999-06-23
JP2000188490A JP2001067378A (en) 1999-06-23 2000-06-22 Calculation method and device for similarity of character string and recording medium

Publications (1)

Publication Number Publication Date
JP2001067378A true JP2001067378A (en) 2001-03-16

Family

ID=26497388

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000188490A Pending JP2001067378A (en) 1999-06-23 2000-06-22 Calculation method and device for similarity of character string and recording medium

Country Status (1)

Country Link
JP (1) JP2001067378A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012168678A (en) * 2011-02-14 2012-09-06 Nec Corp Inter-document similarity calculation device, inter-document similarity calculation method and inter-document similarity calculation program
WO2015025751A1 (en) * 2013-08-23 2015-02-26 日本電気株式会社 Frequent sequence enumeration device, method, and recording medium
US9442901B2 (en) 2011-04-28 2016-09-13 Fujitsu Limited Resembling character data search supporting method, resembling candidate extracting method, and resembling candidate extracting apparatus
JP2016528787A (en) * 2013-07-08 2016-09-15 スパイレント コミュニケーションズ, インコーポレーテッドSpirent Communications, Inc. Automatic carrier detection for mobile network devices
KR20220067130A (en) * 2020-11-17 2022-05-24 주식회사 한글과컴퓨터 Electronic apparatus that performs a search for similar sentences based on the bleu score and operating method thereof

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012168678A (en) * 2011-02-14 2012-09-06 Nec Corp Inter-document similarity calculation device, inter-document similarity calculation method and inter-document similarity calculation program
US9442901B2 (en) 2011-04-28 2016-09-13 Fujitsu Limited Resembling character data search supporting method, resembling candidate extracting method, and resembling candidate extracting apparatus
JP2016528787A (en) * 2013-07-08 2016-09-15 スパイレント コミュニケーションズ, インコーポレーテッドSpirent Communications, Inc. Automatic carrier detection for mobile network devices
US10015727B2 (en) 2013-07-08 2018-07-03 Mobilethink A/S Automatic detection of a network operator for a mobile network device
WO2015025751A1 (en) * 2013-08-23 2015-02-26 日本電気株式会社 Frequent sequence enumeration device, method, and recording medium
KR20220067130A (en) * 2020-11-17 2022-05-24 주식회사 한글과컴퓨터 Electronic apparatus that performs a search for similar sentences based on the bleu score and operating method thereof
KR102523767B1 (en) 2020-11-17 2023-04-21 주식회사 한글과컴퓨터 Electronic apparatus that performs a search for similar sentences based on the bleu score and operating method thereof

Similar Documents

Publication Publication Date Title
US5745745A (en) Text search method and apparatus for structured documents
EP1011056B1 (en) Grouping words with equivalent substrings by automatic clustering based on suffix relationships
US5794177A (en) Method and apparatus for morphological analysis and generation of natural language text
JP2742115B2 (en) Similar document search device
JPH06266780A (en) Character string retrieving method by semantic pattern recognition and device therefor
JPH06131398A (en) Method for retrieving plurality of documents
JPH1145241A (en) Japanese syllabary-chinese character conversion system and computer-readable recording medium where programs making computer function as means of same system is recorded
US7222129B2 (en) Database retrieval apparatus, retrieval method, storage medium, and program
JP2000200281A (en) Device and method for information retrieval and recording medium where information retrieval program is recorded
JP4640593B2 (en) Multilingual document search device, multilingual document search method, and multilingual document search program
US8682900B2 (en) System, method and computer program product for documents retrieval
CN113157869A (en) Method and system for accurately positioning and retrieving documents
JP2001067378A (en) Calculation method and device for similarity of character string and recording medium
JP4065695B2 (en) Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method
JP2850952B2 (en) Document search method and apparatus
WO2009113289A1 (en) New case generation device, new case generation method, and new case generation program
JP2894301B2 (en) Document search method and apparatus using context information
JP2002251412A (en) Document retrieving device, method, and storage medium
CN110309258A (en) A kind of input checking method, server and computer readable storage medium
JP2002132789A (en) Document retrieving method
US20020065794A1 (en) Phonetic method of retrieving and presenting electronic information from large information sources, an apparatus for performing the method, a computer-readable medium, and a computer program element
JP4217410B2 (en) Information retrieval apparatus, control method therefor, and program
US20240086442A1 (en) Heuristic identification of shared substrings between text documents
EP1258815B1 (en) A process for extracting keywords
JP3135221B2 (en) Example-driven language structure analyzer

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040608