JP5207721B2 - Inverted index creation device and forward index creation device - Google Patents
Inverted index creation device and forward index creation device Download PDFInfo
- Publication number
- JP5207721B2 JP5207721B2 JP2007316916A JP2007316916A JP5207721B2 JP 5207721 B2 JP5207721 B2 JP 5207721B2 JP 2007316916 A JP2007316916 A JP 2007316916A JP 2007316916 A JP2007316916 A JP 2007316916A JP 5207721 B2 JP5207721 B2 JP 5207721B2
- Authority
- JP
- Japan
- Prior art keywords
- index
- partial
- document
- inverted
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、巨大な文書集合を対象に文書の全文検索を行なうための検索インデックス作成方法に関し、特に巨大な文書集合を対象にして転置インデックス及びフォワードインデックスを作成する装置に関する。 The present invention relates to a search index creation method for performing a full-text search of a document for a large document set, and more particularly to an apparatus for creating a transposed index and a forward index for a large document set.
現代社会では、膨大な量の電子文書が日々作成され、その量はますます増え続けている。オフィスでは文書作成やプレゼンテーションに電子文書は不可欠であり、インターネットの拡大も、爆発的な数の電子文書が生み出される要因となっている。電子文書の量の増大とともに、多数の膨大な文書から必要な情報が記された文書を、短時間で検索し出力できる文書検索技術が必須となっており、技術開発も進んでいる。 In today's society, an enormous amount of electronic documents are created every day, and the amount continues to increase. In offices, electronic documents are indispensable for document creation and presentation, and the expansion of the Internet is a factor in generating an explosive number of electronic documents. Along with the increase in the amount of electronic documents, a document retrieval technique capable of retrieving and outputting a document in which necessary information is recorded from a large number of enormous documents in a short time is indispensable, and technological development is progressing.
文書検索の典型的なスタイルは、与えられた文書集合から、指定された単語を含む文書を、極力短時間で出力するというものである。この目的のために、転置インデックスと呼ばれるデータ構造が使用される。図1は、検索対象となる文書集合101と、それに基づき構築される転置インデックス102の概略図である。ある単語103が出現する全文書の文書識別番号105からなるリストを、転置リスト106と呼ぶ。
A typical style of document retrieval is to output a document including a specified word from a given document set in as short a time as possible. For this purpose, a data structure called an inverted index is used. FIG. 1 is a schematic diagram of a document set 101 to be searched and a transposed
英語、フランス語、スペイン語のような単語がスペースで区切られている言語と異なり、日本語、韓国語や中国語では、文書を正確に単語に分割することが困難である。そこでn-gramと呼ばれる、連続するn文字からなる、文書中の任意の部分文字列を単語の代わりに用いて転置インデックスを構築する場合があり、実用上有用であることが知られている(情報検索アルゴリズム、北研二他著、共立出版)。nは、主に1〜10の整数である。本明細書では転置インデックスの作成に使用する、単語あるいは、長さnの部分文字列を、索引語と表記する。 Unlike languages in which words such as English, French and Spanish are separated by spaces, it is difficult to accurately divide a document into words in Japanese, Korean and Chinese. Therefore, there are cases where an inverted index is constructed using an arbitrary partial character string in a document consisting of n consecutive characters called n-gram instead of a word, and it is known that it is practically useful ( Information retrieval algorithm, Kenji Kita et al., Kyoritsu Publishing). n is an integer of 1 to 10 mainly. In this specification, a word or a partial character string of length n used for creating an inverted index is referred to as an index word.
文書検索では、転置インデックスのほかに図2に示すフォワードインデックス201と呼ばれるデータ構造が使用される場合がある。フォワードインデックス201は、検索対象文書集合101中の各文書104に対し、その文書が含む索引語103の索引語識別番号202のリストを格納したものである。ここで言う索引語識別番号202とは、同一の索引語に対しては同じ番号であり、異なる索引語に対しては異なるように与えられる番号である。フォワードインデックス201は、転置インデックス102作成に用いる中間データとして使用されるほか、類似文書を探索する連想検索と呼ばれる技術(安田、今一、岩山、丹羽、情報処理学会第69回全国大会、3D-1、2007)で使用されるデータ構造である。
In document retrieval, a data structure called a
検索対象となる文書データ量が爆発的に拡大してゆく一方で、検索システムを構築するための計算機リソースには限りがある。特に、計算機のメモリ(主記憶装置)は高速なランダムアクセスが可能であり、インデックス構築時に既知の索引語の一覧及び各索引語の伸張可能なリストを保持する作業領域として必須であるが、大容量のメモリはコストが高い。したがって、少ないメモリで巨大なインデックスを構築する技術が必要である。 While the amount of document data to be searched increases explosively, computer resources for constructing a search system are limited. In particular, the computer's memory (main storage device) is capable of high-speed random access, and is essential as a work area for holding a list of known index words and an expandable list of each index word when building an index. Capacity memory is expensive. Therefore, a technique for building a huge index with a small amount of memory is required.
メモリの容量を上回る巨大な転置インデックスを構築する技術として、ソートを用いる方法(非特許文献1)と、索引語の辞書順に転置リストを記録した部分転置インデックスを用いる方法(非特許文献2)が知られている。非特許文献1の技術では検索対象文書を逐次読み、索引語識別番号、文書識別番号及び当該文書中の当該索引語の頻度の3つの要素から成るタプルを蓄積する。これらのタプルの集合を、メモリに格納できる量の分割単位に分割し、各々の分割単位ごとに索引語識別番号でソートする。最後に、各分割単位を先頭から同時に読み、同一の索引語識別番号をもつタプルを収集して当該索引語の転置リストを作成する処理を、全索引語に対して繰り返して転置インデックスを構築する。しかし、非特許文献1の技術で索引語識別番号を索引語に与えるためには、それまでに処理した全索引語の文字列が計算機メモリ上に記憶されていないと、現実的な処理性能が期待できない。したがって、非特許文献1の方法は、索引語数が非常に多い場合には実用上処理不可能となる。なお、前記タプルの代わりに、索引語識別番号、文書識別番号だけから成るペアを用いれば、図1のような転置リスト106内に文書識別番号のみが記録され出現頻度が省略された転置インデックス102を作成できる。一方、非特許文献2の方法はオンメモリで転置インデックスを構築し、メモリ容量の限界に到達すると、その時点でメモリ上に記憶されている全索引語について辞書順に、索引語文字列103とその索引語の転置リスト106を補助記憶装置上の部分転置インデックス301へ出力する(図3)。これを、全文書集合101の情報が補助記憶装置上の部分転置インデックス301に書き込まれるまで繰り返す。その後、各々の部分転置インデックス301を先頭から同時に読み、同一索引語が現れた部分転置インデックスから当該索引語の転置リストを読み出して、一本の転置リストに統合し最終的な転置インデックス102へ出力する(図4)。こうして、計算機のメモリ容量を上回る巨大な転置インデックスを構築可能である。
As a technique for constructing a huge inverted index exceeding the capacity of the memory, there are a method using sorting (Non-Patent Document 1) and a method using a partial inverted index in which an inverted list is recorded in the dictionary order of index words (Non-Patent Document 2). Are known. In the technique of Non-Patent
一方、フォワードインデックスについては、大規模な検索対象文書の全体を反映した巨大なフォワードインデックスを作成する技術は知られていない。 On the other hand, regarding the forward index, there is no known technique for creating a huge forward index that reflects the entire large-scale search target document.
非特許文献2の技術により、実搭載メモリの容量を遥かに上回る巨大な転置インデックスの構築が可能だが、検索に索引語のハッシュ表(アルゴリズム イントロダクション 第一巻、T.コルメン他著、浅野哲夫他訳、近代科学社)を使用する場合、ハッシュ表を別途作成することが好ましい。ハッシュ表を用いれば、何百万件にもなる場合がある索引語集合の中から特定の索引語に関するデータを、効率的に探索できる。ハッシュ表を使用するには、任意の索引語文字列sを整数値に変換する関数h(s)を用意する。ハッシュ表の大きさをMとすれば、h(s)は0≦h(s)<Mの範囲の整数値を取るものを用意する。索引語sに関するデータを格納する場合には、ハッシュ表の中でh(s)が指すエントリに格納する。このようにすれば、文字列sが与えられたとき、h(s)が指すエントリを見るだけでsが索引語として存在するか否かがわかり、sが索引語なら関連するデータ構造にアクセスできる。
The technology of Non-Patent
巨大な文書集合では、索引語文字列だけでもメインメモリを超えることがあり、そのような場合にもハッシュ表を効率よく作成できなくてはならない。また、非特許文献2の技術では、部分転置インデックスを出力する際、索引語の辞書順ソートを行なうため、余分な計算時間と、作業用メモリが必要になる。
In a large document set, even an index word string alone may exceed the main memory, and in such a case, a hash table must be created efficiently. Further, according to the technique of
一方、巨大なフォワードインデックスを構築する際は、最後の文書を処理するまで全索引語の索引語識別番号が確定しないため、部分的なフォワードインデックスを作成する際に索引語識別番号が不明であるという問題がある。索引語が出現した順番に索引語識別番号を与えれば、任意の時点で索引語識別番号を確定させることはできるが、この方法では全索引語の文字列をメモリ上に記憶しておかない限り、実用上十分な速度で処理できない。そのため、一部の文書群から部分フォワードインデックス501を作成する際には、仮の索引語識別番号502を付与し、全体のフォワードインデックス201に統合する際に最終的な索引語識別番号202に変換する必要がある(図5)。したがって、特定の部分フォワードインデックス501を作成する際に使用された文書群のみから計算でき、かつ大規模なメモリを使わず効率的に、最終的な索引語識別番号202へ変換できる仮の索引語識別番号502を与える方法が必要となる。
On the other hand, when building a huge forward index, the index word identification number of all index words is not fixed until the last document is processed, so the index word identification number is unknown when creating a partial forward index. There is a problem. If index word identification numbers are given in the order in which the index words appear, the index word identification numbers can be determined at any point in time, but this method does not require that all index word strings be stored in memory. It cannot be processed at a speed sufficient for practical use. Therefore, when creating a partial
本発明の目的は、非特許文献2の技術を拡張するとともに、仮の索引語識別番号の割り当て方法を提供し、上記の問題を解決することである。
An object of the present invention is to extend the technique of Non-Patent
非特許文献2の方法では、部分転置インデックスを作成する際に索引語の辞書順に転置リストを出力しているが、本発明では下記の順に索引語の転置リストを出力する。
In the method of Non-Patent
1.ハッシュ値が異なる索引語は、ハッシュ値が小さいものを先に出力する。
2.ハッシュ値が同一の索引語は、辞書順で先のものを先に出力する。
本明細書では以下、この順序をhash-lex順と呼ぶ。
1. For index terms with different hash values, those with smaller hash values are output first.
2. Index words with the same hash value are output first in dictionary order.
Hereinafter, this order is referred to as a hash-lex order.
hash-lex順を用いることにより、転置インデックスの構築に関する前述の問題を解決できる。まず、メモリに記憶されている全索引語のソートが不要になる。代わりに、ハッシュ表をスキャンし、表の各エントリで衝突している索引語を辞書順ソートするのみでよい。ハッシュ表上で衝突する索引語の数は通常、全索引語の数に比べ遥かに小さいため、そのソートのコストは小さい。これに加え、ハッシュ表の順に索引語が部分転置インデックスに記録されるため、索引語とともにハッシュ値を格納するか、部分転置インデックスの統合時にハッシュ値を再計算すれば、ハッシュ表を、補助記憶装置上のファイルへの逐次追加処理により作成できる。なお、辞書順の代わりに、辞書順の逆順など、索引語間に定義される他の種類の全順序(アルゴリズム イントロダクション 第一巻、T.コルメン他著、浅野哲夫他訳、近代科学社)を使用してもよい。
By using the hash-lex order, the above-mentioned problems related to the construction of the inverted index can be solved. First, sorting of all index words stored in the memory becomes unnecessary. Instead, it is only necessary to scan the hash table and sort the index terms that conflict in each entry of the table in lexicographic order. Since the number of index words that collide on the hash table is usually much smaller than the number of all index words, the cost of the sort is small. In addition, since the index words are recorded in the partial inverted index in the order of the hash table, if the hash value is stored together with the index word or the hash value is recalculated when integrating the partial inverted index, the hash table is stored in the auxiliary memory. It can be created by sequential addition to the file on the device. In addition, instead of dictionary order, all other types of order defined between index terms, such as reverse order of dictionary order (
部分フォワードインデックス作成時の仮の索引語識別番号にも、本発明では、hash-lex順の番号を用いる。まず、部分フォワードインデックス作成時にhash-lex順の仮の索引語識別番号を与える方法を述べる。はじめに、索引語に出現順の索引語識別番号を与えつつ、オンメモリ転置インデックスとオンメモリフォワードインデックスを作成する。部分転置インデックスを部分転置インデックス書出手段により作成後、オンメモリの転置インデックスを消去して空きメモリを確保し、オンメモリのフォワードインデックスを作成する際に割り当てられた索引語識別番号とhash-lex順の索引語識別番号との変換表を構築する。そしてこの変換表を用いて、オンメモリのフォワードインデックスを、索引語識別番号を仮の索引語識別番号へ変換しながら部分フォワードインデックスへ書き出す。 In the present invention, a hash-lex order number is also used as a temporary index word identification number when creating a partial forward index. First, a method for giving a temporary index word identification number in hash-lex order when creating a partial forward index will be described. First, an on-memory transposed index and an on-memory forward index are created while giving an index word identification number in the order of appearance to the index word. After creating the partial inverted index by the partial inverted index writing means, erase the on-memory inverted index to secure free memory, and the index word identification number and hash-lex assigned when creating the on-memory forward index Construct a conversion table with sequential index word identification numbers. Using this conversion table, the on-memory forward index is written into the partial forward index while converting the index word identification number into a temporary index word identification number.
次に、hash-lex順の仮の索引語識別番号を、最終的な索引語識別番号に変換する方法を述べる。最終的な索引語識別番号は、全索引語にhash-lex順に与えた番号とする。このようにすれば、文書に出現する転置インデックスを統合する際に、各索引語の個々の部分フォワードインデックスでの索引語識別番号と最終的な索引語識別番号との対応を、逐次計算できる。なぜなら、仮の索引語識別番号は最終的な索引語識別番号と比較した場合、当該部分フォワードインデックスに出現しない索引語の番号を詰めたものなので、部分転置インデックスの統合時に、各部分転置インデックスに出現した索引語数と全体の索引語数を照合することで、これら2種類の索引語識別番号の対応がわかるからである。この対応を、各々の部分フォワードインデックスごとに、仮の索引語識別番号と最終的な索引語識別番号の対応表として出力する。部分フォワードインデックスを、作成した順に最終的なフォワードインデックスに逐次追加しながら、仮の索引語識別番号を前記の対応表を用いて変換すれば、与えられた文書集合全体に対するフォワードインデックスが得られる。 Next, a method of converting a temporary index word identification number in the hash-lex order into a final index word identification number will be described. The final index word identification number is a number given to all index words in the order of hash-lex. In this way, when integrating the transposed index appearing in the document, the correspondence between the index word identification number in each partial forward index of each index word and the final index word identification number can be calculated sequentially. This is because, when compared with the final index word identification number, the temporary index word identification number is packed with index word numbers that do not appear in the partial forward index. This is because the correspondence between these two types of index word identification numbers can be found by checking the number of index words that have appeared and the total number of index words. This correspondence is output as a correspondence table of temporary index word identification numbers and final index word identification numbers for each partial forward index. If the temporary index word identification number is converted using the correspondence table while sequentially adding the partial forward index to the final forward index in the order of creation, the forward index for the entire given document set can be obtained.
なお、本発明のhash-lex順は、関係データベースのjoin演算の実現方法の一つであるsort-merge join法(P. Mishra and M.H.Eich, Join processing in relational databases, ACM Computing Surveys, 24(1):63-113, 1992)において、結合前の2つの関係をソートするために使用可能である。それぞれの関係の要素数をN,Mとすれば、通常の比較ソートが平均的にNlogN+MlogMに比例する時間を要するのに対し、ハッシュ表を用いたhash-lex順のソートは、join attributeに対するハッシュ値の大規模な衝突が無い限りN+Mに比例する時間で可能なため、join演算の計算量オーダが改善される。 The hash-lex order of the present invention is a sort-merge join method (P. Mishra and MHEich, Join processing in relational databases, ACM Computing Surveys, 24 (1 ): 63-113, 1992) can be used to sort the two relations before the join. If the number of elements in each relationship is N and M, the normal comparison sort takes an average time proportional to NlogN + MlogM, while the hash-lex order sort using a hash table is a join attribute As long as there is no large-scale collision of hash values with respect to, it is possible in a time proportional to N + M, so the computational complexity order of the join operation is improved.
本発明により、計算機のメモリ(主記憶装置)に入りきらない巨大な転置インデックスを構築する際に、検索時に用いるハッシュ表も同時に作成することが可能となる。また、従来技術で必要であった部分転置インデックスごとの索引語のソートが不要となる。さらに、メモリ容量を上回る巨大なフォワードインデックスも構築可能になる。 According to the present invention, when constructing a huge inverted index that does not fit in the memory (main storage device) of the computer, it is possible to simultaneously create a hash table used for searching. In addition, it is not necessary to sort index words for each partial inverted index, which is necessary in the prior art. In addition, a huge forward index exceeding the memory capacity can be constructed.
本発明の方法によって、転置インデックス及びフォワードインデックスを作成する装置の一形態を説明する。装置全体の概観を図6に示す。中央演算装置(CPU)601に、メモリ(主記憶装置)602、ハードディスク等の補助記憶装置603が接続され、ネットワーク604、ユーザ端末605が接続される。本実施形態の装置は、CPU 601により実行されるメモリ602上のプログラムとして、オンメモリ転置インデックス作成手段S709、オンメモリフォワードインデックス作成手段S710、索引語切り出し手段S701、索引語識別番号割当手段S702、文書識別番号割当手段S703、部分転置インデックス書出手段S704、部分フォワードインデックス書出手段S705、部分転置インデックス統合手段S706、部分フォワードインデックス統合手段S707を備える。補助記憶装置603には、入力となる文書集合101、部分転置インデックス301、部分フォワードインデックス501、最終的に作成される転置インデックス102、フォワードインデックス201、全索引語のハッシュ表1002が格納される。なお、補助記憶装置603に格納されるデータはネットワーク604上のストレージに格納してもよい。以下では、説明を簡単にするために、これらのデータが補助記憶装置603に置かれることを仮定する。
An embodiment of an apparatus for creating an inverted index and a forward index by the method of the present invention will be described. An overview of the entire apparatus is shown in FIG. A central processing unit (CPU) 601 is connected to a memory (main storage device) 602, an
本装置におけるデータ及び処理の流れを、図7に示す。また、転置インデックス102及びフォワードインデックス201を構築する処理の流れを、それぞれ図8、図11にまとめた。
FIG. 7 shows the flow of data and processing in this apparatus. The flow of processing for constructing the transposed
はじめに、CPU 601が補助記憶装置603から入力として検索対象文書集合101中の検索対象文書104を1つずつ取得する。各々の検索対象文書104に、下記の処理が行なわれる。まず、索引語切り出し手段S701により、文書中の索引語が切り出される。前述のように、切り出し手段として、公知の形態素解析方法又はn-gramが使用できる(情報検索アルゴリズム、北研二他著、共立出版)。さらに、それぞれの索引語に対し、索引語識別番号割当手段S702により、オンメモリのフォワードインデックス607を構築するための索引語番号が取得される。索引語識別番号割当手段S702の好ましい実施形態は、ハッシュ表に索引語を登録していき、最初の索引語には1を与え、ハッシュ表に存在しない未知の索引語が現れるごとに、それまでに割り当てた最大の番号より1つ大きい番号を割り当てることである。さらに、文書識別番号割り当て手段S703により、検索対象文書毎に文書識別番号を割り当てる。この手段の好ましい実施形態の1つは、1に初期化された整数変数を1つ保持し、新しい文書識別番号が必要な際にこの変数の値を割り当て、その直後に前記変数の値を1増やすことである。これらの処理により、1つの検索対象文書104が、ある1つの文書識別番号105に対応付けられたオンメモリのフォワードインデックス607用の索引語識別番号の集合708に変換される。
First, the
そして、オンメモリ転置インデックス作成手段S709は、オンメモリ転置インデックス606内の、前記検索対象文書104に出現する各索引語の転置リストに前記文書識別番号105を追加して、前記検索対象文書104をオンメモリ転置インデックス606に反映させる。同様に、オンメモリフォワードインデックス作成手段S710はオンメモリフォワードインデックス607に、索引語の番号の集合708から構築したリストを、前記文書識別番号105に対応付けて追加する。このとき、メモリ消費が予め決められた容量の閾値を超えたら補助記憶装置603へ、オンメモリの転置インデックス606を部分転置インデックス書出手段S704によって部分転置インデックス301として書き出し、オンメモリのフォワードインデックス607も部分フォワードインデックス書出手段S705によって部分フォワードインデックス501として書き出す。
Then, the on-memory transposed index creating means S709 adds the
部分転置インデックス書出手段S704は、図8及び図9に示すように、オンメモリの転置インデックス606を作成するために使用したハッシュ表を先頭から読み、空でない未処理のエントリを探す。そのようなエントリが見つかったら、そのエントリに対応する索引語について、それらの辞書順に、索引語の文字列とハッシュ値、転置リストを、補助記憶装置上の部分転置インデックス301へ出力する。この処理を、オンメモリの転置インデックス606に格納されている全索引語について繰り返す。
As shown in FIGS. 8 and 9, the partial inverted index writing means S704 reads the hash table used to create the on-memory
さらにオンメモリのフォワードインデックス607を、部分フォワードインデックス書出手段S705によって部分フォワードインデックス501として書き出す(図12)。不要になったオンメモリの転置インデックス606を消去して空きメモリを確保した上で、オンメモリのフォワードインデックス607を作る際に使用した索引語識別番号と、hash-lex順の仮の索引語識別番号502との変換表を作成する。そのためには、索引語数に応じた大きさの表をメモリ上に確保した上で、オンメモリの索引語のハッシュ表を先頭から順にアクセスし、見つかった索引語にhash-lex順の仮の索引語番号を割り当てつつ、割り当てられたhash-lex順の番号が指し示す変換表のエントリに、各索引語のオンメモリフォワードインデックスでの索引語識別番号を書き入れればよい。この変換表を使って、索引語識別番号をhash-lex順の番号502に変換しながら、オンメモリのフォワードインデックス607を補助記憶装置上の部分フォワードインデックス501へ出力する。
Further, the on-
全ての検索対象文書の情報が部分転置インデックス301及び部分フォワードインデックス501に変換されたら、それらを下記の方法で統合することにより、検索対象文書集合101全体に対応する転置インデックス102及びフォワードインデックス201を構築する。
When the information of all the search target documents is converted into the partial
はじめに、全体の転置インデックス102を、部分転置インデックス統合手段S706により部分転置インデックス301から構築する。その方法を、図8及び図10を用いて説明する。まず、部分転置インデックス統合手段S706は、全ての部分転置インデックス301の未処理部分の先頭の索引語のうち、hash-lex順で最も先の索引語1001を同定する。この処理は、全ての部分転置インデックスを走査することで可能であり、全ての部分転置インデックスの数をNとするとき、Nに比例する時間内に完了できる。だが、より好ましい実施形態は、各部分転置インデックスを要素、前記部分転置インデックスの先頭の索引語をキーとするプライオリティキュー(アルゴリズム イントロダクション 第一巻、T.コルメン他著、浅野哲夫他訳、近代科学社)を構築し、プライオリティキューの先頭要素を取得することである。プライオリティキューを使用することで、1つの索引語の処理が完了した際に、次に処理する索引語を同定する処理が、logNに比例する時間内に完了できる。
First, the entire transposed
未処理の索引語から、hash-lex順で最も先の索引語1001(図10に示す例では、「cat」)を同定したら、まずその索引語1001を補助記憶装置603上に新たに作成する全索引語のハッシュ表1002に追加する。この好ましい実施形態は、図15に示すように、ハッシュ表とハッシュ表に記録される内容をそれぞれ個別のファイルとし、新しいハッシュ値の索引語が現れたときにハッシュ表のファイル1501に新しいエントリを追加してハッシュ表の内容のファイル1502における末尾位置を記録し、ハッシュ表の内容のファイル1502に当該索引語の索引語識別番号202や転置インデックス102内での転置リスト106の位置といった情報を記録することである。ハッシュ値が、直前に処理したハッシュ値と連続する値でなかった場合、ファイル1501中で対応する索引語が存在しないハッシュ値に対応するエントリは、そのエントリが空であることを示すデータで埋める。図15に示した実施形態では、索引語の文字列そのものと索引語識別番号を書き込み、索引語文字列から索引語識別番号を取得可能としている。索引語はhash-lex順で部分転置インデックス301内に格納されているため、ファイル1501、1502に索引語を逐次追記していけば正しいハッシュ表を構築できると保証される。
When the
部分転置インデックス統合手段S706ではさらに、各部分転置インデックス301から、前記索引語1001に対応する転置リストを読み出して統合する。例えば図10では「cat」に対応する2つの転置リストを統合して1つの転置リストを作成している。このとき、各転置リストの文書識別番号1003を比較し、番号の小さい文書識別番号から順に抽出する。この、最小の文書識別番号を選択する処理においても、プライオリティキューを使用できる。プライオリティキューの要素を部分転置インデックス301の転置リスト、キーを未処理の先頭の文書番号とすればよい。ただし、先に作られた部分転置インデックスの文書番号識別番号ほど小さい番号になるように文書識別番号を割り当てている場合には、プライオリティキューを使用せずに、部分転置インデックス301を作成した順に、それぞれの部分転置インデックス中の転置リストを、部分転置インデックスが作られた順に連結するだけでよい。この統合の処理により、前記索引語1001が出現する全ての文書の文書識別番号からなる転置リスト106が得られる。この転置リスト106を、作成中の転置インデックス102の末尾に追加する。全索引語について、転置リスト106を作成中の転置インデックス102に逐次追加していくことで、所望の転置インデックスが得られる。
Further, the partial inverted index integration means S706 further reads out and integrates the inverted list corresponding to the
部分転置インデックス統合手段S706では、部分フォワードインデックス501を最終的なフォワードインデックスに統合するために使用する、仮の索引語識別番号502から最終的な索引語識別番号202への対応表1303も作成する。図13に示すように、部分転置インデックスから処理すべき索引語1001を選択する際に、それまでに処理した処理中の索引語1001も含めた索引語の総数1301及び、それぞれの部分転置インデックスに関して処理した処理中の索引語1001を含む索引語数1302を記録する。これは、部分転置インデックスの数にほぼ等しい数の整数を記録するだけの僅かなメモリを用いて可能である。hash-lex順に最終的な索引語識別番号を与えれば、処理済みの索引語の総数1301は索引語1001の最終的な索引語識別番号202に等しく、この索引語を含む各部分転置インデックス301に対して処理した索引語数は、前記索引語1001の仮の索引語識別番号502に等しい。したがって、総索引語数1301と当該部分転置インデックスの索引語数1302のペアを出力することで、当該部分転置インデックスとともに作成された部分フォワードインデックスの仮の索引語識別番号502を最終的な索引語識別番号202に変換するために利用する対応表1303が構築できる。
The partial inverted index integration means S706 also creates a correspondence table 1303 from the temporary index
最後に、部分フォワードインデックスを統合して最終的なフォワードインデックスに変換する。部分フォワードインデックス統合手段S707は、図11及び図14に示すように、部分フォワードインデックス501を、作成された順に逐次、最終的なフォワードインデックス201に追記する。追記する際には、部分転置インデックス統合手段S706で構築した対応表1303を用いて、仮の索引語識別番号502を最終的な索引語識別番号202に変換する。
Finally, the partial forward indexes are integrated and converted into a final forward index. As shown in FIGS. 11 and 14, the partial forward index integration unit S707 sequentially adds the partial
本発明の巨大な転置インデックス及びフォワードインデックス構築方法には、様々なバリエーションがありえる。例えば、部分フォワードインデックスにはhash-lex順の仮の索引語番号を記録したが、次の方法も可能である。すなわち、オンメモリのフォワードインデックス607で使用した出現順の番号をそのまま記録し、部分転置インデックス書出手段S704において、部分転置インデックス301を作成する際に各索引語の出現順の番号を追記する。そして、変換表1303を作成する際に、各部分転置インデックスでの処理済索引語数1302の代わりに、部分転置インデックスに記録された出現順の番号を、処理中の索引語1001を含めた処理済み索引語の総数1301とともに出力する。これにより、部分フォワードインデックスに書かれた索引語番号を最終的な索引語番号に変換する対応表が得られる。一方、転置インデックス102だけが必要でフォワードインデックス201が不要であれば、オンメモリフォワードインデックス作成手段S710、部分フォワードインデックス書出手段S705及び部分フォワードインデックス統合手段S707の実行は、省略できる。また本明細書では、文書識別番号のみのリストからなる転置リストから構成される転置インデックス102と、索引語識別番号のみのリストから成るフォワードインデックス201について説明したが、各索引語103が各検索対象文書104に現れる回数や、各索引語103が検索対象文書104に出現する位置をインデックス中に追記してもよい。
There may be various variations in the huge inverted index and forward index construction method of the present invention. For example, although the temporary index word number in the hash-lex order is recorded in the partial forward index, the following method is also possible. In other words, the numbers in the order of appearance used in the on-
本発明の方法を実装し、少ないメモリで巨大な転置インデックスを作成する実験を行なった。処理対象としたのは、2003年から2005年の公開特許公報約107万件のテキストデータであり、総量は28.2GBであった。索引語としてはフリーソフトウェアchasenで得られた形態素を使用した。使用した計算機は、メモリを4GB、HDDを250GB搭載しOSにLinuxを使用した、CPUがIntel社製Core2 Duo E6600のPCである。メモリ使用量が60MBを超えるごとに、オンメモリの転置インデックス606を部分転置インデックス301へ出力した。その結果、74個の部分転置インデックスが作成され、それらを統合することにより、最終的に1.30GBの転置インデックスが作成された。ピーク時のメモリ使用量は63.1MBであったため、メモリ使用量の約21倍の大きさの転置インデックスをハッシュ表とともに構築できたことになる。
An experiment was implemented in which the method of the present invention was implemented and a huge transposed index was created with a small amount of memory. The subject of processing was text data of about 1.07 million published patent gazettes from 2003 to 2005, and the total amount was 28.2 GB. As index words, morphemes obtained with free software chasen were used. The computer used is a PC with Intel Core2 Duo E6600 CPU with 4GB of memory, 250GB of HDD and Linux for the OS. Each time the memory usage exceeds 60 MB, the on-memory transposed
また、本技術と非特許文献2の技術の処理時間を計測し比較した。10回計測し平均を取ったところ、本技術では平均1154秒、非特許文献2の技術では平均1183秒であった。この結果から、本技術は転置インデックスに加えハッシュ表の作成も可能なばかりでなく、処理時間も若干改善できることがわかった。
Moreover, the processing time of this technique and the technique of a
一方、同様の計算機条件で同じデータを用いて、転置インデックス及びフォワードインデックスの同時作成を行なった。オンメモリのインデックスを作成中に、メモリ使用量が60MBを超える度に、オンメモリの転置インデックスとフォワードインデックスを部分転置インデックス及び部分フォワードインデックスとして適宜、補助記憶装置に書き出し、計159個の部分インデックスが生成された。それらを統合し、最終的に作成されたインデックスの大きさは、転置インデックス及びフォワードインデックスの合計で3.24GBであった。ピーク時のメモリ使用量は61.1MBであったため、メモリ使用量を50倍以上上回るサイズの検索インデックスが作成可能だと確認できた。 On the other hand, a transposed index and a forward index were created simultaneously using the same data under the same computer conditions. While creating an on-memory index, every time the memory usage exceeds 60 MB, the on-memory inverted index and forward index are written as partial inverted indexes and partial forward indexes to the auxiliary storage device as appropriate, for a total of 159 partial indexes. Was generated. The total size of the index created by integrating them was 3.24 GB in total for the inverted index and the forward index. Since the memory usage at the peak time was 61.1MB, it was confirmed that a search index with a size more than 50 times the memory usage could be created.
本発明は、大規模な文書集合を対象に、計算機のメモリ容量を上回る巨大な転置インデックス及びフォワードインデックスを構築するための技術である。部分転置インデックスを出力する際に、検索時に用いるハッシュ表が生成できるだけでなく、処理速度においても従来技術と同等以上の性能を持つ。 The present invention is a technique for constructing a huge inverted index and forward index exceeding the memory capacity of a computer for a large document set. When outputting a partial inverted index, not only can a hash table used for searching be generated, but the processing speed is equal to or better than that of the prior art.
101: 検索対象文書の集合
102: 転置インデックス
103: 索引語
104: 検索対象文書
105: 文書識別番号
106: 転置リスト
201: フォワードインデックス
202: 全文書の集合に対応するフォワードインデックスにおける、索引語識別番号
301: 部分転置インデックス
501: 部分フォワードインデックス
502: 部分フォワードインデックスにおける仮の索引語識別番号
601: 中央演算装置(CPU)
602: メモリ(主記憶装置)
603: 補助記憶装置
604: ネットワーク
605: ユーザ端末
606: オンメモリ転置インデックス
607: オンメモリフォワードインデックス
708: ある検索対象文書に含まれる索引語の、オンメモリフォワードインデックス用索引語番号の集合
1001: 部分転置インデックス統合手段において、処理対象となっている索引語の例
1002: 検索対象文書集合の全索引語を含むハッシュ表
1003: 部分転置インデックス統合手段において、処理対象となっている転置リスト内の文書識別番号
1301: 部分転置インデックス統合手段において、処理中の索引語も含め、それまでに処理をした全ての索引語の数
1302: 部分転置インデックス統合手段において、処理中の索引語も含め、それまでに処理をした、対応する部分転置インデックス中の索引語の数
1303: 部分フォワードインデックス統合手段において、部分フォワードインデックスにおける仮の索引語識別番号を最終的な索引語識別番号に変換するための対応表
101: Set of search target documents
102: Inverted index
103: Index terms
104: Search target document
105: Document identification number
106: Transpose list
201: Forward index
202: Index word identification number in the forward index corresponding to the set of all documents
301: Partially inverted index
501: Partial forward index
502: Temporary index word identification number in partial forward index
601: Central processing unit (CPU)
602: Memory (main storage device)
603: Auxiliary storage device
604: Network
605: User terminal
606: On-memory transposed index
607: On-memory forward index
708: Set of index word numbers for on-memory forward index of index words contained in a search target document
1001: Examples of index terms that are processed in the partial inverted index integration means
1002: Hash table containing all index words of search target document set
1003: Document identification number in the inverted list to be processed in the partial inverted index integration means
1301: Number of all index words processed so far, including index words currently being processed in partial inverted index integration means
1302: Number of index words in the corresponding partially inverted index that have been processed so far, including index words being processed in the partial inverted index integration means
1303: Correspondence table for converting temporary index word identification number in partial forward index to final index word identification number in partial forward index integration means
Claims (6)
補助記憶装置と、
複数の文書を含む文書集合中の個々の文書から、単語あるいは連続する複数の文字からなる文字列のいずれかを、索引語として切り出す索引語切り出し手段と、
前記文書集合中の各文書に、それぞれ異なる文書識別番号を割り当てる文書識別番号割当手段と、
前記文章集合中の一部の文書群に対して、当該文書群に出現する索引語に対するハッシュ表を作成すると共に、当該ハッシュ表を用いて前記主記憶装置上に、各索引語を含む文書の文書識別番号のリストである転置リストからなるオンメモリ転置インデックスを構築する手段と、
前記オンメモリ転置インデックスを、部分転置インデックスとして前記補助記憶装置に書き出す部分転置インデックス書出手段と、
前記補助記憶装置に記憶された複数の部分転置インデックスを1つの転置インデックスに統合する部分転置インデックス統合手段とを有し、
前記部分転置インデックス書出手段は、索引語のハッシュ値の順に、各索引語の転置リストを格納した部分転置インデックスを前記補助記憶装置に書き出し、同一ハッシュ値の索引語が複数存在するときには、それらの索引語の転置リストを、事前に与えられた索引語間の全順序(total order)に従い前記部分転置インデックスに格納し、
前記部分転置インデックス統合手段は、索引語のハッシュ値の順に、前記複数の部分転置インデックス中の各索引語の転置リストを統合し、全索引語についての転置インデックスを作成することを特徴とする転置インデックス作成装置。 Main storage,
An auxiliary storage device;
Index word cutout means for cutting out, as an index word, either a word or a character string consisting of a plurality of consecutive characters from individual documents in a document set including a plurality of documents;
Document identification number assigning means for assigning a different document identification number to each document in the document set;
A hash table for index words appearing in the document group is created for a part of the document group in the sentence set, and a document including each index word is stored on the main storage device using the hash table. Means for constructing an on-memory inverted index consisting of an inverted list that is a list of document identification numbers;
A partial transposed index writing means for writing the on-memory transposed index into the auxiliary storage device as a partial transposed index;
Partial inverted index integration means for integrating a plurality of partial inverted indexes stored in the auxiliary storage device into one inverted index;
The partial inverted index writing means writes a partial inverted index storing the inverted list of each index word in the order of the hash value of the index word to the auxiliary storage device, and when there are a plurality of index words having the same hash value, Storing the transposed list of index words in the partial transposed index according to the total order between the index words given in advance,
The partial inverted index integration means integrates the inverted list of each index word in the plurality of partial inverted indexes in the order of hash values of index words, and creates an inverted index for all index words. Indexing device.
補助記憶装置と、
複数の文書を含む文書集合中の個々の文書から、単語あるいは連続する複数の文字からなる文字列のいずれかを、索引語として切り出す索引語切り出し手段と、
前記文書集合中の各文書に、それぞれ異なる文書識別番号を割り当てる文書識別番号割当手段と、
前記文章集合中の一部の文書群に対して、当該文書群に出現する索引語に対するハッシュ表を作成すると共に、出現順に各索引語に索引語識別番号を割り当てながら、前記主記憶装置上に、前記文書群の文書識別番号とその文書識別番号の文書に出現する索引語識別番号のリストからなるオンメモリのフォワードインデックスを構築する手段と、
前記オンメモリのフォワードインデックスを、部分フォワードインデックスとして前記補助記憶装置に書き出す部分フォワードインデックス書出手段と、
前記補助記憶装置に記憶された複数の部分フォワードインデックスを1つのフォワードインデックスに統合する部分フォワードインデックス統合手段とを有し、
前記部分フォワードインデックス書出手段は、前記部分フォワードインデックス中の前記索引語識別番号を前記ハッシュ表に格納されたハッシュ値順の仮の索引語識別番号に変換して前記補助記憶装置に書き出し、
前記部分フォワードインデックス統合手段は、複数の部分フォワードインデックスで用いられている個々の仮の索引語識別番号を全文書集合のフォワードインデックスでのハッシュ値順の索引語識別番号に変換するための変換表を作成し、当該変換表を使用して部分フォワードインデックス内での索引語識別番号を全文書集合のフォワードインデックスでの索引語識別番号に変換することを特徴とするフォワードインデックス作成装置。 Main storage,
An auxiliary storage device;
Index word cutout means for cutting out, as an index word, either a word or a character string consisting of a plurality of consecutive characters from individual documents in a document set including a plurality of documents;
Document identification number assigning means for assigning a different document identification number to each document in the document set;
For some document groups in the sentence set, a hash table for index words appearing in the document group is created, and an index word identification number is assigned to each index word in the order of appearance, on the main storage device. Means for constructing an on-memory forward index comprising a list of document identification numbers of the document group and index word identification numbers appearing in the document of the document identification number;
A partial forward index writing means for writing the on-memory forward index to the auxiliary storage device as a partial forward index;
Partial forward index integration means for integrating a plurality of partial forward indexes stored in the auxiliary storage device into one forward index;
The partial forward index writing means converts the index word identification number in the partial forward index into a temporary index word identification number in the order of hash values stored in the hash table and writes it to the auxiliary storage device,
The partial forward index integration means is a conversion table for converting individual temporary index word identification numbers used in a plurality of partial forward indexes into index word identification numbers in the order of hash values in the forward index of all document sets. And converting the index word identification number in the partial forward index into the index word identification number in the forward index of the whole document set using the conversion table.
6. The forward index creation device according to claim 5 , wherein the dictionary order of index words is used as the total order.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007316916A JP5207721B2 (en) | 2007-12-07 | 2007-12-07 | Inverted index creation device and forward index creation device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007316916A JP5207721B2 (en) | 2007-12-07 | 2007-12-07 | Inverted index creation device and forward index creation device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2009140302A JP2009140302A (en) | 2009-06-25 |
| JP5207721B2 true JP5207721B2 (en) | 2013-06-12 |
Family
ID=40870833
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2007316916A Active JP5207721B2 (en) | 2007-12-07 | 2007-12-07 | Inverted index creation device and forward index creation device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5207721B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011215835A (en) | 2010-03-31 | 2011-10-27 | Toshiba Corp | Storage device having full-text search function |
| WO2012120560A1 (en) * | 2011-03-07 | 2012-09-13 | 株式会社日立製作所 | Search device and search method |
| KR102347887B1 (en) * | 2015-10-30 | 2022-01-05 | 삼성에스디에스 주식회사 | Method and apparatus for managing timeline using search engine |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3647940B2 (en) * | 1995-09-22 | 2005-05-18 | 富士通株式会社 | Data management device |
| JP2000250921A (en) * | 1999-02-26 | 2000-09-14 | Hitachi Ltd | Database management method and system |
-
2007
- 2007-12-07 JP JP2007316916A patent/JP5207721B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2009140302A (en) | 2009-06-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Shen et al. | Multi-document summarization via the minimum dominating set | |
| US10360294B2 (en) | Methods and systems for efficient and accurate text extraction from unstructured documents | |
| US8171029B2 (en) | Automatic generation of ontologies using word affinities | |
| US8321485B2 (en) | Device and method for constructing inverted indexes | |
| JP2929963B2 (en) | Document search device, word index creation method, and document search method | |
| CN102810096B (en) | A kind of search method based on individual character directory system and device | |
| KR101828995B1 (en) | Method and Apparatus for clustering keywords | |
| JP2005251206A (en) | Word collection method and system for use in word segmentation | |
| JP5615476B2 (en) | Parallel translation phrase presentation program, parallel translation phrase presentation method, and parallel translation phrase presentation apparatus | |
| CN107577671A (en) | A kind of key phrases extraction method based on multi-feature fusion | |
| CN105005556A (en) | Index keyword extraction method and system based on big geological data | |
| CN103154939A (en) | Statistical machine translation method using dependency forest | |
| CN109885641B (en) | Method and system for searching Chinese full text in database | |
| Jain et al. | Context sensitive text summarization using k means clustering algorithm | |
| JP5207721B2 (en) | Inverted index creation device and forward index creation device | |
| JP2010198425A (en) | Document management method and device | |
| JP5869948B2 (en) | Passage dividing method, apparatus, and program | |
| CN113330430B (en) | Statement structure vectorization device, statement structure vectorization method, and recording medium recording statement structure vectorization program | |
| JP5380566B2 (en) | Language processing apparatus, program, and method | |
| Tripto et al. | The word2vec graph model for author attribution and genre detection in literary analysis | |
| JP5285491B2 (en) | Information retrieval system, method and program, index creation system, method and program, | |
| Kolle et al. | Extractive summarization of text from images | |
| JP5346156B2 (en) | Program, inverted index storage method and search method | |
| KR100964207B1 (en) | Method and apparatus for indexing and retrieving documents based on hashing | |
| JP2009048351A (en) | Information search device, information search method, and information search program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100622 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120515 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120710 |
|
| 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: 20130205 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130219 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160301 Year of fee payment: 3 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 5207721 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160301 Year of fee payment: 3 |