JP4065695B2 - Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method - Google Patents

Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method Download PDF

Info

Publication number
JP4065695B2
JP4065695B2 JP2002012259A JP2002012259A JP4065695B2 JP 4065695 B2 JP4065695 B2 JP 4065695B2 JP 2002012259 A JP2002012259 A JP 2002012259A JP 2002012259 A JP2002012259 A JP 2002012259A JP 4065695 B2 JP4065695 B2 JP 4065695B2
Authority
JP
Japan
Prior art keywords
character string
document
partial character
partial
similarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2002012259A
Other languages
Japanese (ja)
Other versions
JP2002297660A (en
Inventor
恭司 梅村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2002012259A priority Critical patent/JP4065695B2/en
Publication of JP2002297660A publication Critical patent/JP2002297660A/en
Priority to CN 02159822 priority patent/CN1230770C/en
Application granted granted Critical
Publication of JP4065695B2 publication Critical patent/JP4065695B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、二つの文字列の類似度判定に関するものであり、特に情報検索において、入力された文字列とデータベースに登録された文書との類似度判定に用いると好適である。
【0002】
【従来の技術】
文書のデータベースから、所望の文書を取り出す情報検索がよく行なわれている。このような情報検索において、文書は、複数の文字からなる単語を組み合わせた文字列の集合として扱う。そして、検索文字列と検索対象文書中の文字列同士を比較し、類似度の高いものを一つあるいは複数選び出すことで情報検索を行っている。この文字列同士の類似度は、大きく分けて、形態素解析を用いる方法と、長さnの部分文字列(以下、nグラムと称する)の一致を求める方法の2通りがある。
【0003】
形態素解析を用いる方法は、例えば、Gerard Salton and Christopher Buckley, Term-Weighting Approaches in Automatic Text Retrieval, Information Proceeding and Management, 24, pp.513-523, 1988.に開示されている。この方法で二つの文字列同士の類似度を求める基本的手順は以下のようになる。まず、両方の文字列を、辞書と文法知識を用いた形態素解析により単語の列に分解する。次に、両方の単語列を比較して、一致する単語を求める。そして、一致する単語に対して重みを設定する。その上で、この重みを、すべての一致する単語に関して加算する。この加算の結果得られた総和が、形態素解析による類似度となる。
【0004】
形態素解析を用いる方法は、形態素解析自体の精度が低いと情報検索が不調に終わるという本質的な問題を有している。形態素解析の精度を上げるには、単語辞書や文法規則などが大規模にならざるを得ず、簡単に情報検索を利用することが難しくなる。さらに、流行語、造語、限られた分野でのみ用いられる専門用語が出現する文書では、単語辞書の整備の手間が大きな負担となる。
【0005】
次に、nグラムによる方法は、例えば、Yasushi Ogawa and Toru Matsuda, Overlapping statistical word indexing: A new indexing method for Japanese text, In proceeding of SIGIR'97, Philadelphia PA, USA, pp.226-234, 1997.に開示されている。この方法で文字列同士の類似度を求める基本的手順は以下のようになる。まず、両方の文字列に共通して含まれるn文字の部分文字列を求める。次に、この共通する部分文字列に対して、重みを設定する。そして、この重みを、すべての一致する部分に関して加算する。この加算の結果得られた総和が、nグラムによる類似度となる。
【0006】
共通する部分文字列の重みの設定に関しては、特定の文書に集中的に出現して、他の文書には出現しない文字列には大きな値が与えられる。逆に多くの文書に出現する文字列には小さな値しか与えられない。これは多くの文書に出現する文字列は文書を特徴づける要素になっておらず、検索に際し、有効に利用できないことを反映したものである。
【0007】
nグラムによる方法は、形態素解析を要しないため、新しい技術用語などの未知語にも対応することができ、簡単に利用できる。
【0008】
nグラムによる方法の中でも、特に、長さ2の文字列(以下、bigramと称する)による類似度の算出においては、切り出されるすべてのbigramを対象にするのではなく、ひらがなを含まないbigramに限定して、文字列同士に関する一致情報を求め、類似度を算出する方法がある。これは、ひらがなを含むbigramは、文書データベース内の多くの文書で出現する可能性が高く、各文書を特徴づける文字列となる確率が極めて小さいことを考慮したものである。ひらがなを含むbigramを文字列の比較の対象に含めると計算量が大きくなるばかりで、検索の精度は大きな向上が期待できないと認識されている。
【0009】
【発明が解決しようとする課題】
上記のように、nグラムによる方法は形態素解析による方法と比較して有利な面が多く、情報検索の分野で利用される場面が多い。nグラム法における問題は、文書データベースが大きくなるに従って計算量が増し、検索結果を得るまでの時間がかかることである。
【0010】
ところで、文字列から切り出される部分文字列の中には、必ずしも類似度の算出において有効でない部分文字列、すなわち文書データベース内の多くの文書に含まれるため重みが小さく、類似度に与える影響の小さい部分文字列が多く含まれていると考えられている。そのため、文字列から切り出されるすべてのnグラムについて一致するかどうかを調べる方法は、計算時間の点からみて効率がよくない。
【0011】
また、切り出されたbigramに対し、ひらがなを含む文字列を一致情報として扱わないという方法は、計算時間の点については効率化されているが、本来は検索に有効な文字列までも一律に切り捨てられてしまう。その結果、検索精度が低下してしまうという問題があった。
【0012】
本発明は上記したnグラム法における問題を解決し、計算時間短縮と検索精度向上を両立する方法を提供するものである。
【0013】
【課題を解決するための手段】
請求項1に記載の発明は、二つの文字列の類似度を算出する方法において、第1の文字列から切り出した部分文字列のうち、類似度算出に対する効果に基づいて選別した部分文字列について、第2の文字列との一致情報を収集し、前記一致情報から一致した部分文字列の重みを算出し、前記重みに基づいて類似度を算出することを特徴とする。このように文字列同士の一致情報を求める際に、切り出されるすべてのnグラムを扱うのではなく、類似度の算出に対する効果を推定することで、類似度の算出に有効なnグラムを選別している。
【0014】
かかるように構成されているので、選別しない方法による検索精度とほぼ同等の検索精度を保ちつつ、計算時間の短縮を図ることが可能となる。
【0015】
請求項2に記載の発明は、二つの文字列の類似度を算出する方法において、第1の文字列から切り出した部分文字列のうち、類似度算出に対する効果に基づいて選別した部分文字列について、第2の文字列との一致情報を収集し、前記一致情報に含まれる部分文字列の中から、第1および第2の文字列に出現する順序が適合する部分文字列の重みに基づいて類似度を算出することを特徴とする。このように、文字列同士の類似度の算出において、一致情報に記録された部分文字列の中から、さらにそれぞれの文字列に出現する順序が適合する部分文字列を選び、その重みを類似度の算出に用いている。
【0016】
かかるように構成されているので、重みを算出する部分文字列が限定され、検索精度を保ったまま、一層の計算の高速化が達成できる。
【0017】
請求項3に記載の発明は、請求項1または2に記載の発明において、部分文字列の選別を、第1の文字列から切り出した部分文字列が第2の文字列に出現する回数を加味して行うことを特徴とする。
【0018】
かかるように構成されているので、類似度の算出に効果のある部分文字列が効率的に選別でき、検索精度を保ちつつ、一層の計算時間の短縮を図ることが可能となる。
【0019】
請求項4に記載の発明は、請求項1から3のいずれかに記載の発明において、文字列同士の一致情報として、部分文字列の長さ、第1の文字列における部分文字列の出現場所、第2の文字列における部分文字列の出現場所、第2の文字列内で何番目の一致かを表すシーケンス番号、を含むことを特徴とする。
【0020】
かかるように構成されているので、一致したnグラムの重みを加算して類似度を算出する方法だけでなく、多くの類似度算出方法を併用することが可能となる。
【0021】
請求項5に記載の発明は、二つの文字列の類似度を算出する文字列類似度算出装置において、第1の文字列から切り出した部分文字列のうち、類似度算出に対する効果に基づいて選別する部分文字列選別部と、第2の文字列との一致情報を収集する一致情報収集部と、前記一致情報に基づき一致した部分文字列の重みを算出し、前記重みを総和することで類似度を算出する類似度算出部と、を有することを特徴とする文字列類似度算出装置である。
【0022】
かかるように構成されているので、選別しない方法による検索精度とほぼ同等の検索精度を保ちつつ、計算時間の短縮を図る装置を実現できる。
【0023】
請求項6に記載の発明は、二つの文字列の類似度を算出する文字列類似度算出装置において、第1の文字列から切り出した部分文字列について、類似度算出に対する効果に基づいて選別する部分文字列選別部と、前記選別部分文字列について、第2の文字列との一致情報を収集する一致情報収集部と、前記一致情報に含まれる部分文字列の中から、それぞれの文字列に出現する順序が適合する部分文字列を選択する適合部分文字列選択手段と、前記適合部分文字列に付けられた重みを総和する類似度算出部と、を有することを特徴とする文字列類似度算出装置である。
【0024】
かかるように構成されているので、重みを算出する部分文字列が限定され、検索精度を保ったまま、一層の計算の高速化が達成できる装置を実現できる。
【0025】
請求項7に記載の発明は、二つの文字列の類似度を算出する文字列類似度算出プログラムであって、コンピュータを、第1の文字列から切り出した部分文字列が第2の文字列に出現する回数に基づいて選別する選別手段と、前記選別部分文字列について、第2の文字列との一致情報を収集する一致情報収集手段と、前記一致情報に基づき一致した部分文字列の重みを算出し、前記重みを総和することで類似度を算出する類似度算出手段、として機能させることを特徴とする文字列類似度算出プログラムである。
【0026】
かかるように構成されているので、コンピュータを、選別しない方法による検索精度とほぼ同等の検索精度を保ちつつ、計算時間の短縮を図る手段として機能させることができる。
【0027】
請求項8に記載の発明は、二つの文字列の類似度を算出する文字列類似度算出プログラムであって、コンピュータを、第1の文字列から切り出した部分文字列について、類似度算出に対する効果に基づいて選別する選別手段と、前記選別部分文字列について、第2の文字列との一致情報として、部分文字列の長さ、第1の文字列における部分文字列の出現場所、第2の文字列における部分文字列の出現場所、第2の文字列内で何番目の一致かを表すシーケンス番号、を収集する一致情報収集手段と、前記一致情報に含まれる部分文字列の中から、それぞれの文字列に出現する順序が適合する部分文字列に付けられた重みに基づいて類似度を算出する類似度算出手段、として機能させることを特徴とする文字列類似度算出プログラムである。
【0028】
かかるように構成されているので、コンピュータを、重みを算出する部分文字列を限定し検索精度を保ったまま、一層の計算の高速化を図る手段として機能させることができる。
【0029】
請求項9に記載の発明は、請求項7または8に記載のプログラムを記録したコンピュータ読取可能な記録媒体である。
【0030】
かかるように構成されているので、記録された機能を必要な場所で実現することができる。
【0031】
【発明の実施の形態】
本発明は、nグラムによる文字列同士の類似度の算出方法およびそれを実現する装置、プログラム、記録媒体に関する。入力された文字列とデータベースに登録された複数の文書との類似度を算出することを想定しているが、それ以外の応用も可能である。文字列同士の一致部分を求める際に、データベース中のすべての文書それぞれに対して、入力文字列と文書に共通するnグラムを求めるという方法ではなく、入力文字列からnグラムを切り出し、それぞれのnグラムを含む文書をサフィックスファイルの利用によって効率的にデータベース内から検索するという方法を用いる。
【0032】
入力文字列から切り出されるnグラムの中には、類似度の算出に与える影響の少ないnグラムが多く含まれていると考えられる。入力文字列から切り出される部分文字列の数は、例えば、入力文字列の長さをmとし、部分文字列を2文字であるbigramに限定するとm−1となる。従って、部分文字列の選別を行わずに、切り出されたbigramすべてに対し一致情報を求めると、入力文字列長mが大きくなるほど、計算時間も大きくなる。そこで、本発明では、切り出されたnグラムの中から、類似度の算出に対する効果を推定することでnグラムを選別し、定数個のnグラムのみを一致情報の収集に適用する。
【0033】
部分文字列の選別については、類似度に加算される重みの大きな部分文字列を選別するのが検索精度向上のために必要である。重みは、その部分文字列を含むデータベース中の文書の数(以下、dfと記す)によって決まるので、dfの値を元に選別するのが自然である。しかし、本発明の一つの局面では、dfの代わりに、nグラムがデータベース内の文書に出現する数(以下、出現度数、もしくは、tfと記す)に基づき部分文字列の選別を行うことが推奨される。
【0034】
tfは直接的に算出でき、その値が増えても計算時間はほとんど変わらないのに対し、dfを算出するには、tfを算出した後に文書内の重複を再計算しなければならず、tfの値が大きな場合は計算時間が大きくなる。一方、tfとdfには大きな相関があり、dfの代わりにtfを用いても、検索の精度に影響しないことが期待できる。
【0035】
一致情報の収集は選別された各nグラムに対し、次のような方法で行う。
まず、nグラムの重みを計算する。次に、文書データベース全体からそのnグラムを含む文書を求め、その文書内におけるnグラムの出現場所、入力文字列におけるnグラムの出現場所、nグラムの長さ、文書内において何番目の一致かを表すシーケンス番号、nグラムの重みを一致情報として記録する。
【0036】
通常、得られた一致情報は、記録・管理することなく、そのまま重みの加算がされ類似度が算出されるが、本発明では、これを記録・管理することにより、一致したnグラムの重みを加算して類似度を算出する方法だけでなく、高速性を保ったまま、多くの類似度算出方法に適用することも可能にしている。
【0037】
入力文字列とデータベース内の文書との類似度は、一致したnグラムに付けられた重みを加算することによって算出される。ただし、一致するnグラムが同じ文書内に2回以上出現する場合でも、その重みは1度しか加算されない。つまり、一致するnグラムが2回現れるからといって、加算される重みが2倍になるわけではない。そうではなく、nグラムが文書内に出現する回数(以下、dtf)に応じて、一致情報として記憶されているnグラムの重みは各文書によって異なり、dtfの値が大きいほど、与えられる重みは大きくなっている。また、この重みは、各nグラムに対して、dtf=0の場合にも定義されており、そのnグラムを含まない文書すべてに対して、0以下の重みが加算される。これは、nグラムを含まないということは類似していないということを示すものである、という考え方に基づくもので、加算される重みは、類似していない度合いを数値化したものと言える。従って、類似度を示す値は負の値を含む実数値を取り、その数直線上での値が大きいほど入力文字列との類似度は高くなる。
【0038】
類似度を算出する方法は、一致したnグラムに付けられた重みを加算するという前記の方法に限定されるものではなく、これ以外の類似度算出方法を適用することも可能である。その一例が、一致したnグラムの中からそれぞれの文字列に出現する順序が適合するnグラムだけを選び、それらのnグラムに付けられた重みを総和した値を類似度とする方法である。
【0039】
文字列の出現順序を考慮して類似度を算出する方法は、これまでも提案されている。しかしそれらは一致する全ての長さの部分文字列について重みを計算するため、一致したnグラムの重みを加算する方法に比べて計算量が増え、扱う文字列の長さが大きくなるほど計算時間が大きくなる。
【0040】
本発明では、選別されたnグラムに重みを与え、それらのnグラムが一致した時にのみ類似度に重みが加算される。従って、選別された部分文字列に対してのみ、一致および出現順序を考慮すればよいので、これまでの方法に比べて高速に計算でき、扱う文字列の長さが大きくなっても計算時間に与える影響は小さい。この方法では、適合するnグラムの組み合わせの中で最も類似度が高くなる組み合わせを効率的に見つけるため、動的計画法(Dynamic Programming、以下DPと称する)を用いて類似度を計算する。以下では、DPを使って、nグラムDP類似度を求める方法を説明する。
【0041】
α、β、γ、δを長さ0以上の文字列、ξ、ζ、ηを長さ1以上の文字列、""を空文字列とする。複数の文字列(例えば、ξとγ)を繋げた文字列(例えば、α)は、要素となる文字列の記号を続けて書くことで表す。(例えば、α=ξγ)。
【0042】
nグラムDP類似度SimDPは、引数の文字列の部分に関する一致パターンに応じて、以下の式を再帰的に当てはめることで求める。まず、両方とも空文字列の時は、
SimDP("", "") = 0 (1)
とする。それ以外のときは、
SimDP(α, β) = MAX( SimDPs(α, β), SimDPg(α, β) ) (2)
とする。
ここで、SimDPs(α, β)は、ξを、一致情報管理テーブルのαとβに関するリストに記録されている文字列とし、α=ξγ、β=ξδとすると、
SimDPs(α, β) = MAX( Score(ξ) + SimDP(γ, δ) ) (3)
を、全てのξに関して計算することによって求められる。そのような文字列ξが存在しないときは、
SimDPs(α, β) = 0.0 (4)
とする。Score(ξ)は、一致情報管理テーブルに記録されたξの重みを返す関数である。
【0043】
また、ζとηをα=ζγ、β=ηδを満たし、かつ、一致情報管理テーブルのαとβに関するリストに記録された文字列と共通部分を持たない最大の文字列とすると、SimDPg(α, β)は、
SimDPg(α,β)=MAX(SimDP(α,δ), SimDP(γ,β), SimDP(γ,δ) ) (5)
によって求められる。この式は、二つの文字列(ζγとηδ)から、ζかηの一方、もしくはζとηの両方を取り除いた残りに相当する文字列同士(αとδ、γとβ、γとδ)の類似度のうち、最も高い類似度を採用することを意味する。
【0044】
以上の式を再帰的に適用することで、一致情報管理テーブルに記録された部分文字列の中から、二つの文字列それぞれの順序に適合する部分文字列が求められ、かつ、類似度が最大となる。
【0045】
上記で示したnグラムDP類似度は、式(3)のように、文字(長さ1の文字列)ではなく、nグラム(長さnの文字列)に対する一致を考慮し、重みを与えることによって、文字の連続性を加味した類似度算出法になっている。また、全ての部分文字列について文字列同士の一致を考慮するのではなく、一致情報管理テーブルに記録されたnグラムに限定することで、式(5)のように、一致情報管理テーブルに記録された部分文字列に関係のない部分については、一致の有無を判定する必要がなく、取り除くことができる。これによって、類似度の算出対象とする文字列の長さがどんなに大きくても、一致情報管理テーブルに記録された部分文字列に関係する部分だけを考慮すればよいので、全ての部分文字列について文字列同士の一致を考慮する従来の方法に比べ、高速に類似度を算出することができる。
【0046】
(第1実施例)
まず、nグラムを用いて文字列同士の類似度を算出する方法の実施例を示す。図1は選別された部分文字列に基づき、入力された文字列と最も類似度の高い文書を検索する文書検索装置の例である。この文書検索装置は、文書データベース10、文字列入力部11、部分文字列選別部13、一致情報収集部14、類似度算出部15、類似度算出制御部16、及び、検索結果出力部12から構成されている。
【0047】
文書データベース10には、検索対象となる複数の文書10a、10b、…、10cが登録されている。検索のためには、キーワード、語、語句、文、文章などを入力する(以下、代表して検索文章と呼ぶ)。文字列入力部11は、検索文章を文字列Xとして部分文字列選別部13に与える。
【0048】
部分文字列選別部13は、文字列入力部11から与えられた文字列Xから部分文字列を切り出し、出現頻度tfを算出した後、算出したtfの小さいものから定数個を取り出し、部分文字列管理テーブルT1に登録する。部分文字列選別部13は、部分文字列切り出し制御部31、部分文字列切り出し部32、文字列出現頻度算出部33、部分文字列登録部34から成る。部分文字列切り出し制御部31は、部分文字列切り出し部32がどの部分文字列を切り出すかを制御する。部分文字列切り出し部32は文字列Xより部分文字列xを切り出す。文字列出現頻度算出部33は部分文字列xの文書データベース10内における出現頻度tfを算出する。部分文字列登録部34は切り出された部分文字列をtfの値の小さい順に定数個選び、部分文字列管理テーブルT1に登録する。
【0049】
一致情報収集部14は部分文字列管理テーブルT1に登録された各部分文字列に対し、文字列に与える重みを算出し、文書データベース内における各部分文字列の出現場所を検出し、一致情報として、文書内における出現場所、入力文字列における出現場所、部分文字列の文字列の長さ、文書内において何番目の一致かを表すシーケンス番号、文字列の重みを一致情報管理テーブルT2に記録する。一致情報収集部14は、一致情報収集制御部41、文字列出現場所検索部42、文字列重み算出部43、一致情報登録制御部44、一致情報登録部45から成る。一致情報収集制御部41は部分文字列管理テーブルT1に登録された部分文字列aを1つずつ取り出し、文字列出現場所検索部42と文字列重み算出部43に与える。文字列出現場所検索部42は与えられた部分文字列aの文書データベース内における出現場所の全てについて、出現場所、部分文字列aの長さ、文書内において何番目の一致かを表すシーケンス番号を求める。文字列重み算出部43は与えられた文字列aに与える重みを計算する。一致情報登録制御部44は部分文字列aの出現場所を1つずつ選び、文書内における出現場所、入力文字列における出現場所、部分文字列aの長さ、文書内におけるシーケンス番号、部分文字列aの重みと組にして、一致情報登録部45に与える。一致情報登録部45は受け取った各組を、一致情報管理テーブルT2の該当する文書番号のリストに一致情報として登録する。
【0050】
類似度算出制御部16は一致情報管理テーブルT2から、ある1つの文書Yに関するリストを取り出し、類似度算出部15に与える。
【0051】
類似度算出部15は、与えられた一致情報のリストより、XとYの類似度を算出する。類似度算出部15は、文字列重み加算制御部51、文字列重み加算部52から成る。文字列重み加算制御部51は一致情報のリストより1つの一致情報を選び、その一致情報の持つシーケンス番号が1であれば、その文字列の重みscoreを文字列重み加算部52に与える。文字列重み加算部52は与えられた重みをXとYの類似度Sim(X,Y)に加算する。
【0052】
検索結果出力部12は類似度が最も高い文書を選択し出力する。この時、類似度が一定値以上の文書や、上位から一定の順位までの文書を合わせて出力しても良い。
【0053】
(第2実施例)
本発明による文章検索をソフトウエアにより実施する実施例を以下に説明する。
【0054】
図2に、文章検索の実行に用いる計算機システムの一例を示す。この計算機システムは、ディスプレイ101、プリンタ102、キーボード103、フロッピー(R)ディスク装置104、CD−ROM(Compact Disk− Read Only Memory)装置105、読み出し専用メモリ(Read Only Memory。以下、ROM)106、読み書き可能なランダムアクセスメモリ(Random Access Memory。以下、RAM)107、磁気ディスク装置108、中央処理装置(Central Processing Unit。以下、CPU)109、通信インターフェイス110、及び、これらを接続するバス111から構成されている。フロッピー(R)ディスク装置104はフロッピー(R)ディスク112の読み書きを行い、CD−ROM装置104はCD−ROM113の読み出しを行う。また、通信インターフェイス110により、本計算機システムは通信ネットワーク114に接続されている。
【0055】
本発明を実施する文章検索プログラムは、ROM106に記憶しておく。あるいは、フロッピー(R)ディスク112、CD−ROM113、又は、磁気ディスク装置108に文章検索プログラムを記憶しておき、RAM107に転送した後、CPU109が実行するのでも良い。CPU109は、RAM107を作業領域に使って文章検索プログラムを実行する。必要に応じて、磁気ディスク装置108を作業領域に使っても良い。文章検索プログラムの実行の指示はキーボード103から行い、実行結果は、ディスプレイ101、又は、プリンタ102に出力する。文章検索プログラムの実行を、フロッピー(R)ディスク112から指示することや、実行結果をフロッピー(R)ディスク112に書き込んでも良いのは言うまでもない。
【0056】
文書データベースは、フロッピー(R)ディスク112、CD−ROM113、又は、磁気ディスク108に蓄えておく。高速なアクセスのためにRAM107に転送しておくのでも良い。RAM107に転送する際に、容易に処理できる形式に変換するのも良い。また、文章検索プログラム、文書データベース、又は、実行の指示を、ネットワーク114経由で本計算機システムに入力したり、実行の結果をネットワーク114経由で本計算機システムから出力したりしても良いことは、もちろんである。
【0057】
また、図に示されたものに限らず、各種の記録媒体、入力手段、出力手段を用いて、本計算機システムへの入力と出力を行うなど各種の実施態様への変形が可能なことは言うまでもない。これらの、記録媒体、入力手段、出力手段は本計算機システムが直接アクセスするものの他、通信ネットワークを経由してアクセスするものであっても良いのはもちろんである。
【0058】
図3から図7に示すのは、計算対象とするnグラムを選別して算出する文字列類似度による文書検索プログラムの処理フローである。
【0059】
図3は、検索文章に基づいて文書データベースを検索し、類似度の高い文書を選び出して出力する処理フローを示す。
【0060】
まず、ステップS11(以下、S11と略記)で、ある文字列の出現回数を効率よく計算する準備のために、文書データベースに含まれる全文書を統合してサフィックスファイル(Suffix File)を作成する。サフィックスファイルの作成法と利用法は、M. Yamamoto and K. W. Church, Using Suffix Arrays to Compute Term Frequency and Document Frequency for All Substrings in a Corpus, In proceeding of 6th Workshop on Very Large Corpora, Ed. Eugene Charniak, Motreal, pp28-37, 1998に開示されている。
【0061】
サフィックスファイルを使うと、ある文字列が文書データベース内に出現する回数を高速に求めることができる。サフィックスファイルは、すべての文書において生じうる部分の文字列を、文字コード順に並び替えて、通し番号(サフィックス)を付けておくことで実施する。文字列が文書データベースに出現する回数は、その文字列と一致する文字列がサフィックスファイルの中にいくつあるかを算出することで求められる。
【0062】
具体的には、まず、一致する文字列のサフィックスの最小値minと最大値maxをそれぞれ二分探索法により求める。一致する文字列がなければ、文書データベースに出現する回数は0である。minとmaxが求まれば、文字列が出現する回数tfは、tf=max‐min+1で求められる。
【0063】
文書データベースの文書は、文書番号によって互いに区別されるものとし、サフィックスファイルに登録する部分文字列にはこの文書番号を付けておく。これによって、ある部分文字列を含む文書を効率的に検索することができる。また、dfは、重複する文書番号の数を数え上げ、その数をtfから引くことによって計算することができる。
【0064】
次にS12で、検索文章を文字列Xに読み込む。
【0065】
S13では、文字列Xから切り出される部分文字列を、文書データベース内における出現頻度tfに基づいて選別し、tfと組にして部分文字列管理テーブルに記録する。S13で行う処理については、図4を用いて後述する。
【0066】
S14では、部分文字列管理テーブルに記録された各部分文字列に対し、一致情報を収集し、一致情報管理テーブルへの記録を行う。一致情報管理テーブルには、文書番号毎に、一致情報のリストとして記録される。S14で行う処理については、図5を用いて後述する。
【0067】
S15では、一致情報管理テーブルから、ある一つの文書Yのリストを取り出す。
【0068】
次にS16で、取り出したリストよりXとYの類似度を計算する。S16で行う処理については、図6を用いて後述する。
【0069】
S17では、求めた類似度と文書番号を組にして文書管理テーブルに登録する。
【0070】
S18では、一致情報管理テーブルに記録された全てのリストについて類似度を計算したかどうかを判定する。もし、まだ全てのリストについて類似度を計算していなければ、まだ類似度の計算を行っていないリストをS15で選んで取り出し、S17までの処理を繰り返す。もし、全てのリストについて計算していれば、S19で、登録したテーブルを類似度の高い順に並び替える。
【0071】
S20では、類似度の高い文書の出力する処理を行う。出力する文書は、一つだけにする、あるいは、所定の複数にする、所定の類似度以上である全ての文書にする、など種々の態様が可能である。
【0072】
図4は、検索文章を読み込んだ文字列Xから部分文字列を切り出し、一致情報の収集に利用する部分文字列を出現頻度に基づき選別し、部分文字列管理テーブルに記録する処理のフローを示す。
【0073】
まず、S31で、部分文字列管理テーブルに記録された部分文字列の数を表す変数num_substringと切り出す部分文字列の長さを表す変数jを初期化している。MinNgramLengthは、切り出す部分文字列の長さの最小値を決めるパラメータである。
【0074】
次にS32で、文字列Xから長さjの部分文字列を一つ切り出し、文書データベース内における出現頻度tfを計算する。
【0075】
S33では、切り出された部分文字列のtfの値が0かどうかを判定する。もし、tf=0ならば、文書データベース内にその部分文字列は存在しないため、一致情報の収集に利用するのは不適当である。したがって、S34の処理を飛ばして、S35に進む。tf≠0ならば、S34に進む。
【0076】
S34では、切り出された部分文字列をtfと共に部分文字列管理テーブルに記録し、num_substringの値に1を加える。
【0077】
S35では、Xから切り出される長さjの全ての部分文字列についてtfを計算したかどうかを判定する。もし、まだ長さjの全ての部分文字列について計算していなければ、まだ計算していない長さjの部分文字列をS32で選んでtfを計算し、S34までの処理を繰り返す。もし、長さjの全ての部分文字列について計算していれば、S36で、jに1を加える。
【0078】
S37では、Xから切り出す部分文字列の長さjの値が、切り出す部分文字列の長さの最大値を決めるパラメータMaxNgramLengthより大きいかどうかを判定する。もし、jの値がMaxNgramLength以下なら、S32に戻り、長さjの部分文字列に対し、S36までの処理を繰り返す。もし、jの値がMaxNgramLengthより大きければ、長さがMinNgramLength以上、MaxNgramLength以下のすべての部分文字列に対しtfの計算を終えているので、S38に進み、部分文字列管理テーブルに記録された部分文字列をtfの小さい順に並び替える。
【0079】
S39では、部分文字列管理テーブルに登録された部分文字列の数num_substringが、一致情報の収集に用いる部分文字列の数の上限値を決めるパラメータSubStringLimitより大きいかどうかを判定する。もし、num_substringがSubStringLimitより大きければ、S40に進み、tfの小さい順にSubStringLimit個の部分文字列を取り出し、これらの部分文字列を改めて部分文字列管理テーブルに記録する。もし、num_substringがSubStringLimit以下ならば、S40をスキップしてS41に進む。
【0080】
S41は、記録された部分文字列管理テーブルを返す処理である。
【0081】
図5は、部分文字列管理テーブルに記録された各部分文字列と、文書データベース内の各文書との一致情報を収集し、その情報を一致情報管理テーブルに記録する処理のフローを表す。
【0082】
まず、S51では、変数p0fit_sumを0に初期化する。変数p0fit_sumは、類似度を一致したnグラムの重みの加算で算出する際に、計算手間を高速化するために用いる変数で、文書データベース内の文書全体に関する類似度のオフセットである。
【0083】
S52では、部分文字列管理テーブルからある一つの部分文字列を選びaに読み込む。
【0084】
S53では、p0fit、p1fit、p2fit、p3fit、p4fitを計算し、p0fit_sumにp0fitを加算する。p0fit、p1fit、p2fit、p3fit、p4fitは、それぞれ、aがある文書内に、出現しなかった、1回出現した、2回出現した、3回出現した、4回以上出現したときの、その文書におけるaの重みである。p0fit、p1fit、p2fit、p3fit、p4fitの計算方法については、図7を用いて後述する。
【0085】
S54では、文書データベース内でaが出現する場所を全て求め、これを出現する場所の順に並び替える。
【0086】
S55では、aの各出現場所に対し、aを含む文書の文書番号を求める。このとき、aは出現場所順に並んでいるので、得られる文書番号も小さい順に並んでいる。
【0087】
S56では、出現場所の順にaの出現場所を一つ選ぶ。
【0088】
S57では、選んだaの出現場所が、それを含む文書内において、最も前方にある出現場所かどうかを判定する。つまり、選んだ出現場所の文書と、一つ前の出現場所の文書が異なっていれば、それは最初の出現場所であり、同じであれば、2番目以降の出現場所である。最初の出現場所であれば、S58に進み、その文書内におけるaの出現回数dtfを計算し、aの文書内における重みを決める。また、sequence_num=1とする。sequence_numは、選らんだ出現場所が文書内において何番目のaの出現場所かを表すシーケンス番号である。
【0089】
S59では、文書内のシーケンス番号sequence_num、入力文字列Xにおけるaの出現場所(以下、startX)、文書内におけるaの出現場所(以下、startdoc)、aの長さ(以下、termlength)、aの重み(以下、score)を組にして一致情報管理テーブルに記録し、sequence_numに1を加える。ただし、scoreに記録される値はaのそのままの重みではなく、aの重みからp0fitを引いた値を記録する。これは、類似度を一致したnグラムの重みの加算で計算する場合、選別された各部分文字列について、それを含まない文書の類似度にそれぞれの部分文字列のp0fitを加算する代わりに、一致したnグラムの重みからp0fitを引いた値を加算しておき、最後に全ての類似度に対して重みのオフセットp0fit_sumを加えることによって、計算の手間を減らすための工夫である。
【0090】
S60では、sequence_numとtfの値を比較して、aの全ての出現場所について一致情報の記録を行ったかどうかを判定する。もし、記録していない一致情報があれば、S56で次のaの出現場所を選び、S59までの処理を繰り返す。もし、aの全ての出現場所について一致情報の記録をしていればS61に進む。
【0091】
S61では、部分文字列管理テーブル内の全ての部分文字列について、一致情報の収集を行ったかどうかを判定する。もし、一致情報の収集をしていない部分文字列があれば、S52で、まだ選んでいない部分文字列をaに読み込み、S60までの処理を繰り返す。もし、すべての部分文字列について一致情報の収集を終えていれば、S62で、得られた一致情報管理テーブルを返す。
【0092】
図6は、入力文章Xと文書Yの類似度を、一致情報管理テーブルから取り出したリストを用いて、一致した文字列の重みの加算によって求める処理フローである。
【0093】
まず、S71で、XとYの類似度(以下、sim)を0に初期化する。
【0094】
S72では、一致情報管理テーブルに記録されているYに関するリストからある一つを選び、Iに読み込む。
【0095】
S73では、読み込んだIのsequence_numが1かどうかを判定する。これは、同一の部分文字列のscoreをsimに重複して加算しないための処理である。もし、sequence_numが1でなければ、S74をスキップし、S75に進む。sequence_num=1であれば、S74で、simにIのscoreを加算する。
【0096】
S75では、Yに関する一致情報のリストに記録された全ての一致情報について調べたかどうかを判定する。もし、全ての一致情報について調べていれば、S76で、simに文書全体の重みのオフセットp0fit_sumを加算する。まだ、調べていない一致情報があれば、S72で、まだ調べていない一致情報を選んでIに読み込み、S74までの処理を繰り返す。
【0097】
S77は、得られたsimをXとYの類似度として返す処理である。
【0098】
図7は、図5のS53における、p0fit、p1fit、p2fit、p3fit、p4fitの計算処理フローを示す。
【0099】
まず、S81で、p0fit、p1fit、p2fit、p3fit、p4fitをすべて0に初期化する。
【0100】
S82では、部分文字列aのdfを計算し、S83で、dfと文書データベース内の文書の総数Nからidfを計算する。このidfは、情報理論の分野における情報量を背景とする値で、この値を部分文字列の重みとする方法も良く知られている。
【0101】
S84では、部分文字列aが検索に有効な部分文字列であるかどうかを判定するための閾値tf_thresholdを計算する。
【0102】
S85では、tfとdfの値から部分文字列aが検索に有効かどうかを判定する。tf /df > tf_thresholdであれば、検索に有効な部分文字列であると判断し、S86に進む。そうでなければ、検索には有効でないと判断して、S86、S87をスキップし、S88でp0fit、p1fit、p2fit、p3fit、p4fitを返す。つまり、p0fit、p1fit、p2fit、p3fit、p4fitの値は全て0が返される。
【0103】
S86では、p0fit、p1fit、p2fit、p3fit、p4fitを計算する。
【0104】
S87の関数MAXとMINは、それぞれ、引数に与えられた数値の最大値もしくは最小値を返す関数で、この関数により、p0fit、p1fit、p2fit、p3fit、p4fitの値をLB以上UB以下の範囲に制限している。LBとUBは共にp0fit、p1fit、p2fit、p3fit、p4fitの分布を制限するパラメータである。S88は、p0fit、p1fit、p2fit、p3fit、p4fitを返す処理である。
【0105】
以上の説明からも分かる通り、重みp0fit、p1fit、p2fit、p3fit、p4fitは、tf、df、idfの関数として求められる。S84とS86に用いている係数は、Christopher D. Manning and Hinrich Schutze, Foundations of Statistical Natural Language Processing, The MIT Press, Cambridge, Massachusetts, pp.529-574, 1999.に開示されている理論に基づき、ドキュメントデータの観測値を求めることによって定めた。なおこれらの係数は示された数値に限定されるものではなく、目的に応じて適切な値にすることが許容される。
【0106】
図5のS53における、p0fit、p1fit、p2fit、p3fit、p4fitの計算処理フローとしては、図7で示したフローの代わりに、図15に示すフローを適用することもできる。図15における計算処理フローを以下に述べる。
【0107】
まず、S181で、p0fit、p1fit、p2fit、p3fit、p4fitをすべて0に初期化する。
【0108】
S182では、部分文字列aのdfと、部分文字列aが2回以上出現する文書データベース中の文書の数(以下、df2と記す)を計算する。S183で、dfと文書データベース内の文書の総数Nからidfを計算する。
【0109】
S184では、部分文字列aが検索に有効な部分文字列であるかどうかを判定するための閾値df2_thresholdを0.22に設定する。
【0110】
S185では、dfとdf2の値から部分文字列aが検索に有効かどうかを判定する。df2 /df > df2_thresholdであれば、検索に有効な部分文字列であると判断し、S186に進む。そうでなければ、検索には有効でないと判断して、S186、S187をスキップし、S188でp0fit、p1fit、p2fit、p3fit、p4fitを返す。つまり、p0fit、p1fit、p2fit、p3fit、p4fitの値は全て0が返される。
【0111】
S186では、p0fit、p1fit、p2fit、p3fit、p4fitを計算する。
【0112】
S187は図7のS87と同様に、p0fit、p1fit、p2fit、p3fit、p4fitの値をLB以上UB以下の範囲に制限するものである。LBとUBは共にp0fit、p1fit、p2fit、p3fit、p4fitの分布を制限するパラメータである。S188は、p0fit、p1fit、p2fit、p3fit、p4fitを返す処理である。
【0113】
以上の説明からも分かる通り、図15の計算処理フローでは、部分文字列aが検索に有効かどうかを判定する基準として、先に述べた図7の計算処理フローにおけるtfの代わりにdf2を用いている。df2/dfは、部分文字列の出現集中度、つまり、ある部分文字列が特定の文書にのみ集中して出現する度合を表しており、この情報を用いて部分文字列の選別を行うことにより、検索精度の向上を図っている。
【0114】
S183における閾値df2_thresholdおよびS186に用いている係数は、示された数値に限定されるものではなく、目的に応じて適切な値にすることが許容される。
【0115】
図8に、一致情報管理テーブルの構成図を示す。一致情報管理テーブルは、文書番号毎の一致情報のリストによって構成される。図8では、文書番号0002に一致情報1と一致情報5が、文書番号0100に一致情報2、一致情報3と一致情報6が、文書番号0111に一致情報4と一致情報7がリストとして記録されている。それぞれの一致情報には、部分文字列の文書内におけるシーケンス番号sequence_num、入力文字列Xにおける部分文字列の出現場所(startX)、文書内における部分文字列の出現場所(startdoc)、部分文字列の長さ(termlength)、部分文字列に付けられた重み(score)が格納されている。
【0116】
新たに、文書番号0002に関する一致情報8が得られた場合、図8のように、これまで一致情報5を指していたリストの先頭を指すポインタは一致情報8を指し、一致情報8から一致情報5へのポインタが張られ、文書番号0002のリストの先頭に一致情報8は記録される。
【0117】
(第3実施例)
次に、nグラムDP類似度に基づき、入力された文字列と最も類似度の高い文書を検索する文書検索装置の実施例を図9に示す。この文書検索装置は、文書データベース10、文字列入力部11、部分文字列選別部13(内部の図示は省略)、一致情報収集部14(内部の図示は省略)、類似度算出部17、類似度算出制御部18、再帰実行制御部19、及び、検索結果出力部12から構成されている。
【0118】
文書データベース10、文字列入力部11、部分文字列選別部13、一致情報収集部14、及び、検索結果出力部12は実施例1の同符号を付した部分と同じ機能・構成であり説明を省略する。
【0119】
類似度算出制御部18は一致情報管理テーブルT2より、ある1つの文書Yに関するリストを取り出し、文字列XとYとともに類似度算出部17に与える。
【0120】
類似度算出部17は、与えられた一致情報のリストより、式(1)または式(2)に基づいてXとYの類似度を算出する。この類似度を算出する途中で、一部分の文字列について同様に類似度を求める必要がある。これは、再帰実行制御部19により、類似度算出部17を繰り返し用いることで実施する。類似度算出部17は一致文字列類似度算出部61、任意文字列類似度算出部62、最大値選択部63から成る。一致文字列類似度算出部61は式(3)のSimDPs(α, β)を計算する。任意文字列類似度算出部62は式(5)のSimDPg(α, β)を計算する。最大値選択部63は、これらに対して関数MAXを実施することで、式(2)のSimDP(α, β)を算出する。なお、類似度算出部17の受け取った文字列α、βの両方が空文字のときは、再帰実行制御部19によりSimDP(α,β) =0.0とする。この際、一致文字列類似度算出部61、任意文字列類似度算出部62、最大値選択部63は動作させない。言うまでもなく、このSimDP(α,β) =0.0という値は、式(1)を実施するものである。
【0121】
一致文字列類似度算出部61は、文字列分離制御部71、文字列分離部72、類似度算出部73、加算部74、最大値選択部75により実施されており、式(3)のSimDPs(α,β)を算出する。αとβの一致する先頭の文字列が一致情報管理テーブルT2に記録された文字列である場合のみSimDPs(α,β)を算出する。
【0122】
まず、文字列分離制御部71は、一致文字列類似度算出部61が受け取った文字列α(=ξγ)、β(=ξδ)において、一致する文字列ξがない場合、すなわち、一致する文字列ξが空文字列の場合は、式(1)に従い、SimDPs(α,β)=0.0とする。
【0123】
次に、文字列分離制御部71は、一致文字列類似度算出部61が受け取った文字列α(=ξγ)、β(=ξδ)において、一致する文字列ξがある場合は、全てのξに関して、文字列分離部72、類似度算出部73、加算部74を動作させて、式(3)に含まれるScore(ξ)+SimDP(γ, δ)を計算させる。そして、最も大きな値を最大値選択部75により選択する。このことにより、式(3)に示すSimDPs(α,β)が求まる。
【0124】
文字列分離部72は、文字列αをξとγに、文字列βをξとδに分離した後に一致情報管理テーブルT2を参照してξの重みScore(ξ)を加算部74に与え、γとδを類似度算出部73に与える。類似度算出部73は、式(3)のSimDP(γ, δ)を算出する。類似度算出部73は、実際には、再帰実行制御部17により、類似度算出部16をγとδに対して適用することで、実施する。加算部74は、式(3)の加算を行う。
【0125】
任意文字列類似度算出部62は、類似度算出部81〜83、最大値選択部84により実施されており、式(2)のSimDPg(α,β)を算出する。先頭の文字列が異なる場合か、先頭の文字列は一致するが一致情報管理テーブルに登録されていない文字列の場合に任意文字列類似度算出部62は実行される。受け取った文字列α(=ζγ)、β(=ηδ)の先頭の1文字ζ、ηの有無に関する各場合に対応して、類似度算出部81、82、83は、それぞれ式(5)のSimDP(α,δ), SimDP(γ,β), SimDP(γ,δ)を求める。類似度算出部81〜83は、実際には、再帰実行制御部19により、類似度算出部17を、αとδ、γとβ、γとδのそれぞれに対して適用することで、実施する。最大値選択部84は、式(5)の関数MAXを実施する。
【0126】
(第4実施例)
ソフトウエアにより文字列Xと文字列YのnグラムDP類似度を求める処理フローを図10と図11に示す。この処理は、図3のS16の内部処理として、図6で説明した処理の代わりに用いることが可能である。また、実行にあたっては第2実施例で示したコンピュータシステムを用いている。
【0127】
まず、S91では、XとYそれぞれにおいて、リストに記録された部分文字列の先頭文字と最終文字の中で、最も前にある先頭文字の場所minX、minYと、最も後ろにある最終文字の場所maxX、maxYを求め、長さmaxX-minX+1の配列X_indexと、長さmaxY-minY+1の配列Y_indexを用意し、全ての要素を−1に初期化する。これらの配列は、それぞれ、XのminXからmaxXまでの各文字、YのminYからmaxYまでの各文字と対応している。
【0128】
S92からS94の処理では、XにおけるminXからmaxXまでの各文字、YにおけるminYからmaxYまでの各文字で、リストに記録された各部分文字列の先頭文字もしくは最終文字にあたる文字と対応する配列X_index、Y_indexの要素に0を代入する。
【0129】
S95からS99の処理では、X_index[i]=0であるiに対し、前から順に、0,1,2,…, X_index_num-1と通し番号を振り、その番号をX_index[i]に代入する。従って、X_index_numは、X_index[i]≠−1であるiの数である。
【0130】
S100からS104では、Y_indexに対して同様の処理を行う。Y_index[j]=0であるjに対し、前から順に、0,1,2,…, Y_index_num-1と通し番号を振り、その番号をY_index[j]に代入する。従って、Y_index_numは、Y_index[j]≠−1であるjの数である。
【0131】
S105では、リストに記録されたXとYの一致情報を、まずXにおける部分文字列の出現する順に並び替える。次にXにおける部分文字列の出現する順が同じものについて、Yにおける部分文字列の出現する順に並び替え、一致情報の数をmに読み込む。
【0132】
次に、類似度をDPによって効率的に求めるための準備として、(X_index_num+2)行(Y_index_num+2)列のスコア表scoretableを作り、表の全ての要素を0に初期化する。この表は、縦方向が、文字列Xの中で、リストに記録された部分文字列の先頭文字もしくは最終文字にあたる文字、横方向が、文字列Yの中で、リストに記録された部分文字列の先頭文字もしくは最終文字にあたる文字に対応している。
【0133】
S106では、kとiを、k=1、i=0に初期化する。
【0134】
S107では、jをj=0に初期化する。変数kは、現在、先頭からk番目の一致情報について注目していることを表し、iとjは、それぞれ、XとYにおけるリストに記録された部分文字列の先頭文字もしくは最終文字の中で、どの文字に注目しているかを表す変数である。S108では、現在のスコアとして、currentscoreにscoretable[i] [j]を代入する。
【0135】
ここで、説明の便宜上、リストの先頭からk番目の一致情報を、それぞれ、startX(k)、startdoc(k)、termlength(k)、score(k)と表すことにする。
【0136】
S109では、iとjが指す場所が、前からk番目の一致情報の部分文字列が出現する場所と一致しているかどうかを判定する。一致していれば、S110に進み、一致していなければ、S114に進む。
【0137】
S110では、スコア表において、一致した部分文字列の最終文字と対応する行番号と列番号を求め、それぞれ、target_iとtarget_jに代入する。
【0138】
S111では、scoretable[target_i][target_j]において、現段階で得られているスコアと、currentscoreに一致する部分文字列の重みscore(k)を加算して得られるスコアを比較し、もし、scoretable[target_i][target_j]よりcurrentscore+score(k)の方が大きければ、S112で、scoretable[target_i][target_j]にcurrentscore+score(k)を代入する。そうでなければ、S112をスキップし、S113に進む。
【0139】
S113では、kの値に1を加え、リスト内の次の一致情報に注目し、S109に戻る。S109では、次の一致情報もiとjを出現場所とするならS113までの処理を繰り返し、そうでなければ、S114に進む。
【0140】
S114からS119までの処理では、現在のスコアcurrentscoreとスコア表の右、下、右下のスコアを比較し、currentscoreの方が大きければcurrentscoreを代入する。
【0141】
S120では、jがスコア表の右端まで来たかどうかを判定する。もし、右端まで来ていなければ、S121でjに1を加え、S108に戻り、S119までの処理を繰り返す。右端まで来ていれば、S122に進む。
【0142】
S122では、iがスコア表の下端までに来たかどうかを判定する。もし、下端まで来ていなければ、S123でiに1を加え、S107に戻り、S120までの処理を繰り返す。下端までていれば、S124に進み、scoretable[X_index_num+1][Y_index_num+1]をXとYの類似度として返す。
【0143】
【発明の効果】
請求項1に記載の発明によれば、入力された文字列から切り出した部分文字列のうち、文書データベース内の文書との類似度算出に関して効果のある文字列を選別して、類似度を求めることができる。すなわち検索に効果の高い文字列に限定して類似度を求めることができる。
【0144】
請求項2に記載の発明によれば、二つの文字列それぞれにおける順序に適合し、かつ、共通する部分文字列に着目して類似度を求めることができる。すなわち文字列の出現順序を考慮した類似度が求められる。
【0145】
請求項3に記載の発明によれば、類似度算出に関する効果の大きな順に文字列を選別して、類似度を求めることができる。これにより決まった類似度はより適切な値となる。
【0146】
請求項4に記載の発明によれば、一致した部分文字列の重みを加算する方法だけでなく、その他の類似度算出方法を組み合わせることができる。これにより検索精度が更に向上する。
【0147】
請求項5に記載の発明によれば、入力された文字列から切り出した部分文字列のうち、文書データベース内の文書との類似度算出に関して効果のある文字列を選別して、検索に効果の高い文字列に限定して類似度を求める装置を実現できる。
【0148】
請求項6に記載の発明によれば、二つの文字列それぞれにおける順序に適合し、かつ、共通する部分文字列に着目して文字列の出現順序を考慮した類似度を求める装置を実現できる。
【0149】
請求項7の発明によれば、入力された文字列から切り出した部分文字列のうち、文書データベース内の文書との類似度算出に関して効果のある文字列を選別して、検索に効果の高い文字列に限定して類似度を求めるプログラムを提供できる。
【0150】
請求項8に記載の発明によれば、二つの文字列それぞれにおける順序に適合し、かつ、共通する部分文字列に着目して文字列の出現順序を考慮した類似度を求めるプログラムを提供できる。
【0151】
請求項9に記載の発明によれば、以上述べたような効果を種々のコンピュータ上で実現できる。
【0152】
次に、第1および第2の実施例に関する検索性能を説明する。入力文字列から切り出される部分文字列を選別する効果と、部分文字列の選別基準にdfの代わりにtfを用いることの効果を確認するための評価実験を行った。
【0153】
選別の基準にtf、dfを用いた時の、選択した部分文字列の数と検索精度の関係を図12に、選別した部分文字列の数と検索時間の関係を図13に示す。検索精度には、11pt平均精度と呼ばれる値を用いた。11pt平均精度とは、再現率(0〜1)に対し、0.1刻みで1〜11点を割り当て、それぞれの値を平均した評価指数で、詳細については、G Salton and M. J MacGill, Introduction to Modern Information Retrieval, p174-181, MacGraw-Hill Book Co., New York, 1983.に開示されている。
【0154】
入力文字列から切り出す部分文字列の長さは2に、つまりbigramのみとした。また、図7のS87で用いるパラメータLBとUBは、それぞれ、LB=0、UB=idfとした。用いた文書データは、NTCIR1テストコレクションと呼ばれる代表的な類似情報検索用テストデータで、約300,000件の文書と53件の検索文章を含んでいる。
【0155】
図12、図13共に、横軸には選択した部分文字列の数、つまりSubStringLimitの値を、図12の縦軸には検索精度を、図13の縦軸には53件の検索文章を検索するのに要した時間を示している。
【0156】
図12を見ると、tf、df共に、SubStringLimitの値が小さい時には、SubStringLimitを増加させることによって検索精度が向上することが確認できるが、ある程度大きくなると、SubStringLimitの値を増加させても検索精度があまり変化しないことが確認できる。このことから、SubStringLimitを適当な値に設定してやれば、部分文字列の選別を行っても、検索精度の低下を抑えることができる。また、tfとdfを比較すると、dfを基準とした選別による検索精度の方が上回っていることが確認できるが、SubStringLimitの値がある程度大きくなると、tfを基準として選別した場合でも、dfの時とほぼ同等の検索精度を持つことが確認できる。
【0157】
図13を見ると、tf、df共に、SubStringLimitの値が減少するにつれ検索時間が短くなっており、部分文字列を選別することによる高速化の効果が確認できる。また、tfとdfの比較をすると、tfを用いた方の検索時間が小さく、SubStringLimitの値が小さいほどその差は大きくなることが確認できる。仮に、SubStringLimitの値を、tf、df共に高い検索精度を示している値、SubStringLimit=22に設定したとすると、その時の検索時間は、tfが264.6秒、dfが367.1秒で、1.4倍ほどtfの方が高速である。このように、本発明によって検索時間を向上させることができる。
【0158】
次に、図3のS16における類似度の算出に、第3および第4実施例による方法を適用した時の検索性能を説明する。類似度の算出法に、図6の加算による方法を用いた場合と、図10、11のDPによる方法を用いた場合の検索精度の比較を行い、その結果を図14に示す。検索精度には、11pt平均精度を用いた。入力文字列から切り出す部分文字列の長さは2に、つまりbigramのみとし、図7のS87で用いるパラメータLBとUBは、それぞれ、LB=0、UB=idfとした。用いた文書データは、NTCIR1テストコレクションである。
【0159】
図14の横軸には選択した部分文字列の数、つまりSubStringLimitの値を、縦軸には検索精度を示している。図14を見ると、SubStringLimitが15以下の時には、検索精度に大きな差はないが、15を超えた場合には、DPを用いた方法が加算による方法に比べ、検索精度が上回っていることが確認できる。また、検索時間を測定した所、DPによる方法は、加算による方法に比べ約2倍の検索時間を要すること、既存のDPによる方法と比較すると数十倍高速であることが確認された。
【0160】
このように、本発明によって、収集した一致情報に対しDPを適用することで、加算による方法よりも検索精度を向上することができ、既存のDPによる方法と比べ高速に類似度を算出できることができる。
【図面の簡単な説明】
【図1】本発明による文書検索装置の実施例を示す図である。
【図2】本発明により文章検索を行う計算機システムの実施例を示す図である。
【図3】本発明の実施例の文章検索を行う処理のフローチャートである。
【図4】文字列から切り出される部分文字列の選別を行う処理のフローチャートである。
【図5】一致情報を収集し、記録する処理のフローチャートである。
【図6】一致情報から加算による類似度を求める処理のフローチャートである。
【図7】部分文字列の重みを求める処理のフローチャートである。
【図8】一致情報管理テーブルの構成図である。
【図9】本発明による文書検索装置の別の実施例を示す図である。
【図10】一致情報からnグラムDP類似度を求める処理の前半部分のフローチャートである。
【図11】一致情報からnグラムDP類似度を求める処理の後半部分のフローチャートである。
【図12】選別の基準にtf、dfを用いた時の、選択した部分文字列の数と検索精度の関係を示す図である。
【図13】選別の基準にtf、dfを用いた時の、選別した部分文字列の数と検索時間の関係を示す図である。
【図14】本発明におけるDPを用いた類似度算出法と加算による類似度算出法の、検索精度の対比を示す図である。
【図15】部分文字列の重みを求める別の処理のフローチャートである。
【符号の説明】
10:文書データベース
10a、10b、10c:文書
11:文字列入力部
12:検索結果出力部
13:部分文字列選別部
14:一致情報収集部
15、17、73、81、82、83:類似度算出部
16、18:類似度算出制御部
19:再帰実行制御部
31:部分文字列切り出し制御部
32:部分文字列切り出し部
33:文字列出現頻度算出部
34:部分文字列登録部
41:一致情報収集制御部
42:文字列出現場所検索部
43:文字列重み算出部
44:一致情報登録制御部
45:一致情報登録部
51:文字列重み加算制御部
52:文字列重み加算部
61:一致文字列類似度算出部
62:任意文字列類似度算出部
63、75、84:最大値選択部
71:文字列分離制御部
72:文字列分離部
74:加算部
101:ディスプレイ
102:プリンタ
103:キーボード
104:フロッピー(R)ディスク装置
105:CD−ROM装置
106:読み出し専用メモリ(ROM)
107:ランダムアクセスメモリ(RAM)
108:磁気ディスク装置
109:中央処理装置(CPU)
110:通信インターフェイス
111:バス
112:フロッピー(R)ディスク
113:CD−ROM
114:通信ネットワーク
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to determination of similarity between two character strings, and is particularly suitable for use in determining similarity between an input character string and a document registered in a database in information retrieval.
[0002]
[Prior art]
Information retrieval for retrieving a desired document from a document database is often performed. In such information retrieval, a document is handled as a set of character strings in which words composed of a plurality of characters are combined. Then, the search is performed by comparing the search character string and the character strings in the search target document and selecting one or a plurality of items having high similarity. The degree of similarity between character strings can be broadly divided into two methods: a method using morphological analysis and a method for obtaining a match between partial character strings of length n (hereinafter referred to as n-grams).
[0003]
A method using morphological analysis is disclosed in, for example, Gerard Salton and Christopher Buckley, Term-Weighting Approaches in Automatic Text Retrieval, Information Proceeding and Management, 24, pp. 513-523, 1988. The basic procedure for obtaining the similarity between two character strings by this method is as follows. First, both character strings are decomposed into word strings by morphological analysis using a dictionary and grammatical knowledge. Next, both word strings are compared to find a matching word. Then, a weight is set for the matching word. This weight is then added for all matching words. The sum obtained as a result of this addition becomes the similarity by morphological analysis.
[0004]
The method using morphological analysis has an essential problem that information retrieval ends abnormally if the accuracy of morphological analysis itself is low. In order to increase the accuracy of morphological analysis, the word dictionary and grammatical rules have to be large-scale, and it is difficult to easily use information retrieval. In addition, for documents that contain buzzwords, coined words, or technical terms that are used only in limited fields, the maintenance of the word dictionary is a heavy burden.
[0005]
Next, the method by n-gram is, for example, Yasushi Ogawa and Toru Matsuda, Overlapping statistical word indexing: A new indexing method for Japanese text, In proceeding of SIGIR '97, Philadelphia PA, USA, pp.226-234, 1997. Is disclosed. The basic procedure for obtaining the similarity between character strings by this method is as follows. First, an n-character partial character string included in both character strings is obtained. Next, a weight is set for the common partial character string. This weight is then added for all matching parts. The sum obtained as a result of this addition becomes the similarity by n-grams.
[0006]
Regarding the setting of the weight of the common partial character string, a large value is given to a character string that appears intensively in a specific document and does not appear in other documents. Conversely, only small values are given to character strings that appear in many documents. This reflects that a character string appearing in many documents is not an element that characterizes the document and cannot be effectively used for searching.
[0007]
Since the n-gram method does not require morphological analysis, it can handle unknown words such as new technical terms and can be used easily.
[0008]
Among the n-gram methods, in particular, in the calculation of similarity using a character string of length 2 (hereinafter referred to as bigram), not all biggrams to be cut out are limited to bigrams that do not include hiragana Then, there is a method for obtaining matching information about character strings and calculating a similarity. This is because the bigram including hiragana is highly likely to appear in many documents in the document database, and the probability of becoming a character string characterizing each document is extremely small. It is recognized that the inclusion of bigrams containing hiragana characters in the comparison of character strings only increases the amount of calculation and the search accuracy cannot be expected to improve significantly.
[0009]
[Problems to be solved by the invention]
As described above, the n-gram method has many advantages over the morphological analysis method, and is often used in the field of information retrieval. The problem with the n-gram method is that the amount of calculation increases as the document database grows, and it takes time to obtain search results.
[0010]
By the way, among the partial character strings cut out from the character string, the partial character strings are not necessarily effective in calculating the similarity, that is, they are included in many documents in the document database, so the weight is small and the influence on the similarity is small. It is considered that many substrings are included. For this reason, the method of checking whether all n-grams cut out from the character string match is not efficient in terms of calculation time.
[0011]
In addition, the method of not treating the string containing hiragana as matching information for the extracted bigram is efficient in terms of calculation time, but even the character string that is originally valid for search is uniformly truncated. It will be. As a result, there is a problem that the search accuracy is lowered.
[0012]
The present invention solves the problems in the above-described n-gram method, and provides a method that achieves both reduction in calculation time and improvement in search accuracy.
[0013]
[Means for Solving the Problems]
According to the first aspect of the present invention, in the method of calculating the similarity between two character strings, the partial character strings selected based on the effect on the similarity calculation among the partial character strings cut out from the first character string. The matching information with the second character string is collected, the weight of the matched partial character string is calculated from the matching information, and the similarity is calculated based on the weight. In this way, when obtaining matching information between character strings, not all the n-grams to be cut out are handled, but the n-grams effective for calculating the similarity are selected by estimating the effect on the calculation of the similarity. ing.
[0014]
Since it is configured as described above, it is possible to reduce the calculation time while maintaining a search accuracy substantially equal to a search accuracy by a method that does not select.
[0015]
According to a second aspect of the present invention, in the method of calculating the similarity between two character strings, the partial character strings selected based on the effect on the similarity calculation among the partial character strings cut out from the first character string. , Collecting the matching information with the second character string, based on the weight of the partial character string that matches the order of appearance in the first and second character strings from the partial character strings included in the matching information The similarity is calculated. In this way, in calculating the similarity between character strings, a partial character string that matches the order of appearance in each character string is further selected from the partial character strings recorded in the matching information, and the weight is set as the similarity. It is used for calculation.
[0016]
Since it is configured as described above, the partial character string for calculating the weight is limited, and the calculation speed can be further increased while the search accuracy is maintained.
[0017]
The invention according to claim 3 is the invention according to claim 1 or 2, wherein the partial character string is selected in consideration of the number of times the partial character string cut out from the first character string appears in the second character string. It is characterized by being performed.
[0018]
Since it is configured as described above, it is possible to efficiently select partial character strings that are effective in calculating similarity, and it is possible to further reduce calculation time while maintaining search accuracy.
[0019]
The invention according to claim 4 is the invention according to any one of claims 1 to 3, wherein as the matching information between the character strings, the length of the partial character string, the appearance location of the partial character string in the first character string , An appearance location of the partial character string in the second character string, and a sequence number representing the number of matches in the second character string.
[0020]
Since it is configured as described above, it is possible to use not only a method of calculating the similarity by adding the weights of the matched n-grams, but also using many similarities calculation methods.
[0021]
According to a fifth aspect of the present invention, in the character string similarity calculation device for calculating the similarity between two character strings, a partial character string cut out from the first character string is selected based on the effect on the similarity calculation. A partial character string selection unit that performs matching, a matching information collection unit that collects matching information between the second character string, a weight by matching the partial character strings based on the matching information, and summing the weights A character string similarity calculating device comprising: a similarity calculating unit that calculates a degree.
[0022]
Since it is configured as described above, it is possible to realize an apparatus that shortens the calculation time while maintaining a search accuracy substantially equal to a search accuracy by a method that does not select.
[0023]
According to a sixth aspect of the present invention, in the character string similarity calculation device for calculating the similarity between two character strings, a partial character string cut out from the first character string is selected based on the effect on the similarity calculation. A partial character string selection unit, a matching information collection unit that collects matching information with a second character string for the selected partial character string, and a partial character string included in the matching information, Character string similarity, comprising: a matching partial character string selection unit that selects a partial character string that matches the appearance order; and a similarity calculation unit that sums the weights assigned to the matching partial character strings It is a calculation device.
[0024]
Since it is configured as described above, it is possible to realize a device in which partial character strings for calculating weights are limited and the calculation speed can be further increased while the search accuracy is maintained.
[0025]
The invention according to claim 7 is a character string similarity calculation program for calculating the similarity between two character strings, wherein a partial character string obtained by cutting the computer from the first character string is changed to the second character string. Sorting means for sorting based on the number of appearances; Matching information collecting means for collecting matching information with the second character string for the sorted partial character string; and weights of partial character strings matched based on the matching information A character string similarity calculation program that functions as similarity calculation means for calculating similarity by calculating the sum of the weights.
[0026]
With such a configuration, it is possible to cause the computer to function as a means for shortening the calculation time while maintaining a search accuracy substantially equal to a search accuracy by a method that does not select.
[0027]
The invention according to claim 8 is a character string similarity calculation program for calculating the similarity between two character strings, and the computer has an effect on the similarity calculation for a partial character string cut out from the first character string. The sorting means for sorting on the basis of the second character string, as the matching information with the second character string, for the sorted partial character string, the length of the partial character string, the appearance location of the partial character string in the first character string, the second A match information collecting means for collecting the appearance location of the partial character string in the character string, a sequence number representing the number of matches in the second character string, and a partial character string included in the match information, It is a character string similarity calculation program that functions as a similarity calculation unit that calculates a similarity based on a weight assigned to a partial character string that matches the order of appearance in the character string.
[0028]
With this configuration, the computer can function as a means for further speeding up the calculation while limiting the partial character string for calculating the weight and maintaining the search accuracy.
[0029]
The invention according to claim 9 is a computer-readable recording medium in which the program according to claim 7 or 8 is recorded.
[0030]
Since it is configured as described above, the recorded function can be realized at a necessary place.
[0031]
DETAILED DESCRIPTION OF THE INVENTION
The present invention relates to a method for calculating the similarity between character strings using n-grams, and an apparatus, program, and recording medium for realizing the method. Although it is assumed that the similarity between the input character string and a plurality of documents registered in the database is calculated, other applications are possible. When determining the matching part between character strings, it is not a method of obtaining n-grams common to the input character strings and the documents for all the documents in the database. A method of efficiently searching a document containing n-grams from the database by using a suffix file is used.
[0032]
The n-grams cut out from the input character string are considered to contain many n-grams that have little influence on the similarity calculation. The number of partial character strings cut out from the input character string is, for example, m-1 when the length of the input character string is m and the partial character string is limited to bigram which is two characters. Therefore, if the matching information is obtained for all the extracted bigrams without selecting the partial character strings, the calculation time increases as the input character string length m increases. Therefore, in the present invention, n-grams are selected from the extracted n-grams by estimating the effect on the calculation of the degree of similarity, and only a fixed number of n-grams are applied to the collection of matching information.
[0033]
Regarding the selection of partial character strings, it is necessary to select a partial character string having a large weight added to the degree of similarity in order to improve the search accuracy. Since the weight is determined by the number of documents in the database including the partial character string (hereinafter referred to as df), it is natural to select based on the value of df. However, in one aspect of the present invention, it is recommended to select a partial character string based on the number of n-grams appearing in the document in the database (hereinafter referred to as the frequency of appearance or tf) instead of df. Is done.
[0034]
tf can be calculated directly, and even if the value increases, the calculation time hardly changes. To calculate df, after calculating tf, the duplication in the document must be recalculated. When the value of is large, the calculation time becomes long. On the other hand, there is a large correlation between tf and df, and it can be expected that the use of tf instead of df will not affect the accuracy of the search.
[0035]
The collection of coincidence information is performed for each selected n-gram by the following method.
First, n-gram weights are calculated. Next, a document including the n-gram is obtained from the entire document database, the location of the n-gram in the document, the location of the n-gram in the input character string, the length of the n-gram, and the number of matches in the document The sequence number representing n and the weight of the n-gram are recorded as coincidence information.
[0036]
Usually, the obtained matching information is added and weighted as it is without recording and managing, and the similarity is calculated. In the present invention, by recording and managing this, the weight of the matched n-gram is obtained. In addition to the method of calculating the similarity by addition, the method can be applied to many methods of calculating the similarity while maintaining high speed.
[0037]
The similarity between the input character string and the document in the database is calculated by adding the weights assigned to the matched n-grams. However, even when a matching n-gram appears more than once in the same document, the weight is added only once. That is, just because a matching n-gram appears twice does not mean that the added weight is doubled. Instead, the weight of the n-gram stored as the matching information varies depending on each document according to the number of times the n-gram appears in the document (hereinafter referred to as dtf), and the greater the value of dtf, the greater the weight given. It is getting bigger. This weight is also defined for each n-gram even when dtf = 0, and a weight of 0 or less is added to all documents not including the n-gram. This is based on the idea that not including n-grams indicates that they are not similar, and it can be said that the added weight is obtained by quantifying the degree of dissimilarity. Accordingly, the value indicating the similarity is a real value including a negative value, and the similarity with the input character string increases as the value on the number line increases.
[0038]
The method of calculating the similarity is not limited to the above-described method of adding the weights attached to the matched n-grams, and other similarity calculation methods can be applied. One example is a method in which only n-grams that match the order of appearance in each character string are selected from the matched n-grams, and the sum of the weights assigned to these n-grams is used as the similarity.
[0039]
A method for calculating the similarity in consideration of the appearance order of character strings has been proposed. However, since they calculate weights for all matching partial character strings, the amount of calculation increases compared to the method of adding weights of matched n-grams, and the calculation time increases as the length of the character string to be handled increases. growing.
[0040]
In the present invention, a weight is given to the selected n-grams, and the weight is added to the similarity only when the n-grams match. Therefore, it is only necessary to consider the matching and appearance order for the selected partial character strings, so that the calculation can be performed faster than the conventional methods, and the calculation time can be increased even if the length of the character string to be handled increases. The effect is small. In this method, the similarity is calculated using dynamic programming (hereinafter referred to as DP) in order to efficiently find the combination having the highest similarity among the matching n-gram combinations. Hereinafter, a method of obtaining n-gram DP similarity using DP will be described.
[0041]
α, β, γ, and δ are character strings having a length of 0 or more, ξ, ζ, and η are character strings having a length of 1 or more, and “” is an empty character string. A character string (for example, α) in which a plurality of character strings (for example, ξ and γ) are connected is expressed by continuously writing the symbol of the character string as an element. (For example, α = ξγ).
[0042]
The n-gram DP similarity SimDP is obtained by recursively applying the following expression according to the matching pattern related to the character string portion of the argument. First, if both are empty strings,
SimDP ("", "") = 0 (1)
And Otherwise,
SimDP (α, β) = MAX (SimDPs (α, β), SimDPg (α, β)) (2)
And
Here, SimDPs (α, β) is a character string recorded in the list related to α and β in the matching information management table, and α = ξγ, β = ξδ,
SimDPs (α, β) = MAX (Score (ξ) + SimDP (γ, δ)) (3)
Is calculated for all ξ. When there is no such character string ξ,
SimDPs (α, β) = 0.0 (4)
And Score (ξ) is a function that returns the weight of ξ recorded in the coincidence information management table.
[0043]
Further, if ζ and η are the maximum character strings satisfying α = ζγ and β = ηδ and having no common part with the character strings recorded in the list related to α and β in the matching information management table, SimDPg (α , β) is
SimDPg (α, β) = MAX (SimDP (α, δ), SimDP (γ, β), SimDP (γ, δ)) (5)
Sought by. This formula is obtained by removing one of ζ or η or both ζ and η from two character strings (ζγ and ηδ) (α and δ, γ and β, γ and δ). This means that the highest degree of similarity is adopted.
[0044]
By applying the above formula recursively, a partial character string that matches the order of each of the two character strings can be obtained from the partial character strings recorded in the match information management table, and the degree of similarity is maximum. It becomes.
[0045]
The n-gram DP similarity shown above is weighted in consideration of matching not the character (character string of length 1) but the n-gram (character string of length n), as in equation (3). Thus, the similarity calculation method takes account of the continuity of characters. In addition, the matching between character strings is not considered for all partial character strings, but is limited to n-grams recorded in the matching information management table, and recorded in the matching information management table as shown in Equation (5). It is not necessary to determine whether or not there is a match for a portion that is not related to the partial character string that has been set, and can be removed. As a result, no matter how large the length of the character string for which similarity is to be calculated, only the portion related to the partial character string recorded in the match information management table needs to be considered. Compared with the conventional method that considers matching between character strings, the similarity can be calculated at high speed.
[0046]
(First embodiment)
First, an embodiment of a method for calculating the similarity between character strings using n-grams will be described. FIG. 1 shows an example of a document retrieval apparatus that retrieves a document having the highest similarity to an input character string based on the selected partial character string. The document search apparatus includes a document database 10, a character string input unit 11, a partial character string selection unit 13, a matching information collection unit 14, a similarity calculation unit 15, a similarity calculation control unit 16, and a search result output unit 12. It is configured.
[0047]
In the document database 10, a plurality of documents 10a, 10b, ..., 10c to be searched are registered. For the search, keywords, words, phrases, sentences, sentences, and the like are input (hereinafter referred to as search sentences representatively). The character string input unit 11 gives the search sentence as the character string X to the partial character string selection unit 13.
[0048]
The partial character string selection unit 13 cuts out the partial character string from the character string X given from the character string input unit 11, calculates the appearance frequency tf, extracts a constant number from the calculated small tf, and extracts the partial character string. Register in the management table T1. The partial character string selection unit 13 includes a partial character string cutout control unit 31, a partial character string cutout unit 32, a character string appearance frequency calculation unit 33, and a partial character string registration unit 34. The partial character string cutout control unit 31 controls which partial character string the partial character string cutout unit 32 cuts out. The partial character string cutout unit 32 cuts out the partial character string x from the character string X. The character string appearance frequency calculation unit 33 calculates the appearance frequency tf of the partial character string x in the document database 10. The partial character string registration unit 34 selects a fixed number of cut partial character strings in ascending order of the value of tf and registers them in the partial character string management table T1.
[0049]
The coincidence information collecting unit 14 calculates the weight given to the character string for each partial character string registered in the partial character string management table T1, detects the appearance location of each partial character string in the document database, and uses it as the coincidence information. The appearance location in the document, the appearance location in the input character string, the length of the character string of the partial character string, the sequence number indicating the number of matching in the document, and the weight of the character string are recorded in the match information management table T2. . The match information collection unit 14 includes a match information collection control unit 41, a character string appearance location search unit 42, a character string weight calculation unit 43, a match information registration control unit 44, and a match information registration unit 45. The coincidence information collection control unit 41 extracts the partial character strings a registered in the partial character string management table T1 one by one and gives them to the character string appearance location search unit 42 and the character string weight calculation unit 43. The character string appearance location search unit 42 sets the appearance number, the length of the partial character string a, and the sequence number representing the number of matches in the document for all the appearance locations in the document database of the given partial character string a. Ask. The character string weight calculation unit 43 calculates the weight given to the given character string a. The matching information registration control unit 44 selects the appearance location of the partial character string a one by one, the appearance location in the document, the appearance location in the input character string, the length of the partial character string a, the sequence number in the document, the partial character string A match with the weight of a is given to the matching information registration unit 45. The match information registration unit 45 registers each received set as match information in the corresponding document number list of the match information management table T2.
[0050]
The similarity calculation control unit 16 extracts a list relating to one document Y from the coincidence information management table T2 and provides the list to the similarity calculation unit 15.
[0051]
The similarity calculation unit 15 calculates the similarity between X and Y from the given list of matching information. The similarity calculation unit 15 includes a character string weight addition control unit 51 and a character string weight addition unit 52. The character string weight addition control unit 51 selects one match information from the list of match information, and if the sequence number of the match information is 1, gives the character string weight score to the character string weight adder 52. The character string weight addition unit 52 adds the given weight to the similarity Sim (X, Y) between X and Y.
[0052]
The search result output unit 12 selects and outputs a document having the highest similarity. At this time, documents having similarities of a certain value or higher, and documents from higher ranks to a certain rank may be output together.
[0053]
(Second embodiment)
An embodiment in which the text search according to the present invention is implemented by software will be described below.
[0054]
FIG. 2 shows an example of a computer system used for executing a text search. The computer system includes a display 101, a printer 102, a keyboard 103, a floppy (R) disk device 104, a CD-ROM (Compact Disk-Read Only Memory) device 105, a read-only memory (hereinafter referred to as ROM) 106, A readable / writable random access memory (RAM) 107, a magnetic disk device 108, a central processing unit (CPU) 109, a communication interface 110, and a bus 111 for connecting them. Has been. The floppy (R) disk device 104 reads and writes the floppy (R) disk 112, and the CD-ROM device 104 reads the CD-ROM 113. The computer system is connected to the communication network 114 by the communication interface 110.
[0055]
A text search program for implementing the present invention is stored in the ROM 106. Alternatively, the sentence search program may be stored in the floppy (R) disk 112, the CD-ROM 113, or the magnetic disk device 108 and transferred to the RAM 107, and then executed by the CPU 109. The CPU 109 executes a 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 given 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 (R) disk 112 and the execution result may be written to the floppy (R) disk 112.
[0056]
The document database is stored in the floppy (R) disk 112, the CD-ROM 113, or the magnetic disk 108. It may be transferred to the RAM 107 for high-speed access. When transferring to the RAM 107, it may be converted into a format that can be easily processed. In addition, a text search program, a document database, or an execution instruction may be input to the computer system via the network 114, or an execution result may be output from the computer system via the network 114. Of course.
[0057]
Further, the present invention is not limited to those shown in the figure, and it goes without saying that various modifications can be made to various embodiments such as input and output to the computer system using various recording media, input means, and output means. Yes. Of course, the recording medium, input means, and output means may be accessed via a communication network in addition to those directly accessed by the computer system.
[0058]
FIG. 3 to FIG. 7 show the processing flow of the document search program based on the character string similarity calculated by selecting n-grams to be calculated.
[0059]
FIG. 3 shows a processing flow in which a document database is searched based on a search sentence, and a document having a high similarity is selected and output.
[0060]
First, in step S11 (hereinafter abbreviated as S11), in order to prepare for efficiently calculating the number of appearances of a certain character string, all the documents included in the document database are integrated to create a suffix file. See S. Yamamoto and KW Church, Using Suffix Arrays to Compute Term Frequency and Document Frequency for All Substrings in a Corpus, In proceeding of 6 th Workshop on Very Large Corpora, Ed. Eugene Charniak, Motreal, pp 28-37, 1998.
[0061]
By using a suffix file, the number of times a character string appears in the document database can be obtained at high speed. The suffix file is implemented by rearranging character strings of parts that can occur in all documents in the order of character codes and attaching serial numbers (suffixes). The number of times a character string appears in the document database can be obtained by calculating how many character strings in the suffix file match the character string.
[0062]
Specifically, first, the minimum value min and the maximum value max of the matching character string suffix are obtained by the binary search method. If there is no matching character string, the number of appearances in the document database is zero. If min and max are obtained, the number of times tf at which the character string appears is obtained by tf = max−min + 1.
[0063]
The documents in the document database are distinguished from each other by the document number, and the document number is assigned to the partial character string registered in the suffix file. As a result, a document including a certain partial character string can be efficiently searched. Also, df can be calculated by counting the number of duplicate document numbers and subtracting that number from tf.
[0064]
In step S12, the search sentence is read into the character string X.
[0065]
In S13, the partial character string cut out from the character string X is selected based on the appearance frequency tf in the document database, and recorded in the partial character string management table as a pair with tf. The process performed in S13 will be described later with reference to FIG.
[0066]
In S14, match information is collected for each partial character string recorded in the partial character string management table and recorded in the match information management table. In the match information management table, a list of match information is recorded for each document number. The process performed in S14 will be described later with reference to FIG.
[0067]
In S15, a list of one document Y is extracted from the match information management table.
[0068]
In step S16, the similarity between X and Y is calculated from the extracted list. The process performed in S16 will be described later with reference to FIG.
[0069]
In S17, the obtained similarity and the document number are paired and registered in the document management table.
[0070]
In S18, it is determined whether the similarity is calculated for all the lists recorded in the match information management table. If the similarity is not yet calculated for all the lists, a list for which the similarity is not yet calculated is selected and extracted in S15, and the processes up to S17 are repeated. If all the lists have been calculated, the registered tables are rearranged in descending order of similarity in S19.
[0071]
In S20, a process of outputting a document having a high similarity is performed. Various modes are possible such as only one document to be output, a predetermined plural number, or all documents having a predetermined similarity or higher.
[0072]
FIG. 4 shows a flow of processing in which a partial character string is cut out from the character string X from which the search text is read, a partial character string used for collecting matching information is selected based on the appearance frequency, and recorded in the partial character string management table. .
[0073]
First, in S31, a variable num_substring representing the number of partial character strings recorded in the partial character string management table and a variable j representing the length of the partial character string to be extracted are initialized. MinNgramLength is a parameter that determines the minimum length of the partial character string to be cut out.
[0074]
In step S32, one partial character string having a length j is cut out from the character string X, and the appearance frequency tf in the document database is calculated.
[0075]
In S33, it is determined whether or not the value of tf of the extracted partial character string is 0. If tf = 0, the partial character string does not exist in the document database, so it is inappropriate to use it for collecting matching information. Therefore, the process of S34 is skipped and the process proceeds to S35. If tf ≠ 0, the process proceeds to S34.
[0076]
In S34, the extracted partial character string is recorded in the partial character string management table together with tf, and 1 is added to the value of num_substring.
[0077]
In S35, it is determined whether tf has been calculated for all partial character strings of length j cut out from X. If all the partial character strings of length j have not been calculated yet, a partial character string of length j that has not yet been calculated is selected in S32, tf is calculated, and the processing up to S34 is repeated. If all the partial character strings having the length j are calculated, 1 is added to j in S36.
[0078]
In S37, it is determined whether the value of the length j of the partial character string cut out from X is larger than the parameter MaxNgramLength that determines the maximum length of the partial character string to be cut out. If the value of j is less than or equal to MaxNgramLength, the process returns to S32, and the process up to S36 is repeated for the partial character string of length j. If the value of j is greater than MaxNgramLength, the calculation of tf has been completed for all partial character strings whose length is greater than or equal to MinNgramLength and less than or equal to MaxNgramLength. Therefore, the process proceeds to S38 and the part recorded in the partial character string management table The character strings are rearranged in ascending order of tf.
[0079]
In S39, it is determined whether or not the number num_substring of partial character strings registered in the partial character string management table is larger than the parameter SubStringLimit that determines the upper limit value of the number of partial character strings used for collecting matching information. If num_substring is larger than SubStringLimit, the process proceeds to S40, and SubStringLimit partial character strings are extracted in ascending order of tf, and these partial character strings are newly recorded in the partial character string management table. If num_substring is less than or equal to SubStringLimit, S40 is skipped and the process proceeds to S41.
[0080]
S41 is a process of returning the recorded partial character string management table.
[0081]
FIG. 5 shows a flow of processing for collecting matching information between each partial character string recorded in the partial character string management table and each document in the document database and recording the information in the matching information management table.
[0082]
First, in S51, the variable p0fit_sum is initialized to zero. The variable p0fit_sum is a variable used for speeding up the calculation effort when calculating the weight of n-grams with matching similarities, and is an offset of the similarity regarding the entire document in the document database.
[0083]
In S52, one partial character string is selected from the partial character string management table and read into a.
[0084]
In S53, p0fit, p1fit, p2fit, p3fit, and p4fit are calculated, and p0fit is added to p0fit_sum. p0fit, p1fit, p2fit, p3fit, and p4fit are documents in which a did not appear in a document, appeared once, appeared twice, appeared three times, appeared four times or more, respectively. Is the weight of a. The calculation method of p0fit, p1fit, p2fit, p3fit, and p4fit will be described later with reference to FIG.
[0085]
In S54, all the places where a appears in the document database are obtained and rearranged in the order of the places where they appear.
[0086]
In S55, the document number of the document including a is obtained for each occurrence location of a. At this time, since a is arranged in the order of appearance, the obtained document numbers are also arranged in ascending order.
[0087]
In S56, one appearance location a is selected in the order of the appearance location.
[0088]
In S57, it is determined whether or not the appearance location of the selected “a” is the foremost occurrence location in the document including it. That is, if the document at the selected appearance location is different from the document at the previous appearance location, it is the first appearance location, and if it is the same, it is the second or subsequent appearance location. If it is the first appearance place, the process proceeds to S58, where the number of occurrences dtf of a in the document is calculated, and the weight of a in the document is determined. Also, sequence_num = 1. The sequence_num is a sequence number indicating the number a of the occurrence location in the document.
[0089]
In S59, the sequence number sequence_num in the document, the occurrence location of a in the input character string X (hereinafter referred to as startX), the occurrence location of a in the document (hereinafter referred to as startdoc), the length of a (hereinafter referred to as termlength), the a A weight (hereinafter, score) is paired and recorded in the match information management table, and 1 is added to sequence_num. However, the value recorded in score is not the weight of a as it is, but the value obtained by subtracting p0fit from the weight of a. This is because, when the similarity is calculated by adding the weights of the matched n-grams, instead of adding p0fit of each substring to the similarity of the document that does not include, for each selected substring, This is a contrivance to reduce the calculation effort by adding a value obtained by subtracting p0fit from the weights of the matched n-grams and finally adding a weight offset p0fit_sum to all similarities.
[0090]
In S60, the values of sequence_num and tf are compared, and it is determined whether or not the coincidence information has been recorded for all appearance locations of a. If there is coincidence information that is not recorded, the next a appearance location is selected in S56, and the processing up to S59 is repeated. If coincidence information is recorded for all the appearance locations of a, the process proceeds to S61.
[0091]
In S61, it is determined whether or not the matching information has been collected for all the partial character strings in the partial character string management table. If there is a partial character string for which no matching information has been collected, in S52, the partial character string not yet selected is read into a, and the processing up to S60 is repeated. If the collection of matching information has been completed for all the partial character strings, the obtained matching information management table is returned in S62.
[0092]
FIG. 6 is a processing flow for obtaining the similarity between the input sentence X and the document Y by adding the weights of the matched character strings using the list extracted from the matching information management table.
[0093]
First, in S71, the similarity between X and Y (hereinafter, sim) is initialized to zero.
[0094]
In S72, one of the lists related to Y recorded in the coincidence information management table is selected and read into I.
[0095]
In S73, it is determined whether the sequence_num of the read I is 1. This is a process for not adding the score of the same partial character string redundantly to sim. If sequence_num is not 1, S74 is skipped and the process proceeds to S75. If sequence_num = 1, the score of I is added to sim in S74.
[0096]
In S75, it is determined whether or not all the matching information recorded in the matching information list regarding Y has been checked. If all the matching information is checked, the offset p0fit_sum of the weight of the entire document is added to sim in S76. If there is matching information that has not been checked yet, the matching information that has not been checked yet is selected and read into I in S72, and the processing up to S74 is repeated.
[0097]
S77 is processing for returning the obtained sim as the similarity between X and Y.
[0098]
FIG. 7 shows a calculation processing flow of p0fit, p1fit, p2fit, p3fit, and p4fit in S53 of FIG.
[0099]
First, in S81, p0fit, p1fit, p2fit, p3fit, and p4fit are all initialized to zero.
[0100]
In S82, df of the partial character string a is calculated, and in S83, idf is calculated from df and the total number N of documents in the document database. This idf is a value based on the amount of information in the field of information theory, and a method using this value as the weight of the partial character string is well known.
[0101]
In S84, a threshold value tf_threshold for determining whether or not the partial character string a is a partial character string effective for search is calculated.
[0102]
In S85, it is determined whether or not the partial character string a is valid for the search from the values of tf and df. If tf / df> tf_threshold, it is determined that the partial character string is valid for search, and the process proceeds to S86. Otherwise, it is determined that the search is not effective, S86 and S87 are skipped, and p0fit, p1fit, p2fit, p3fit and p4fit are returned in S88. That is, 0 is returned for all values of p0fit, p1fit, p2fit, p3fit, and p4fit.
[0103]
In S86, p0fit, p1fit, p2fit, p3fit, and p4fit are calculated.
[0104]
The functions MAX and MIN in S87 are functions that return the maximum value or the minimum value of the numerical value given to the argument, respectively. With this function, the values of p0fit, p1fit, p2fit, p3fit, and p4fit are within the range of LB to UB. Restricted. LB and UB are parameters that limit the distribution of p0fit, p1fit, p2fit, p3fit, and p4fit. S88 is a process of returning p0fit, p1fit, p2fit, p3fit, and p4fit.
[0105]
As can be seen from the above description, the weights p0fit, p1fit, p2fit, p3fit, and p4fit are obtained as functions of tf, df, and idf. The coefficients used in S84 and S86 are based on the theory disclosed in Christopher D. Manning and Hinrich Schutze, Foundations of Statistical Natural Language Processing, The MIT Press, Cambridge, Massachusetts, pp. 529-574, 1999. It was determined by obtaining the observation value of document data. These coefficients are not limited to the numerical values shown, but are allowed to be appropriate values according to the purpose.
[0106]
As the calculation processing flow of p0fit, p1fit, p2fit, p3fit, and p4fit in S53 of FIG. 5, the flow shown in FIG. 15 can be applied instead of the flow shown in FIG. The calculation processing flow in FIG. 15 will be described below.
[0107]
First, in S181, p0fit, p1fit, p2fit, p3fit, and p4fit are all initialized to zero.
[0108]
In S182, the df of the partial character string a and the number of documents in the document database in which the partial character string a appears twice or more (hereinafter referred to as df2) are calculated. In step S183, idf is calculated from df and the total number N of documents in the document database.
[0109]
In S184, a threshold df2_threshold for determining whether or not the partial character string a is a partial character string effective for search is set to 0.22.
[0110]
In S185, it is determined whether or not the partial character string a is valid for the search from the values of df and df2. If df2 / df> df2_threshold, it is determined that the partial character string is valid for the search, and the process proceeds to S186. Otherwise, it is determined that the search is not effective, S186 and S187 are skipped, and p0fit, p1fit, p2fit, p3fit and p4fit are returned in S188. That is, 0 is returned for all values of p0fit, p1fit, p2fit, p3fit, and p4fit.
[0111]
In S186, p0fit, p1fit, p2fit, p3fit, and p4fit are calculated.
[0112]
S187 restricts the values of p0fit, p1fit, p2fit, p3fit, and p4fit to the range of LB to UB in the same manner as S87 in FIG. LB and UB are parameters that limit the distribution of p0fit, p1fit, p2fit, p3fit, and p4fit. S188 is processing for returning p0fit, p1fit, p2fit, p3fit, and p4fit.
[0113]
As can be seen from the above description, in the calculation processing flow of FIG. 15, df2 is used instead of tf in the calculation processing flow of FIG. 7 described above as a criterion for determining whether the partial character string a is valid for the search. ing. df2 / df represents the degree of appearance of a partial character string, that is, the degree to which a certain partial character string appears only in a specific document. By using this information, the partial character string is selected. To improve search accuracy.
[0114]
The threshold value df2_threshold in S183 and the coefficient used in S186 are not limited to the numerical values shown, but can be set to appropriate values according to the purpose.
[0115]
FIG. 8 shows a configuration diagram of the matching information management table. The match information management table is configured by a list of match information for each document number. In FIG. 8, match information 1 and match information 5 are recorded in document number 0002, match information 2 is recorded in document number 0100, match information 3 and match information 6 are recorded, and match information 4 and match information 7 are recorded in document number 0111 as a list. ing. Each match information includes the sequence number sequence_num in the document of the partial character string, the occurrence location of the partial character string in the input character string X (startX), the occurrence location of the partial character string in the document (startdoc), and the partial character string The length (termlength) and the weight (score) attached to the partial character string are stored.
[0116]
When the matching information 8 related to the document number 0002 is newly obtained, as shown in FIG. 8, the pointer pointing to the head of the list that has been pointing to the matching information 5 so far points to the matching information 8. A pointer to 5 is set, and the match information 8 is recorded at the top of the list of the document number 0002.
[0117]
(Third embodiment)
Next, FIG. 9 shows an embodiment of a document search apparatus that searches for a document having the highest similarity with the input character string based on the n-gram DP similarity. The document search apparatus includes a document database 10, a character string input unit 11, a partial character string selection unit 13 (internal illustration is omitted), a matching information collection unit 14 (internal illustration is omitted), a similarity calculation unit 17, and a similarity The degree calculation control unit 18, the recursive execution control unit 19, and the search result output unit 12 are configured.
[0118]
The document database 10, the character string input unit 11, the partial character string selection unit 13, the matching information collection unit 14, and the search result output unit 12 have the same functions and configurations as the parts denoted by the same reference numerals in the first embodiment. Omitted.
[0119]
The similarity calculation control unit 18 takes out a list related to a certain document Y from the coincidence information management table T2, and provides the similarity calculation unit 17 together with the character strings X and Y.
[0120]
The similarity calculation unit 17 calculates the similarity between X and Y based on the formula (1) or the formula (2) from the given list of matching information. In the middle of calculating the similarity, it is necessary to similarly determine the similarity for a part of character strings. This is implemented by repeatedly using the similarity calculation unit 17 by the recursive execution control unit 19. The similarity calculation unit 17 includes a matched character string similarity calculation unit 61, an arbitrary character string similarity calculation unit 62, and a maximum value selection unit 63. The matched character string similarity calculation unit 61 calculates SimDPs (α, β) in Expression (3). The arbitrary character string similarity calculation unit 62 calculates SimDPg (α, β) in equation (5). The maximum value selection unit 63 calculates SimDP (α, β) in Expression (2) by performing the function MAX on these. When both the character strings α and β received by the similarity calculation unit 17 are empty characters, the recursive execution control unit 19 sets SimDP (α, β) = 0.0. At this time, the matched character string similarity calculation unit 61, the arbitrary character string similarity calculation unit 62, and the maximum value selection unit 63 are not operated. Needless to say, this value of SimDP (α, β) = 0.0 implements the equation (1).
[0121]
The matched character string similarity calculation unit 61 is implemented by a character string separation control unit 71, a character string separation unit 72, a similarity calculation unit 73, an addition unit 74, and a maximum value selection unit 75, and SimDPs of Expression (3) (α, β) is calculated. SimDPs (α, β) is calculated only when the leading character string in which α and β match is the character string recorded in the match information management table T2.
[0122]
First, in the character strings α (= ξγ) and β (= ξδ) received by the matching character string similarity calculation unit 61, the character string separation control unit 71 does not have a matching character string ξ, that is, a matching character. When the column ξ is an empty character string, SimDPs (α, β) = 0.0 is set according to Equation (1).
[0123]
Next, in the character strings α (= ξγ) and β (= ξδ) received by the matching character string similarity calculation unit 61, the character string separation control unit 71 determines that all the ξ , The character string separation unit 72, the similarity calculation unit 73, and the addition unit 74 are operated to calculate Score (ξ) + SimDP (γ, δ) included in Equation (3). Then, the maximum value is selected by the maximum value selection unit 75. As a result, SimDP shown in Equation (3) s (α, β) is obtained.
[0124]
The character string separating unit 72 separates the character string α into ξ and γ and the character string β into ξ and δ, and then gives the weight Score (ξ) of ξ to the adding unit 74 with reference to the matching information management table T2. γ and δ are given to the similarity calculation unit 73. The similarity calculation unit 73 calculates SimDP (γ, δ) in Expression (3). The similarity calculation unit 73 is actually implemented by applying the similarity calculation unit 16 to γ and δ by the recursive execution control unit 17. The adding unit 74 performs addition of Expression (3).
[0125]
The arbitrary character string similarity calculation unit 62 is implemented by the similarity calculation units 81 to 83 and the maximum value selection unit 84, and calculates SimDPg (α, β) in Expression (2). The arbitrary character string similarity calculation unit 62 is executed when the leading character strings are different or when the leading character strings match but are not registered in the matching information management table. Corresponding to each case regarding the presence or absence of the first character ζ, η of the received character strings α (= ζγ), β (= ηδ), the similarity calculation units 81, 82, 83 respectively Find SimDP (α, δ), SimDP (γ, β), SimDP (γ, δ). The similarity calculation units 81 to 83 are actually implemented by applying the similarity calculation unit 17 to each of α and δ, γ and β, and γ and δ by the recursive execution control unit 19. . The maximum value selection unit 84 performs the function MAX of Expression (5).
[0126]
(Fourth embodiment)
A processing flow for obtaining the n-gram DP similarity between the character string X and the character string Y by software is shown in FIGS. This process can be used instead of the process described in FIG. 6 as the internal process of S16 of FIG. In execution, the computer system shown in the second embodiment is used.
[0127]
First, in S91, in each of X and Y, among the first character and last character of the partial character string recorded in the list, the position of the first character in the forefront, minX, minY, and the position of the last character in the last maxX and maxY are obtained, an array X_index of length maxX-minX + 1 and an array Y_index of length maxY-minY + 1 are prepared, and all elements are initialized to -1. These arrays correspond to each character from X minX to maxX and each character from Y minY to maxY.
[0128]
In the processing from S92 to S94, the array X_index corresponding to the character corresponding to the first character or the last character of each partial character string recorded in the list, with each character from minX to maxX in X and each character from minY to maxY in Y. , 0 is assigned to the Y_index element.
[0129]
In the processing from S95 to S99, serial numbers 0, 1, 2,..., X_index_num-1 are assigned in order from the front to i where X_index [i] = 0, and the numbers are substituted into X_index [i]. Therefore, X_index_num is the number of i for which X_index [i] ≠ −1.
[0130]
In S100 to S104, the same processing is performed on Y_index. A serial number such as 0, 1, 2,..., Y_index_num-1 is assigned to j where Y_index [j] = 0 in order from the front, and the number is substituted into Y_index [j]. Therefore, Y_index_num is the number of j where Y_index [j] ≠ −1.
[0131]
In S105, the matching information of X and Y recorded in the list is first rearranged in the order in which the partial character strings in X appear. Next, in the order in which the partial character strings appear in X, they are rearranged in the order in which the partial character strings appear in Y, and the number of matching information is read into m.
[0132]
Next, as a preparation for efficiently obtaining the similarity by DP, a score table scoretable of (X_index_num + 2) rows (Y_index_num + 2) columns is created, and all elements of the table are initialized to zero. In this table, the vertical direction is the character corresponding to the first character or the last character of the partial character string recorded in the list in the character string X, and the horizontal direction is the partial character recorded in the list in the character string Y. Corresponds to the first or last character in the column.
[0133]
In S106, k and i are initialized to k = 1 and i = 0.
[0134]
In S107, j is initialized to j = 0. The variable k indicates that attention is currently focused on the k-th matching information from the beginning, and i and j are the first character or the last character of the partial character string recorded in the list in X and Y, respectively. , A variable that indicates which character is focused on. In S108, scoretable [i] [j] is assigned to currentscore as the current score.
[0135]
Here, for convenience of explanation, the kth matching information from the top of the list is represented as startX (k), startdoc (k), termlength (k), and score (k), respectively.
[0136]
In S109, it is determined whether or not the location indicated by i and j matches the location where the partial character string of the kth matching information from the front appears. If they match, the process proceeds to S110, and if they do not match, the process proceeds to S114.
[0137]
In S110, a line number and a column number corresponding to the final character of the matched partial character string are obtained in the score table, and are substituted into target_i and target_j, respectively.
[0138]
In S111, in scoretable [target_i] [target_j], the score obtained at the current stage is compared with the score obtained by adding the weight score (k) of the substring matching currentscore. If currentscore + score (k) is larger than target_i] [target_j], currentscore + score (k) is substituted into scoretable [target_i] [target_j] in S112. Otherwise, skip S112 and go to S113.
[0139]
In S113, 1 is added to the value of k, and attention is paid to the next matching information in the list, and the process returns to S109. In S109, if i and j are also used as the next match information, the process up to S113 is repeated, and if not, the process proceeds to S114.
[0140]
In the processing from S114 to S119, the current score currentscore is compared with the right, lower, and lower right scores of the score table, and if the currentscore is larger, the currentscore is substituted.
[0141]
In S120, it is determined whether j has reached the right end of the score table. If it has not come to the right end, 1 is added to j in S121, the process returns to S108, and the processes up to S119 are repeated. If it has come to the right end, it will progress to S122.
[0142]
In S122, it is determined whether i has reached the lower end of the score table. If it has not come to the lower end, 1 is added to i in S123, the process returns to S107, and the processes up to S120 are repeated. If it has reached the lower end, the process proceeds to S124, and scoretable [X_index_num + 1] [Y_index_num + 1] is returned as the similarity between X and Y.
[0143]
【The invention's effect】
According to the first aspect of the present invention, the character string that is effective in calculating the similarity to the document in the document database is selected from the partial character strings cut out from the input character string to obtain the similarity. be able to. That is, the similarity can be obtained by limiting to character strings that are highly effective for searching.
[0144]
According to the second aspect of the present invention, it is possible to obtain the similarity by paying attention to the partial character strings that match the order in each of the two character strings. That is, the similarity considering the appearance order of the character strings is obtained.
[0145]
According to the third aspect of the present invention, it is possible to obtain the similarity by sorting the character strings in descending order of the effect on the similarity calculation. As a result, the determined similarity becomes a more appropriate value.
[0146]
According to the fourth aspect of the present invention, not only a method of adding weights of matched partial character strings but also other similarity calculation methods can be combined. This further improves the search accuracy.
[0147]
According to the fifth aspect of the present invention, a character string that is effective in calculating similarity to a document in the document database is selected from the partial character strings cut out from the input character string, and the search is effective. It is possible to realize an apparatus that obtains similarity by limiting to a high character string.
[0148]
According to the sixth aspect of the present invention, it is possible to realize an apparatus that finds the degree of similarity that matches the order in each of the two character strings and that considers the appearance order of the character strings by paying attention to the common partial character strings.
[0149]
According to the seventh aspect of the present invention, a character string that has an effect on the similarity calculation with the document in the document database is selected from the partial character strings cut out from the input character string, and the character that is highly effective for the search. It is possible to provide a program for obtaining the similarity only for the columns.
[0150]
According to the eighth aspect of the invention, it is possible to provide a program that finds the degree of similarity that matches the order in each of the two character strings and that considers the appearance order of the character strings by paying attention to the common partial character strings.
[0151]
According to the ninth aspect of the present invention, the effects described above can be realized on various computers.
[0152]
Next, the search performance regarding the first and second embodiments will be described. An evaluation experiment was conducted to confirm the effect of selecting a partial character string cut out from the input character string and the effect of using tf instead of df as a selection criterion for the partial character string.
[0153]
FIG. 12 shows the relationship between the number of selected partial character strings and search accuracy when tf and df are used as selection criteria, and FIG. 13 shows the relationship between the number of selected partial character strings and search time. A value called 11pt average accuracy was used for the search accuracy. The 11 pt average accuracy is an evaluation index obtained by assigning 1 to 11 points in 0.1 increments to the recall (0 to 1) and averaging each value. For details, see G Salton and M. J MacGill, Introduction to Modern Information Retrieval, p174-181, MacGraw-Hill Book Co., New York, 1983.
[0154]
The length of the partial character string cut out from the input character string is 2, that is, only bigram. Also, the parameters LB and UB used in S87 of FIG. 7 are set to LB = 0 and UB = idf, respectively. The used document data is representative similar information search test data called NTCIR1 test collection, which includes about 300,000 documents and 53 search sentences.
[0155]
12 and 13, the horizontal axis indicates the number of selected partial character strings, that is, the value of SubStringLimit, the vertical axis in FIG. 12 indicates search accuracy, and the vertical axis in FIG. 13 searches for 53 search sentences. It shows the time taken to do.
[0156]
Referring to FIG. 12, it can be confirmed that the search accuracy is improved by increasing the SubStringLimit when the value of SubStringLimit is small for both tf and df, but the search accuracy is improved even if the value of SubStringLimit is increased to a certain extent. It can be confirmed that there is not much change. For this reason, if SubStringLimit is set to an appropriate value, it is possible to suppress a decrease in search accuracy even if partial character strings are selected. In addition, when tf and df are compared, it can be confirmed that the search accuracy based on the selection based on df is higher, but if the value of SubStringLimit increases to some extent, even when the selection is performed based on tf, It can be confirmed that it has almost the same search accuracy.
[0157]
Referring to FIG. 13, both tf and df, the search time is shortened as the value of SubStringLimit decreases, and the effect of speeding up by selecting partial character strings can be confirmed. Further, when tf and df are compared, it can be confirmed that the search time using tf is shorter, and that the difference becomes larger as the value of SubStringLimit is smaller. If the value of SubStringLimit is set to a value indicating high search accuracy for both tf and df, SubStringLimit = 22, the search time at that time is 264.6 seconds for tf and 367.1 seconds for df. The tf is about 1.4 times faster. Thus, the search time can be improved by the present invention.
[0158]
Next, search performance when the methods according to the third and fourth embodiments are applied to the calculation of the similarity in S16 of FIG. 3 will be described. The search accuracy is compared between the case of using the addition method of FIG. 6 and the method of DP of FIGS. 10 and 11 as the similarity calculation method, and the results are shown in FIG. The search accuracy was 11 pt average accuracy. The length of the partial character string cut out from the input character string is 2, that is, only bigram, and the parameters LB and UB used in S87 of FIG. 7 are LB = 0 and UB = idf, respectively. The document data used is the NTCIR1 test collection.
[0159]
The horizontal axis of FIG. 14 indicates the number of selected partial character strings, that is, the value of SubStringLimit, and the vertical axis indicates the search accuracy. As shown in FIG. 14, when SubStringLimit is 15 or less, there is no big difference in search accuracy. However, when it exceeds 15, the method using DP is more accurate than the method using addition. I can confirm. Further, when the search time was measured, it was confirmed that the DP method requires approximately twice as much search time as the addition method, and is several tens of times faster than the existing DP method.
[0160]
Thus, according to the present invention, by applying the DP to the collected match information, the search accuracy can be improved as compared with the addition method, and the similarity can be calculated at a higher speed than the existing DP method. it can.
[Brief description of the drawings]
FIG. 1 is a diagram showing an embodiment of a document search apparatus according to the present invention.
FIG. 2 is a diagram showing an embodiment of a computer system for performing a text search according to the present invention.
FIG. 3 is a flowchart of a text search process according to an embodiment of the present invention.
FIG. 4 is a flowchart of processing for selecting a partial character string cut out from a character string.
FIG. 5 is a flowchart of a process for collecting and recording coincidence information.
FIG. 6 is a flowchart of processing for obtaining similarity by addition from coincidence information.
FIG. 7 is a flowchart of processing for obtaining a weight of a partial character string.
FIG. 8 is a configuration diagram of a matching information management table.
FIG. 9 is a diagram showing another embodiment of the document search apparatus according to the present invention.
FIG. 10 is a flowchart of the first half of processing for obtaining n-gram DP similarity from coincidence information.
FIG. 11 is a flowchart of the latter half of the process of obtaining n-gram DP similarity from coincidence information.
FIG. 12 is a diagram showing the relationship between the number of selected partial character strings and search accuracy when tf and df are used as selection criteria.
FIG. 13 is a diagram showing the relationship between the number of selected partial character strings and search time when tf and df are used as selection criteria.
FIG. 14 is a diagram showing a comparison of search accuracy between a similarity calculation method using DP and a similarity calculation method by addition in the present invention.
FIG. 15 is a flowchart of another process for obtaining the weight of a partial character string.
[Explanation of symbols]
10: Document database
10a, 10b, 10c: Document
11: Character string input part
12: Search result output part
13: Partial character string selector
14: Matching information collection unit
15, 17, 73, 81, 82, 83: similarity calculation unit
16, 18: Similarity calculation control unit
19: Recursive execution control unit
31: Partial character string segmentation control unit
32: Partial character string cutout part
33: Character string appearance frequency calculation unit
34: Partial character string registration part
41: Matching information collection control unit
42: Character string appearance location search part
43: Character string weight calculation unit
44: Matching information registration control unit
45: Match information registration section
51: Character string weight addition control unit
52: Character string weight addition unit
61: Matched character string similarity calculation unit
62: Arbitrary character string similarity calculation unit
63, 75, 84: Maximum value selection section
71: Character string separation control unit
72: Character string separator
74: Adder
101: Display
102: Printer
103: Keyboard
104: floppy (R) disk device
105: CD-ROM device
106: Read-only memory (ROM)
107: Random access memory (RAM)
108: Magnetic disk device
109: Central processing unit (CPU)
110: Communication interface
111: Bus
112: Floppy (R) disk
113: CD-ROM
114: Communication network

Claims (9)

入力文字列と文書データベースに含まれる文書中の文字列との間の類似度を算出する文字列類似度算出装置であって、
前記文書データベースは、少なくとも1つの文書を含み、
前記入力文字列から所定長さの部分文字列を順次切り出す切り出し手段と、
順次切り出された前記部分文字列の各々について、前記文書データベースにおける出現頻度を算出する出現頻度算出手段と、
前記部分文字列の各々についての前記出現頻度に基づいて、順次切り出された前記部分文字列の前記出現頻度が相対的に小さいもののうち所定数の部分文字列を選別文字列群として選別する選別手段と、
前記選別文字列群に含まれる部分文字列の各々について、前記文書データベースに含まれる前記文書中の出現場所を探索し、前記選別文字列群に含まれる各部分文字列の各文書における出現頻度を出力する探索手段と、
前記選別文字列群に含まれる部分文字列の各々について、文書における出現頻度の値に対応付けて予め規定された複数の関数のうち各部分文字列の各文書における出現頻度に対応する1つの関数を用いて当該文書における重みを算出する重み算出手段と、
前記文書データベースに含まれる前記文書について、当該文書に出現する前記選別文字列群に含まれる部分文字列の各々に対応付けられた前記重みを加算することで類似度を算出する類似度算出手段とを備える、文字列類似度算出装置。
A character string similarity calculation device for calculating a similarity between an input character string and a character string in a document included in a document database,
The document database includes at least one document;
Cutting means for sequentially cutting out a partial character string of a predetermined length from the input character string;
Appearance frequency calculating means for calculating the appearance frequency in the document database for each of the partial character strings cut out sequentially,
Wherein based on the appearance frequency for each of the partial character string, sequentially cut out the partial character string selection means for said frequency is selected a predetermined number of partial strings of the relatively small as sorting character strings of When,
For each partial character string included in the selected character string group, the appearance location in the document included in the document database is searched, and the appearance frequency of each partial character string included in the selected character string group in each document is determined. Search means to output ;
For each partial character string included in the selected character string group, one function corresponding to the appearance frequency of each partial character string in each document among a plurality of functions defined in advance in association with the value of the appearance frequency in the document A weight calculating means for calculating a weight in the document using
Similarity calculation means for calculating the similarity by adding the weights associated with each of the partial character strings included in the selected character string group appearing in the document for the document included in the document database; A character string similarity calculation device.
前記重み算出手段は、前記選別文字列群に含まれる部分文字列の各々について、各部分文字列を少なくとも1つ含む文書の数に対する、当該部分文字列を2つ以上含む文書の数の比が、所定しきい値を超えるか否かを判断し、この比が所定しきい値以下である場合に当該部分文字列の重みをゼロに設定する、請求項に記載の文字列類似度算出装置。The weight calculation means has a ratio of the number of documents including two or more partial character strings to the number of documents including at least one partial character string for each of the partial character strings included in the selected character string group. , it is determined whether more than a predetermined threshold value, the weight of the partial character string is set to zero if the ratio is less than a predetermined threshold value, the string similarity calculating apparatus according to claim 1 . 前記重み算出手段は、前記選別文字列群に含まれる部分文字列の各々について、各部分文字列を少なくとも1つ含む文書の数に対する、当該部分文字列の前記文書データベースにおける出現頻度の比が、所定しきい値を超えるか否かを判断し、この比が所定しきい値以下である場合に当該部分文字列の重みをゼロに設定する、請求項に記載の文字列類似度算出装置。The weight calculation means, for each of the partial character strings included in the selected character string group, the ratio of the appearance frequency of the partial character string in the document database with respect to the number of documents including at least one partial character string, determining whether more than a predetermined threshold value, the weight of the partial character string is set to zero if the ratio is less than a predetermined threshold value, the string similarity calculating apparatus according to claim 1. 前記所定しきい値は、対応の部分文字列を少なくとも1つ含む文書の数と前記文書データベースに含まれる文書の総数とに基づいて算出される、請求項に記載の文字列類似度算出装置。4. The character string similarity calculation device according to claim 3 , wherein the predetermined threshold value is calculated based on the number of documents including at least one corresponding partial character string and the total number of documents included in the document database. . 前記予め規定された複数の関数の各々は、情報量を背景とする値idfを含む関数であり、
情報量を背景とする値idfは、以下の式で表され、
idf=log (N/df)
但し、Nは前記文書データベースに含まれる文書数であり、dfは前記文書データベースに含まれる文書のうち対応の部分文字列を含む文書数である、請求項1〜のいずれか1項に記載の文字列類似度算出装置。
Each of the plurality of predefined functions is a function including a value idf with an information amount as a background,
The value idf with the amount of information in the background is represented by the following equation:
idf = log 2 (N / df)
However, N is the number of documents included in the document database, df is the number of documents that contain the substring corresponding among the documents included in the document database, according to any one of claims 1-4 Character string similarity calculation device.
前記文書データベースに含まれる文書のうち、算出された前記類似度が相対的に高い文書を選択して出力する結果出力部をさらに備える、請求項1〜のいずれか1項に記載の文字列類似度算出装置。Wherein among the documents included in the document database, the result the degree of similarity calculated selects and outputs a relatively high document further comprising an output unit, a character string according to any one of claims 1 to 5 Similarity calculation device. コンピュータを、入力文字列と文書データベースに含まれる文書中の文字列との間の類似度を算出する文字列類似度算出装置として機能させる文字列類似度算出プログラムであって、
前記文書データベースは、少なくとも1つの文書を含み、
前記プログラムは、コンピュータを、
前記入力文字列から所定長さの部分文字列を順次切り出す切り出し手段と、
順次切り出された前記部分文字列の各々について、前記文書データベースにおける出現頻度を算出する出現頻度算出手段と、
前記部分文字列の各々についての前記出現頻度に基づいて、順次切り出された前記部分文字列の前記出現頻度が相対的に小さいもののうち所定数の部分文字列を選別文字列群として選別する選別手段と、
前記選別文字列群に含まれる部分文字列の各々について、前記文書データベースに含まれる前記文書中の出現場所を探索し、前記選別文字列群に含まれる各部分文字列の各文書における出現頻度を出力する探索手段と、
前記選別文字列群に含まれる部分文字列の各々について、文書における出現頻度の値に対応付けて予め規定された複数の関数のうち各部分文字列の各文書における出現頻度に対応する1つの関数を用いて当該文書における重みを算出する重み算出手段と、
前記文書データベースに含まれる前記文書について、当該文書に出現する前記選別文字列群に含まれる部分文字列の各々に対応付けられた前記重みを加算することで類似度を算出する類似度算出手段として機能させる、文字列類似度算出プログラム。
A character string similarity calculation program that causes a computer to function as a character string similarity calculation device that calculates a similarity between an input character string and a character string in a document included in a document database,
The document database includes at least one document;
The program is a computer,
Cutting means for sequentially cutting out a partial character string of a predetermined length from the input character string;
Appearance frequency calculating means for calculating the appearance frequency in the document database for each of the partial character strings cut out sequentially,
Wherein based on the appearance frequency for each of the partial character string, sequentially cut out the partial character string selection means for said frequency is selected a predetermined number of partial strings of the relatively small as sorting character strings of When,
For each partial character string included in the selected character string group, the appearance location in the document included in the document database is searched, and the appearance frequency of each partial character string included in the selected character string group in each document is determined. Search means to output ;
For each partial character string included in the selected character string group, one function corresponding to the appearance frequency of each partial character string in each document among a plurality of functions defined in advance in association with the value of the appearance frequency in the document A weight calculating means for calculating a weight in the document using
As a similarity calculation means for calculating the similarity by adding the weights associated with each of the partial character strings included in the selected character string group appearing in the document for the document included in the document database. A character string similarity calculation program that functions.
請求項に記載の文字列類似度算出プログラムを記録したコンピュータ読み取り可能な記録媒体。A computer-readable recording medium on which the character string similarity calculation program according to claim 7 is recorded. 処理装置を含むコンピュータを用いて、入力文字列と文書データベースに含まれる文書中の文字列との間の類似度を算出する文字列類似度算出方法であって、
前記文書データベースは、少なくとも1つの文書を含み、
前記文字列類似度算出方法は、
前記処理装置が、前記入力文字列から所定長さの部分文字列を順次切り出すステップと、
前記処理装置が、順次切り出された前記部分文字列の各々について、前記文書データベースにおける出現頻度を算出するステップと、
前記処理装置が、前記部分文字列の各々についての前記出現頻度に基づいて、順次切り出された前記部分文字列の前記出現頻度が相対的に小さいもののうち所定数の部分文字列を選別文字列群として選別するステップと、
前記処理装置が、前記選別文字列群に含まれる部分文字列の各々について、前記文書データベースに含まれる前記文書中の出現場所を探索し、前記選別文字列群に含まれる各部分文字列の各文書における出現頻度を出力するステップと、
前記処理装置が、前記選別文字列群に含まれる部分文字列の各々について、文書における出現頻度の値に対応付けて予め規定された複数の関数のうち各部分文字列の各文書における出現頻度に対応する1つの関数を用いて当該文書における重みを算出するステップと、
前記文書データベースに含まれる前記文書について、当該文書に出現する前記選別文字列群に含まれる部分文字列の各々に対応付けられた前記重みを加算することで類似度を算出するステップとを備える、文字列類似度算出方法。
A character string similarity calculation method for calculating a similarity between an input character string and a character string in a document included in a document database using a computer including a processing device,
The document database includes at least one document;
The character string similarity calculation method is:
The processor sequentially cuts out a partial character string of a predetermined length from the input character string;
The processing device calculates the appearance frequency in the document database for each of the partial character strings sequentially cut out;
The processing device selects a predetermined number of partial character strings out of the partial character strings that are sequentially cut out based on the appearance frequency for each of the partial character strings, the partial character strings having a relatively low appearance frequency. As a step to sort as
For each partial character string included in the selected character string group, the processing device searches for an appearance location in the document included in the document database, and each of the partial character strings included in the selected character string group. Outputting the appearance frequency in the document;
For each partial character string included in the selected character string group, the processing device sets an appearance frequency of each partial character string in each document among a plurality of functions defined in advance in association with an appearance frequency value in the document. Calculating weights in the document using one corresponding function ;
Calculating the similarity by adding the weight associated with each of the partial character strings included in the selected character string group appearing in the document for the document included in the document database. String similarity calculation method.
JP2002012259A 2001-01-24 2002-01-22 Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method Expired - Lifetime JP4065695B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2002012259A JP4065695B2 (en) 2001-01-24 2002-01-22 Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method
CN 02159822 CN1230770C (en) 2002-01-22 2002-12-27 Method, device, program, and recording medium for chararacter similarity calculation

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2001-16204 2001-01-24
JP2001016204 2001-01-24
JP2002012259A JP4065695B2 (en) 2001-01-24 2002-01-22 Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method

Publications (2)

Publication Number Publication Date
JP2002297660A JP2002297660A (en) 2002-10-11
JP4065695B2 true JP4065695B2 (en) 2008-03-26

Family

ID=26608242

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002012259A Expired - Lifetime JP4065695B2 (en) 2001-01-24 2002-01-22 Character string similarity calculation device, character string similarity calculation program, computer-readable recording medium recording the same, and character string similarity calculation method

Country Status (1)

Country Link
JP (1) JP4065695B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4486324B2 (en) * 2003-06-19 2010-06-23 ヤフー株式会社 Similar word search device, method, program, and information search system
JP4114600B2 (en) 2003-12-02 2008-07-09 日本電気株式会社 Variable length character string search device, variable length character string search method and program
JP4990023B2 (en) * 2007-05-15 2012-08-01 株式会社ジャストシステム SEARCH METHOD, SEARCH PROGRAM, AND SEARCH DEVICE
JP5056337B2 (en) * 2007-10-17 2012-10-24 三菱電機株式会社 Information retrieval system
CN102982292B (en) * 2012-11-05 2015-11-25 北京奇虎科技有限公司 Obtain method and apparatus and the system of trusted file digital signature
CN103678655B (en) * 2013-12-23 2017-02-08 国网浙江省电力公司 Method and device for verifying information
JP5930228B2 (en) 2014-02-25 2016-06-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Information processing apparatus, method, and program
US9747273B2 (en) 2014-08-19 2017-08-29 International Business Machines Corporation String comparison results for character strings using frequency data
US11151325B2 (en) * 2019-03-22 2021-10-19 Servicenow, Inc. Determining semantic similarity of texts based on sub-sections thereof

Also Published As

Publication number Publication date
JP2002297660A (en) 2002-10-11

Similar Documents

Publication Publication Date Title
CN100535892C (en) Method and system for retrieving information based on meaningful core word
US7302426B2 (en) Expanding a partially-correct list of category elements using an indexed document collection
US7558792B2 (en) Automatic extraction of human-readable lists from structured documents
US7529731B2 (en) Automatic discovery of classification related to a category using an indexed document collection
US7519590B2 (en) Method and system for performing phrase/word clustering and cluster merging
US9483472B2 (en) System and method for processing formatted text documents in a database
US6496820B1 (en) Method and search method for structured documents
US20020123994A1 (en) System for fulfilling an information need using extended matching techniques
JP5010885B2 (en) Document search apparatus, document search method, and document search program
CN111858912A (en) Abstract generation method based on single long text
Sabuna et al. Summarizing Indonesian text automatically by using sentence scoring and decision tree
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
EP2674874A1 (en) Search program, search apparatus, and search method
JP2000200281A (en) Device and method for information retrieval and recording medium where information retrieval program is recorded
JP2006227823A (en) Information processor and its control method
KR20020089677A (en) Method for classifying a document automatically and system for the performing the same
JP3249743B2 (en) Document search system
JP2005326952A (en) Method and device for word registration in concept dictionary, and program
JP2004013726A (en) Device for extracting keyword and device for retrieving information
JP3663878B2 (en) Unknown word concept estimation apparatus and computer-readable recording medium recording unknown word concept estimation processing program
JP2009271796A (en) Noise removal system for document data
Mase et al. Two-Stage Patent Retrieval Method Considering Claim Structure.
JP2001067378A (en) Calculation method and device for similarity of character string and recording medium
JP4206266B2 (en) Full-text search device, processing method, processing program, and recording medium
JP7428035B2 (en) Data retrieval device, data retrieval method and program

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20021010

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041005

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20060227

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060522

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060522

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070515

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070717

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20070717

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20070717

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070911

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071108

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071218

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080107

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4065695

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140111

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term