JP5207721B2 - Inverted index creation device and forward index creation device - Google Patents

Inverted index creation device and forward index creation device Download PDF

Info

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
Application number
JP2007316916A
Other languages
Japanese (ja)
Other versions
JP2009140302A (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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2007316916A priority Critical patent/JP5207721B2/en
Publication of JP2009140302A publication Critical patent/JP2009140302A/en
Application granted granted Critical
Publication of JP5207721B2 publication Critical patent/JP5207721B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 index 102 constructed based on the set. A list including document identification numbers 105 of all documents in which a certain word 103 appears is called a transposed list 106.

英語、フランス語、スペイン語のような単語がスペースで区切られている言語と異なり、日本語、韓国語や中国語では、文書を正確に単語に分割することが困難である。そこで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 forward index 201 shown in FIG. 2 may be used in addition to the inverted index. The forward index 201 stores, for each document 104 in the search target document set 101, a list of index word identification numbers 202 of index words 103 included in the document. The index word identification number 202 here is the same number for the same index word, and is a number given differently for different index words. The forward index 201 is used as intermediate data for creating the transposed index 102, and a technique called associative search for searching similar documents (Yasuda, Imaichi, Iwayama, Niwa, Information Processing Society of Japan 69th National Convention, 3D- 1, 2007).

検索対象となる文書データ量が爆発的に拡大してゆく一方で、検索システムを構築するための計算機リソースには限りがある。特に、計算機のメモリ(主記憶装置)は高速なランダムアクセスが可能であり、インデックス構築時に既知の索引語の一覧及び各索引語の伸張可能なリストを保持する作業領域として必須であるが、大容量のメモリはコストが高い。したがって、少ないメモリで巨大なインデックスを構築する技術が必要である。   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 Document 1, a search target document is sequentially read, and a tuple composed of three elements of an index word identification number, a document identification number, and a frequency of the index word in the document is accumulated. A set of these tuples is divided into division units that can be stored in the memory, and sorted by index word identification number for each division unit. Finally, reading each division unit from the top at the same time, collecting tuples with the same index word identification number and creating a transposed list of the index words is repeated for all index words to construct an inverted index. . However, in order to give an index word identification number to the index word by the technique of Non-Patent Document 1, if the character strings of all index words processed so far are not stored in the computer memory, realistic processing performance can be obtained. I can't expect it. Therefore, the method of Non-Patent Document 1 cannot be practically processed when the number of index words is very large. If a pair consisting only of an index word identification number and a document identification number is used in place of the tuple, only the document identification number is recorded in the transposition list 106 as shown in FIG. Can be created. On the other hand, the method of Non-Patent Document 2 builds a transposed index on-memory, and when the limit of the memory capacity is reached, the index word character string 103 and its index word string 103 and all the index words stored in the memory at that time in dictionary order. The index word transposition list 106 is output to the partial transposition index 301 on the auxiliary storage device (FIG. 3). This is repeated until the information of the entire document set 101 is written in the partial transposition index 301 on the auxiliary storage device. After that, each partial transposed index 301 is read simultaneously from the beginning, the transposed list of the index word is read from the partial transposed index where the same index word appears, and is integrated into one transposed list and output to the final transposed index 102 (FIG. 4). In this way, it is possible to construct a huge transposed index that exceeds the memory capacity of the computer.

一方、フォワードインデックスについては、大規模な検索対象文書の全体を反映した巨大なフォワードインデックスを作成する技術は知られていない。   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.

A. Moffat & J. Zobel, In situ generation of compressed inverted files, J. American Society of Information Science 46(7): 537-550, 1995.A. Moffat & J. Zobel, In situ generation of compressed inverted files, J. American Society of Information Science 46 (7): 537-550, 1995. S.Heinz & J. Zobel, Efficient Single-pass index construction for text databases, J. American Society of Information Science and Technology 54(8):713-729, 2003.S. Heinz & J. Zobel, Efficient Single-pass index construction for text databases, J. American Society of Information Science and Technology 54 (8): 713-729, 2003.

非特許文献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 Document 2 enables the construction of a huge transposed index that far exceeds the capacity of the actual installed memory, but the hash table of index words for search (Algorithm Introduction Volume 1, T. Colmen et al., Tetsuo Asano et al. It is preferable to create a hash table separately. By using a hash table, it is possible to efficiently search for data related to a specific index word from among a set of index words that may be in the number of millions. In order to use the hash table, a function h (s) for converting an arbitrary index word character string s into an integer value is prepared. If the size of the hash table is M, h (s) is prepared with an integer value in the range of 0 ≦ h (s) <M. When data related to the index word s is stored, it is stored in the entry pointed to by h (s) in the hash table. In this way, given the string s, just looking at the entry pointed to by h (s) can tell whether s exists as an index word, and if s is an index word, access the associated data structure. it can.

巨大な文書集合では、索引語文字列だけでもメインメモリを超えることがあり、そのような場合にもハッシュ表を効率よく作成できなくてはならない。また、非特許文献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 Non-Patent Document 2, when a partial transposed index is output, the index words are sorted in the dictionary order, so that extra calculation time and work memory are required.

一方、巨大なフォワードインデックスを構築する際は、最後の文書を処理するまで全索引語の索引語識別番号が確定しないため、部分的なフォワードインデックスを作成する際に索引語識別番号が不明であるという問題がある。索引語が出現した順番に索引語識別番号を与えれば、任意の時点で索引語識別番号を確定させることはできるが、この方法では全索引語の文字列をメモリ上に記憶しておかない限り、実用上十分な速度で処理できない。そのため、一部の文書群から部分フォワードインデックス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 forward index 501 from a part of a document group, a temporary index word identification number 502 is assigned and converted to a final index word identification number 202 when integrated into the entire forward index 201. (Figure 5). Therefore, a temporary index word that can be calculated from only the document group used when creating the specific partial forward index 501 and can be efficiently converted to the final index word identification number 202 without using a large-scale memory. A method of giving the identification number 502 is required.

本発明の目的は、非特許文献2の技術を拡張するとともに、仮の索引語識別番号の割り当て方法を提供し、上記の問題を解決することである。   An object of the present invention is to extend the technique of Non-Patent Document 2 and provide a temporary index word identification number assigning method to solve the above problem.

非特許文献2の方法では、部分転置インデックスを作成する際に索引語の辞書順に転置リストを出力しているが、本発明では下記の順に索引語の転置リストを出力する。   In the method of Non-Patent Document 2, an inverted list is output in the dictionary order of index words when creating a partially inverted index. In the present invention, an inverted list of index words is output in the following order.

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 (Algorithm Introduction Volume 1, T. Colmen et al., Tetsuo Asano et al., Modern Science Co., Ltd.) May be used.

部分フォワードインデックス作成時の仮の索引語識別番号にも、本発明では、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 auxiliary storage device 603 such as a hard disk, and a network 604 and a user terminal 605 are connected. The apparatus according to the present embodiment includes an on-memory transposed index creating unit S709, an on-memory forward index creating unit S710, an index word segmenting unit S701, an index word identification number assigning unit S702, as programs on the memory 602 executed by the CPU 601. Document identification number assigning means S703, partial inverted index writing means S704, partial forward index writing means S705, partial inverted index integrating means S706, and partial forward index integrating means S707 are provided. The auxiliary storage device 603 stores an input document set 101, a partial inverted index 301, a partial forward index 501, a finally created inverted index 102, a forward index 201, and a hash table 1002 of all index words. The data stored in the auxiliary storage device 603 may be stored in a storage on the network 604. In the following, for the sake of simplicity, it is assumed that these data are stored in the auxiliary storage device 603.

本装置におけるデータ及び処理の流れを、図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 index 102 and the forward index 201 is summarized in FIGS. 8 and 11, respectively.

はじめに、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 CPU 601 acquires the search target documents 104 in the search target document set 101 one by one from the auxiliary storage device 603 as input. The following processing is performed on each search target document 104. First, an index word in the document is cut out by the index word cut-out means S701. As described above, a known morpheme analysis method or n-gram can be used as the extraction means (information search algorithm, Kitakenji et al., Kyoritsu Shuppan). Further, for each index word, an index word number for constructing the on-memory forward index 607 is acquired by the index word identification number assigning means S702. The preferred embodiment of the index word identification number assigning means S702 registers an index word in the hash table, gives 1 to the first index word, and every time an unknown index word that does not exist in the hash table appears, Is assigned a number that is one greater than the largest number assigned to. Further, the document identification number assigning unit S703 assigns a document identification number for each search target document. One preferred embodiment of this means keeps one integer variable initialized to 1, assigning the value of this variable when a new document identification number is needed, and immediately following that variable's value of 1 It is to increase. Through these processes, one search target document 104 is converted into a set 708 of index word identification numbers for the on-memory forward index 607 associated with one document identification number 105.

そして、オンメモリ転置インデックス作成手段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 document identification number 105 to the transposed list of each index word appearing in the search target document 104 in the on-memory transposed index 606, and makes the search target document 104 Reflected in the on-memory transposed index 606. Similarly, the on-memory forward index creating means S710 adds a list constructed from the index word number set 708 to the on-memory forward index 607 in association with the document identification number 105. At this time, when the memory consumption exceeds a predetermined capacity threshold, the on-memory inverted index 606 is written as the partial inverted index 301 to the auxiliary storage device 603 by the partial inverted index writing means S704, and the on-memory forward index 607 is written. Is also written as the partial forward index 501 by the partial forward index writing means S705.

部分転置インデックス書出手段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 inverted index 606 from the top, and searches for a non-empty unprocessed entry. When such an entry is found, the index word character string, hash value, and transposed list are output to the partial transposed index 301 on the auxiliary storage device in the order of the dictionary for the index word corresponding to the entry. This process is repeated for all index words stored in the on-memory transposed index 606.

さらにオンメモリのフォワードインデックス607を、部分フォワードインデックス書出手段S705によって部分フォワードインデックス501として書き出す(図12)。不要になったオンメモリの転置インデックス606を消去して空きメモリを確保した上で、オンメモリのフォワードインデックス607を作る際に使用した索引語識別番号と、hash-lex順の仮の索引語識別番号502との変換表を作成する。そのためには、索引語数に応じた大きさの表をメモリ上に確保した上で、オンメモリの索引語のハッシュ表を先頭から順にアクセスし、見つかった索引語にhash-lex順の仮の索引語番号を割り当てつつ、割り当てられたhash-lex順の番号が指し示す変換表のエントリに、各索引語のオンメモリフォワードインデックスでの索引語識別番号を書き入れればよい。この変換表を使って、索引語識別番号をhash-lex順の番号502に変換しながら、オンメモリのフォワードインデックス607を補助記憶装置上の部分フォワードインデックス501へ出力する。   Further, the on-memory forward index 607 is written as the partial forward index 501 by the partial forward index writing means S705 (FIG. 12). After erasing unnecessary on-memory inverted index 606 to secure free memory, the index word identification number used to create on-memory forward index 607 and temporary index word identification in hash-lex order A conversion table with the number 502 is created. For this purpose, a table with a size corresponding to the number of index words is secured in memory, the hash table of on-memory index words is accessed in order from the top, and a temporary index in hash-lex order is found for the found index words. While assigning the word number, the index word identification number in the on-memory forward index of each index word may be written in the entry of the conversion table indicated by the assigned hash-lex order number. Using this conversion table, the on-memory forward index 607 is output to the partial forward index 501 on the auxiliary storage device while converting the index word identification number to the hash-lex order number 502.

全ての検索対象文書の情報が部分転置インデックス301及び部分フォワードインデックス501に変換されたら、それらを下記の方法で統合することにより、検索対象文書集合101全体に対応する転置インデックス102及びフォワードインデックス201を構築する。   When the information of all the search target documents is converted into the partial inverted index 301 and the partial forward index 501, the inverted index 102 and the forward index 201 corresponding to the entire search target document set 101 are obtained by integrating them by the following method. To construct.

はじめに、全体の転置インデックス102を、部分転置インデックス統合手段S706により部分転置インデックス301から構築する。その方法を、図8及び図10を用いて説明する。まず、部分転置インデックス統合手段S706は、全ての部分転置インデックス301の未処理部分の先頭の索引語のうち、hash-lex順で最も先の索引語1001を同定する。この処理は、全ての部分転置インデックスを走査することで可能であり、全ての部分転置インデックスの数をNとするとき、Nに比例する時間内に完了できる。だが、より好ましい実施形態は、各部分転置インデックスを要素、前記部分転置インデックスの先頭の索引語をキーとするプライオリティキュー(アルゴリズム イントロダクション 第一巻、T.コルメン他著、浅野哲夫他訳、近代科学社)を構築し、プライオリティキューの先頭要素を取得することである。プライオリティキューを使用することで、1つの索引語の処理が完了した際に、次に処理する索引語を同定する処理が、logNに比例する時間内に完了できる。   First, the entire transposed index 102 is constructed from the partial transposed index 301 by the partial transposed index integration means S706. The method will be described with reference to FIGS. First, the partial inverted index integration unit S706 identifies the first index word 1001 in the hash-lex order among the first index words of the unprocessed portions of all the partial inverted indexes 301. This process can be performed by scanning all partial transposed indexes, and can be completed within a time proportional to N, where N is the number of all partial transposed indexes. However, a more preferred embodiment is a priority queue using each partial inverted index as an element and the first index word of the partial inverted index as a key (Algorithm Introduction Vol. 1, T. Colmen et al., Tetsuo Asano et al., Modern Science). To get the first element of the priority queue. By using the priority queue, when processing of one index word is completed, the process of identifying the index word to be processed next can be completed within a time proportional to logN.

未処理の索引語から、hash-lex順で最も先の索引語1001(図10に示す例では、「cat」)を同定したら、まずその索引語1001を補助記憶装置603上に新たに作成する全索引語のハッシュ表1002に追加する。この好ましい実施形態は、図15に示すように、ハッシュ表とハッシュ表に記録される内容をそれぞれ個別のファイルとし、新しいハッシュ値の索引語が現れたときにハッシュ表のファイル1501に新しいエントリを追加してハッシュ表の内容のファイル1502における末尾位置を記録し、ハッシュ表の内容のファイル1502に当該索引語の索引語識別番号202や転置インデックス102内での転置リスト106の位置といった情報を記録することである。ハッシュ値が、直前に処理したハッシュ値と連続する値でなかった場合、ファイル1501中で対応する索引語が存在しないハッシュ値に対応するエントリは、そのエントリが空であることを示すデータで埋める。図15に示した実施形態では、索引語の文字列そのものと索引語識別番号を書き込み、索引語文字列から索引語識別番号を取得可能としている。索引語はhash-lex順で部分転置インデックス301内に格納されているため、ファイル1501、1502に索引語を逐次追記していけば正しいハッシュ表を構築できると保証される。   When the earliest index word 1001 in the hash-lex order (“cat” in the example shown in FIG. 10) is identified from the unprocessed index words, the index word 1001 is newly created on the auxiliary storage device 603 first. Add to hash table 1002 for all index words. In this preferred embodiment, as shown in FIG. 15, the contents recorded in the hash table and the hash table are set as separate files, and when a new hash value index word appears, a new entry is added to the hash table file 1501. In addition, the tail position in the hash table contents file 1502 is recorded, and information such as the index word identification number 202 of the index word and the position of the inverted list 106 in the inverted index 102 is recorded in the hash table contents file 1502. It is to be. If the hash value is not continuous with the hash value processed immediately before, the entry corresponding to the hash value for which no corresponding index word exists in the file 1501 is filled with data indicating that the entry is empty. . In the embodiment shown in FIG. 15, the index word character string itself and the index word identification number are written, and the index word identification number can be acquired from the index word character string. Since the index words are stored in the partial transposed index 301 in the hash-lex order, it is guaranteed that a correct hash table can be constructed by sequentially adding index words to the files 1501 and 1502.

部分転置インデックス統合手段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 index word 1001 from each partial inverted index 301. For example, in FIG. 10, two transposed lists corresponding to “cat” are integrated to create one transposed list. At this time, the document identification numbers 1003 of the transposed lists are compared, and the document identification numbers with the smallest numbers are extracted in order. The priority queue can also be used in the process of selecting the minimum document identification number. The elements of the priority queue may be the transposition list of the partial transposition index 301, and the key may be the unprocessed head document number. However, if the document identification number is assigned so that the document number identification number of the partial inverted index created earlier is smaller, the order of partial inverted index 301 is created without using the priority queue. It is only necessary to concatenate the transposed list in each partial transposed index in the order in which the partial transposed index was created. By this integration process, a transposed list 106 including document identification numbers of all documents in which the index word 1001 appears is obtained. This transposed list 106 is added to the end of the transposed index 102 being created. For all index words, a desired inverted index is obtained by sequentially adding the inverted list 106 to the inverted index 102 being created.

部分転置インデックス統合手段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 word identification number 502 to the final index word identification number 202, which is used to integrate the partial forward index 501 into the final forward index. . As shown in FIG. 13, when the index word 1001 to be processed is selected from the partial inverted index, the total number 1301 of index words including the index word 1001 that has been processed so far, and the partial inverted indexes. The number of index words 1302 including the processed index word 1001 is recorded. This is possible with a small amount of memory that only records a number of integers approximately equal to the number of partially inverted indexes. If the final index word identification number is given in the hash-lex order, the total number 1301 of processed index words is equal to the final index word identification number 202 of the index word 1001, and each partial transposed index 301 including this index word is assigned to each partial inverted index 301. The number of index words processed is equal to the temporary index word identification number 502 of the index word 1001. Therefore, by outputting a pair of the total index word number 1301 and the index word number 1302 of the partial inverted index, the temporary index word identification number 502 of the partial forward index created together with the partial inverted index is obtained as the final index word identification number. A correspondence table 1303 used for conversion to 202 can be constructed.

最後に、部分フォワードインデックスを統合して最終的なフォワードインデックスに変換する。部分フォワードインデックス統合手段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 forward index 501 to the final forward index 201 in the order of creation. At the time of additional writing, the temporary index word identification number 502 is converted into the final index word identification number 202 using the correspondence table 1303 constructed by the partial transposed index integration means S706.

本発明の巨大な転置インデックス及びフォワードインデックス構築方法には、様々なバリエーションがありえる。例えば、部分フォワードインデックスには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-memory forward index 607 are recorded as they are, and the numbers in the order of appearance of each index word are added when the partial transposed index writing means S704 creates the partial transposed index 301. Then, when creating the conversion table 1303, instead of the number of processed index words 1302 in each partial inverted index, the numbers in the order of appearance recorded in the partial inverted index are processed including the index word 1001 being processed. Output together with the total number of index words 1301. Thus, a correspondence table for converting the index word number written in the partial forward index into the final index word number is obtained. On the other hand, if only the transposed index 102 is necessary and the forward index 201 is not necessary, the execution of the on-memory forward index creating means S710, the partial forward index writing means S705, and the partial forward index integrating means S707 can be omitted. Further, in this specification, the transposed index 102 composed of a transposed list composed of a list of only document identification numbers and the forward index 201 composed of a list of only index word identification numbers have been described. The number of times it appears in the document 104 and the position at which each index word 103 appears in the search target document 104 may be added to the index.

本発明の方法を実装し、少ないメモリで巨大な転置インデックスを作成する実験を行なった。処理対象としたのは、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 index 606 is output to the partial transposed index 301. As a result, 74 partial inverted indexes were created, and by combining them, a 1.30 GB inverted index was finally created. Since the peak memory usage was 63.1MB, we were able to build an inverted index with a hash table about 21 times larger than the memory usage.

また、本技術と非特許文献2の技術の処理時間を計測し比較した。10回計測し平均を取ったところ、本技術では平均1154秒、非特許文献2の技術では平均1183秒であった。この結果から、本技術は転置インデックスに加えハッシュ表の作成も可能なばかりでなく、処理時間も若干改善できることがわかった。   Moreover, the processing time of this technique and the technique of a nonpatent literature 2 was measured and compared. As a result of measuring 10 times and taking the average, this technology averaged 1154 seconds, and the technology of Non-Patent Document 2 averaged 1183 seconds. From this result, it was found that this technology can not only create a hash table in addition to the inverted index but also improve the processing time slightly.

一方、同様の計算機条件で同じデータを用いて、転置インデックス及びフォワードインデックスの同時作成を行なった。オンメモリのインデックスを作成中に、メモリ使用量が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.

検索対象となる文書集合と、それに基づき構築される転置インデックスの概略図。FIG. 3 is a schematic diagram of a document set to be searched and a transposed index constructed based on the set. 検索対象となる文書集合と、それに基づき構築されるフォワードインデックスの概略図。Schematic diagram of a set of documents to be searched and a forward index constructed based on the set. 従来法における、部分転置インデックスを作成するステップの説明図。Explanatory drawing of the step which produces the partial transposition index in the conventional method. 従来法における、部分転置インデックスを統合して最終的な転置インデックスを作成するステップの説明図。Explanatory drawing of the step which integrates a partial transposition index and produces a final transposition index in the conventional method. 大規模な文書集合から巨大なフォワードインデックスを作る際の課題の説明図。Explanatory drawing of the subject at the time of making a huge forward index from a large-scale document collection. 本発明を実施する装置の一形態を示す概略図。Schematic which shows one form of the apparatus which implements this invention. 本発明を実施する装置の一形態における、データ及び処理の流れの概略図。1 is a schematic diagram of a data and processing flow in an embodiment of an apparatus implementing the present invention. 本発明による転置インデックス構築処理の一形態を表すフローチャート。The flowchart showing one form of the transposition index construction process by this invention. 本発明の方法における、部分転置インデックス書出手段の説明図。Explanatory drawing of the partial transposition index writing means in the method of this invention. 本発明の方法における、部分転置インデックス統合手段の説明図。Explanatory drawing of the partial transposition index integration means in the method of this invention. 本発明によるフォワードインデックス構築処理の一形態を表すフローチャート。The flowchart showing one form of the forward index construction process by this invention. 部分フォワードインデックス書出手段の説明図。Explanatory drawing of a partial forward index writing means. 部分フォワードインデックスに格納されている仮の索引語識別番号を最終的な索引語識別番号に変換するために、部分転置インデックス統合手段において対応表を作成するステップの説明図。Explanatory drawing of the step which produces a corresponding table in a partial transposed index integration means, in order to convert the temporary index word identification number stored in the partial forward index into a final index word identification number. 部分フォワードインデックス統合手段の説明図。Explanatory drawing of a partial forward index integration means. 本発明の方法における、ハッシュ表構築処理の説明図。Explanatory drawing of the hash table construction process in the method of this invention.

符号の説明Explanation of symbols

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.
請求項記載の転置インデックス作成装置において、全順序として索引語の辞書順を用いることを特徴とする転置インデックス作成装置。 2. The inverted index creating apparatus according to claim 1 , wherein the dictionary order of index words is used as the entire order. 請求項1記載の転置インデックス作成装置において、前記部分転置インデックスを前記全索引語についての転置インデックスに統合する際に、現れる索引語をハッシュ値の順に逐次追記することにより、全索引語のハッシュ表を生成することを特徴とする転置インデックス作成装置。   The hash table of all index words according to claim 1, wherein when the partial inverted index is integrated into the inverted index for all index words, the index words that appear are sequentially added in the order of hash values. Generating an inverted index generating apparatus. 主記憶装置と、
補助記憶装置と、
複数の文書を含む文書集合中の個々の文書から、単語あるいは連続する複数の文字からなる文字列のいずれかを、索引語として切り出す索引語切り出し手段と、
前記文書集合中の各文書に、それぞれ異なる文書識別番号を割り当てる文書識別番号割当手段と、
前記文章集合中の一部の文書群に対して、当該文書群に出現する索引語に対するハッシュ表を作成すると共に、出現順に各索引語に索引語識別番号を割り当てながら、前記主記憶装置上に、前記文書群の文書識別番号とその文書識別番号の文書に出現する索引語識別番号のリストからなるオンメモリのフォワードインデックスを構築する手段と、
前記オンメモリのフォワードインデックスを、部分フォワードインデックスとして前記補助記憶装置に書き出す部分フォワードインデックス書出手段と、
前記補助記憶装置に記憶された複数の部分フォワードインデックスを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.
請求項記載のフォワードインデックス作成装置において、同一ハッシュ値の索引語が複数存在する場合には、それらの索引語の索引語識別番号を、事前に与えられた索引語間の全順序(total order)に従い決定することを特徴とするフォワードインデックス作成装置。 5. The forward index creation device according to claim 4, wherein when there are a plurality of index words having the same hash value, the index word identification numbers of those index words are assigned to a total order between index words given in advance (total order). The forward index creation device is characterized in that it is determined according to 請求項記載のフォワードインデックス作成装置において、全順序として索引語の辞書順を用いることを特徴とするフォワードインデックス作成装置。
6. The forward index creation device according to claim 5 , wherein the dictionary order of index words is used as the total order.
JP2007316916A 2007-12-07 2007-12-07 Inverted index creation device and forward index creation device Active JP5207721B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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 Method and system for managing database

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
JP5615476B2 (en) Parallel translation phrase presentation program, parallel translation phrase presentation method, and parallel translation phrase presentation apparatus
JP2929963B2 (en) Document search device, word index creation method, and document search method
US5995962A (en) Sort system for merging database entries
KR101828995B1 (en) Method and Apparatus for clustering keywords
JP2005251206A (en) Word collection method and system for use in word segmentation
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
US20060248037A1 (en) Annotation of inverted list text indexes using search queries
JP5869948B2 (en) Passage dividing method, apparatus, and program
CN113330430B (en) Sentence structure vectorization device, sentence structure vectorization method, and recording medium containing sentence structure vectorization program
Amirah et al. A Malay Hadith translated document retrieval using parallel Latent Semantic Indexing (LSI)
JP5285491B2 (en) Information retrieval system, method and program, index creation system, method and program,
JP5380566B2 (en) Language processing apparatus, program, and method
JP5346156B2 (en) Program, inverted index storage method and search method
KR100964207B1 (en) Method and apparatus for indexing and retrieving documents based on hashing
Ahonen-Myka Mining all maximal frequent word sequences in a set of sentences
Kolle et al. Extractive summarization of text from images
Boytsov Super-linear indices for approximate dictionary searching

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