JP5601121B2 - Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program - Google Patents
Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program Download PDFInfo
- Publication number
- JP5601121B2 JP5601121B2 JP2010215611A JP2010215611A JP5601121B2 JP 5601121 B2 JP5601121 B2 JP 5601121B2 JP 2010215611 A JP2010215611 A JP 2010215611A JP 2010215611 A JP2010215611 A JP 2010215611A JP 5601121 B2 JP5601121 B2 JP 5601121B2
- Authority
- JP
- Japan
- Prior art keywords
- document data
- search
- order
- gram
- index
- 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
Description
本発明は、Nグラム検索に関し、とくにNグラム検索のための転置インデックスの生成方法および生成装置、当該転置インデックスを用いた検索方法および検索装置、ならびにコンピュータプログラムに関する。 The present invention relates to N-gram search, and more particularly to a transposed index generation method and generation apparatus for N-gram search, a search method and search apparatus using the transposed index, and a computer program.
文書の電子化の増大に伴い、これまでに蓄積されてきた大量の文書群から所望の文書を見つけ出す検索技術の重要性が高まっている。 With the increasing digitization of documents, the importance of search technology that finds a desired document from a large number of document groups accumulated so far has increased.
英語などの多くの言語においては、単語を索引単位として索引ファイルを作成して、これを用いて高速な検索処理を実現することが一般的である。しかし、日本語の場合、スペース等によって単語の切れ目が明示的に示されないため、しばしば、Nグラムを索引単位とする方法が用いられている。 In many languages such as English, it is common to create an index file by using a word as an index unit and implement high-speed search processing using the index file. However, in Japanese, word breaks are not explicitly indicated by spaces or the like, and therefore, a method using N-grams as index units is often used.
Nグラムとは、連続するN文字からなる部分文字列のことである。Nグラムによる索引ファイル(以下、転置インデックスと呼称する)の作成には、文字列にのみ基づくため、単語を認識する必要がない。しかし、検索処理される検索語が複数のNグラムに分割されて処理されるので、長い検索語で検索処理を行う場合、検索時間が増大するという問題がある。 An N-gram is a partial character string composed of consecutive N characters. The creation of an N-gram index file (hereinafter referred to as a transposed index) is based only on a character string, so that it is not necessary to recognize a word. However, since the search term to be searched is divided and processed into a plurality of N-grams, there is a problem that the search time increases when the search processing is performed with a long search term.
このような問題に対し、非特許文献1において、検索処理の高速化の技術が開示されている。具体的に、非特許文献1では、Nグラムの文書頻度の和を処理の高速化の推定値として計算し、実際に文書の検索処理に用いるNグラムの選定に利用することで、検索処理の高速化を行う。 In order to solve such a problem, Non-Patent Document 1 discloses a technique for speeding up search processing. Specifically, in Non-Patent Document 1, the sum of the N-gram document frequencies is calculated as an estimated value for speeding up the processing, and is used to select N-grams that are actually used for document search processing. Speed up.
このようなNグラムを用いた検索処理において、より単純な処理によって高速化を実現したい、との要望がある。しかしながら、特許文献1に開示される構成では、検索対象となる単語や文書のデータ量が増えるにつれて、検索時間が長くなるという問題がある。例えば、携帯電話や電子辞書などのような小型の電子機器といった、使用できる資源が限られている環境では、機器の性能が制限されるため、検索時間が長くなる場合がある。そこで、検索を効率的に処理することによって、高速な検索処理を行う新たな方法が求められている。 In such a search process using N-grams, there is a demand for speeding up by a simpler process. However, the configuration disclosed in Patent Document 1 has a problem that the search time becomes longer as the amount of data of words and documents to be searched increases. For example, in an environment where usable resources are limited, such as a small electronic device such as a mobile phone or an electronic dictionary, the performance of the device is limited, so that the search time may be long. Therefore, there is a demand for a new method for performing high-speed search processing by processing search efficiently.
本発明は、以上のような課題を解決するためのものであり、検索対象となる単語等を効率的に絞り込むことを可能にするのに好適な転置インデックスの生成方法および生成装置、当該転置インデックスを用いた検索方法および検索装置、ならびに、コンピュータプログラムを提供することを目的とする。 The present invention is to solve the above-described problems, and a transposed index generation method and a generation apparatus suitable for efficiently narrowing down search target words and the like, and the transposed index It is an object to provide a search method and a search apparatus using a computer, and a computer program.
上記目的を達成するため、本発明の第1の観点に係る転置インデックスの生成方法は、
情報処理装置における転置インデックスの生成方法であって、
前記情報処理装置は、見出し語と対応する説明文とからそれぞれ構成される複数の文書データを記憶している記憶手段と、前記記憶手段に記憶されている前記複数の文書データに対する転置インデックスを生成する制御手段とを有し、
前記制御手段が、
前記記憶手段に記憶されている前記見出し語と対応する説明文とからそれぞれ構成される複数の文書データのそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データの順序を入れ換える順序入換ステップと、
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成ステップと、
を実行することを特徴とする。
In order to achieve the above object, a transposed index generation method according to the first aspect of the present invention includes:
A method for generating an inverted index in an information processing device,
The information processing apparatus generates a transposing index for the plurality of document data stored in the storage unit, and a storage unit that stores a plurality of document data each composed of an entry word and a corresponding explanatory sentence Control means to
The control means is
For each of a plurality of document data each composed of the headword and the explanatory text corresponding to the headword stored in the storage means, the number of characters of the headword and the explanatory text is counted, An order change step for changing the order of a plurality of document data;
A generation step of generating a transposed index by associating appearance positions in a plurality of document data in which the order is changed for each of “N-grams (N is a natural number)” that is a character string of N characters;
It is characterized by performing .
前記制御手段は、
前記順序が入れ換えられた複数の文書データのそれぞれの見出し語と説明文との文字列を包含する文書データを抽出し、当該抽出された文書データと、当該抽出された文書データに文字列が包含される文書データと、の包含関係を対応付ける対応付けステップをさらに実行し、
前記制御手段が実行する前記生成ステップでは、当該包含関係をさらに記憶させて、前記転置インデックスを生成する、
ことが望ましい。
The control means includes
Document data including character strings of headwords and explanations of each of the plurality of document data in which the order is changed is extracted, and character strings are included in the extracted document data and the extracted document data. Moreover perform the document data, the correspondence step for associating inclusion relation,
In the generation step executed by the control unit , the inclusion relation is further stored, and the transposed index is generated.
And this is desirable.
前記制御手段が実行する前記生成ステップでは、前記順序が入れ換えられた複数の文書データと、前記順序が入れ換えられる前の複数の文書データと、の対応関係をさらに記憶させて、前記転置インデックスを生成する、
ことが望ましい。
In the generating step executed by the control means , the transposition index is generated by further storing the correspondence relationship between the plurality of document data whose order has been changed and the plurality of document data before the order has been changed. To
And this is desirable.
上記目的を達成するため、本発明の第2の観点に係る検索方法は、
上記の転置インデックスの生成方法の順序入換ステップで順序が入れ換えられた複数の文書データを記憶する入換文書データ記憶手段と、
上記の転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定ステップと、
を実行することを特徴とする。
In order to achieve the above object, a search method according to the second aspect of the present invention includes:
Replaced document data storage means for storing a plurality of document data whose order has been changed in the order changing step of the above transposed index generation method,
An inverted index storage means for storing the inverted index generated in the generating step of the above-described inverted index generating method;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N-gram extraction to get the appearance position associated with the N-gram extracted in step, on the basis of the occurrence position, the search character from among the plurality of document data in which the sequence has been replaced A document identification step for identifying document data including columns;
It is characterized by performing .
上記目的を達成するため、本発明の第3の観点に係る検索方法は、
上記の転置インデックスの生成方法の順序入換ステップで順序が入れ換えられた複数の文書データを記憶する入換文書データ記憶手段と、
上記の転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定し、前記記憶された包含関係に基づいて、当該特定した文書データに対応付けられた文書データをさらに特定する文書特定ステップと、
を実行することを特徴とする。
In order to achieve the above object, a search method according to the third aspect of the present invention includes:
Replaced document data storage means for storing a plurality of document data whose order has been changed in the order changing step of the above transposed index generation method,
An inverted index storage means for storing the inverted index generated in the generating step of the above-described inverted index generating method;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N-gram extraction to get the appearance position associated with the N-gram extracted in step, on the basis of the occurrence position, the search character from among the plurality of document data in which the sequence has been replaced A document specifying step of specifying document data including a column, and further specifying document data associated with the specified document data based on the stored inclusion relationship;
It is characterized by performing .
上記目的を達成するため、本発明の第4の観点に係る検索方法は、
上記の転置インデックスの生成方法の順序入換ステップで順序が入れ換えられた複数の文書データを記憶する入換文書データ記憶手段と、
上記の転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置と、前記順序が入れ換えられた複数の文書データと前記順序が入れ換えられる前の複数の文書データとの対応関係と、に基づいて、前記順序が入れ換えられる前の複数の文書データのうちから前記検索文字列を含む文書データを特定し、前記記憶された包含関係に基づいて、当該特定した文書データに対応付けられた文書データをさらに特定する文書特定ステップと、
を実行することを特徴とする。
In order to achieve the above object, a search method according to the fourth aspect of the present invention includes:
Replaced document data storage means for storing a plurality of document data whose order has been changed in the order changing step of the above transposed index generation method,
An inverted index storage means for storing the inverted index generated in the generating step of the above-described inverted index generating method;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N obtains the occurrence position associated with the N-gram extracted in grams extraction step, and the occurrence position, the sequence plurality of document data and the order before it is replaced, which is replaced Based on the correspondence relationship with a plurality of document data, the document data including the search character string is identified from the plurality of document data before the order is changed, and based on the stored inclusion relationship, A document specifying step for further specifying the document data associated with the specified document data;
It is characterized by performing .
上記目的を達成するため、本発明の第5の観点にかかる転置インデックスの生成装置は、
見出し語と対応する説明文とからそれぞれ構成される複数の文書データのそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データの順序を入れ換える順序入換手段と、
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成手段と、
を備えることを特徴とする。
In order to achieve the above object, an inverted index generation device according to a fifth aspect of the present invention provides:
For each of a plurality of document data composed of a headword and a corresponding explanatory text, the number of characters between the headword and the explanatory text is counted, and the order of the plurality of document data is changed in the order of the smaller number of characters. Replacement means,
Generating means for generating an inverted index by associating appearance positions in a plurality of document data in which the order is changed for each of “N-grams (N is a natural number)” that is a character string of N characters;
It is characterized by providing.
上記目的を達成するため、本発明の第6の観点にかかる検索装置は、
検索文字列からNグラムを抽出するNグラム抽出手段と、
上記の生成方法によって生成された転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定手段と、
を備えることを特徴とする。
In order to achieve the above object, a search device according to the sixth aspect of the present invention provides:
N-gram extracting means for extracting N-gram from the search character string;
The appearance positions associated with the N-grams extracted in the N-gram extraction step are acquired from the transposed index generated by the above generation method, and the plurality of documents in which the order is changed based on the appearance positions Document specifying means for specifying document data including the search character string from the data;
It is characterized by providing.
上記目的を達成するため、本発明の第7の観点にかかるコンピュータプログラムは、
コンピュータを、
見出し語と対応する説明文とからそれぞれ構成される複数の文書データのそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データの順序を入れ換える順序入換手段、
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成手段、
として機能させる。
In order to achieve the above object, a computer program according to the seventh aspect of the present invention provides:
Computer
For each of a plurality of document data composed of a headword and a corresponding explanatory text, the number of characters between the headword and the explanatory text is counted, and the order of the plurality of document data is changed in the order of the smaller number of characters. Replacement means,
Generating means for generating a transposed index by associating appearance positions in a plurality of document data in which the order is changed with respect to each of “N-grams (N is a natural number)” that is a character string of N characters;
To function as.
上記目的を達成するため、本発明の第8の観点にかかるコンピュータプログラムは、
コンピュータを、
検索文字列からNグラムを抽出するNグラム抽出手段、
上記の生成方法によって生成された転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定手段、
として機能させる。
In order to achieve the above object, a computer program according to the eighth aspect of the present invention provides:
Computer
N-gram extraction means for extracting N-gram from the search character string;
The appearance positions associated with the N-grams extracted in the N-gram extraction step are acquired from the transposed index generated by the above generation method, and the plurality of documents in which the order is changed based on the appearance positions Document specifying means for specifying document data including the search character string from the data;
To function as.
本発明によれば、検索対象となる単語等を効率的に絞り込むことを可能にするのに好適な転置インデックスの生成方法および生成装置、当該転置インデックスを用いた検索方法および検索装置、ならびに、コンピュータプログラムを提供することができる。 According to the present invention, a transposed index generation method and a generation apparatus suitable for efficiently narrowing down a word or the like to be searched, a search method and a search apparatus using the transposed index, and a computer A program can be provided.
以下、本発明の実施形態に係る転置インデックスの生成方法および生成装置、当該転置インデックスを用いた検索方法および検索装置について説明する。以下に説明する実施形態は説明のためのものであり、本発明の範囲を制限するものではない。 Hereinafter, a transposed index generation method and generation apparatus, a search method using the transposed index, and a search apparatus according to an embodiment of the present invention will be described. The embodiments described below are for illustrative purposes and do not limit the scope of the present invention.
本実施形態では、コンピュータ装置を、図1に示されるような転置インデックスの生成装置として構成する。また、図1に示される生成装置10によって、本実施形態に係る転置インデックスの生成方法が実現される。
In the present embodiment, the computer apparatus is configured as a transposed index generating apparatus as shown in FIG. Moreover, the generating
生成装置10は、CPU(Central Processing Unit)11、ROM(Read Only Memory)12、RAM(Random Access Memory)13、HDD(Hard Disk Drive)14、入力装置15、出力装置16、通信制御装置17により構成される。各構成要素は、命令やデータを転送するための伝送経路であるシステムバスにより、相互に接続されている。
The
CPU11は、生成装置10全体の動作を制御し、各構成要素と接続され制御信号やデータをやりとりする。
ROM12は、生成装置10全体の動作制御に必要なコンピュータプログラムや各種データを記憶する。CPU11は、ROM12に記憶されたコンピュータプログラムによって動作し、各種制御を実行する。
RAM13は、データやコンピュータプログラムを一時的に記憶するためのもので、ROM12から読み出したコンピュータプログラムやデータ、その他処理の進行に必要なデータが保持される。
HDD14は、転置インデックスの生成処理の動作のために必要なデータ等を記憶する。このHDD14には、複数の文書データ18が記憶される。生成装置10は、この複数の文書データ18をもとにして、転置インデックスを生成する。
入力装置15は、例えばキーボードやタッチパネル等によって構成され、ユーザからの各種入力を受け付ける。
出力装置16は、例えばディスプレイ等によって構成され、生成装置10の種々の処理結果を出力する。
通信制御装置17は、生成装置10をインターネット等のコンピュータ通信網に接続するためのものであり、コンピュータ通信網に接続してデータをやり取りする場合に必要となる。
The
The
The
The
The
The
The
本実施形態では、生成装置10は、順序入換手段と、対応付け手段と、生成手段と、を備える。これらは、上述したCPU11が、ROM12やRAM13と協働し、HDD14に記憶されたデータにアクセスしながら、入力装置15や出力装置16、通信制御装置17を用いて外部とやり取りすることで、実現される。
In the present embodiment, the
具体的に、生成装置10の順序入換手段は、見出し語と対応する説明文とからそれぞれ構成される複数の文書データ18のそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データ18の順序を入れ換える。
Specifically, the order changing unit of the
ここで、見出し語とは、検索対象となる単語や文書をいう。また、説明文とは、見出し語の意味が説明された文書をいう。例えば、見出し語が「記憶」という単語の場合、説明文は、例えば、「(1)物事を忘れずに覚えている、または覚えておくこと。(2)生物体に過去の影響が残ること。(3)過去の経験の内容を保持し、それを後で思い出すこと。」となり、見出し語と説明文とが対応付けられて、1つの文書データ18として、例えばHDD14に記憶される。
Here, the headword is a word or document to be searched. An explanatory sentence is a document in which the meaning of a headword is explained. For example, when the headword is the word “memory”, the explanatory text is, for example, “(1) remember or remember things without forgetting. (2) The past influence remains on the organism. (3) Retain the contents of past experiences and remember them later. ”, The headword and the explanatory text are associated with each other and stored as one
順序入換手段は、CPU11等の機能により、このような見出し語と説明文とから構成される文書データ18毎に文字列の文字数を計数する。さらに、順序入換手段は、CPU11等の機能により、HDD14に記憶された複数の文書データ18のうち、文書データ18の文字数が少ない順に、文書データ18の順序を入れ換えて、当該順序を入れ換えた複数の入換文書データ19を、例えばRAM12等に記憶させて保持する。
The order changing means counts the number of characters in the character string for each
また、生成装置10の対応付け手段は、順序が入れ換えられた複数の入換文書データ19のそれぞれの見出し語と説明文との文字列を包含する入換文書データ19を抽出し、当該抽出された入換文書データ19と、当該抽出された入換文書データ19に文字列が包含される入換文書データ19と、の包含関係を対応付ける。
In addition, the associating unit of the
対応付け手段は、CPU11等の機能により、入換文書データ19が表す所定の見出し語や所定の説明文の文字列を包含する、複数の入換文書データ19を抽出する。ここでは、具体例として、複数の入換文書データ19として、3つの見出し語と、当該3つの見出し語に対応する3つの説明文がある場合を考える。文書データA(見出し語:「ダイヤ」、当該見出し語に対応する説明文:「ダイヤ」)、文書データB(見出し語:「ダイヤグラム」、当該見出し語に対応する説明文:「列車運行表、また、バスや航空機などの運行予定、ダイヤ、列車ダイヤ」)、文書データC(見出し語「記憶」、当該見出し語に対応する説明文:「物事を忘れずに覚えている、または覚えておくこと」)とする。この場合、入換文書データAには「ダイヤ」という文字列があり、入換文書データBにも「ダイヤグラム」、「ダイヤ」、「列車ダイヤ」という文字列があるため、入換文書データBは、入換文書データAを包含する関係にある。一方、入換文書データCには「ダイヤ」という文字列がないため、入換文書データCは、入換文書データAや入換文書データBを包含する関係にはない。
The associating means extracts a plurality of
すなわち、対応付け手段は、見出し語や説明文の文字列と一致する、他の見出し語や他の説明文の文字列があるか否かを判別することにより、文字列を包含する入換文書データ19を特定する。そして、文字列を包含する入換文書データ19がある場合、対応付け手段は、入換文書データ19同士を対応付けて、当該対応付けられた包含関係を、例えばRAM12等に記憶させて保持する。
That is, the associating means determines whether or not there is a character string of another headword or other explanatory text that matches the character string of the headword or explanatory text, so that the replacement document including the character string is determined.
また、生成装置10の生成手段は、「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、複数の入換文書データ19中の出現位置を対応付けて、そして対応付け手段により対応付けられた包含関係をさらに記憶させて、転置インデックスを生成する。生成された転置インデックスは、HDD14に、あるいは出力装置16や通信制御装置17を介して、出力される。
Further, the generation unit of the
具体的には、生成手段は、1個の文書データがNdoc文字の文字列から構成されていた場合、Ndoc−N+1個のNグラム(N文字列)を抽出し、さらに、複数の文書データについて同様にNグラムを抽出し、同一パターンのNグラムに関して、それぞれの出現位置を記載した転置インデックスを、生成する。また、生成手段は、対応付け手段により対応付けられた文書データについても同様にNグラムを抽出し、同一パターンのNグラムに関して、それぞれの出現位置を記載した転置インデックスを、生成する。生成された転置インデックスは、例えばHDD14に記憶されて保存されることになる。
Specifically, when one document data is composed of a character string of N doc characters, the generation unit extracts N doc −N + 1 N-grams (N character strings), and further, a plurality of documents. N-grams are similarly extracted from the data, and a transposed index describing each appearance position is generated for N-grams of the same pattern. Further, the generation unit similarly extracts N-grams from the document data associated by the association unit, and generates a transposed index describing each appearance position for the N-grams of the same pattern. The generated transposed index is stored and saved in, for example, the
このような生成装置10によって生成された転置インデックスは、検索装置に搭載され、検索処理に用いられる。本実施形態では、コンピュータ装置を、図2に示されるような検索装置として構成する。また、図2に示される検索装置20によって、本実施形態に係る転置インデックスの検索方法が実現される。
The inverted index generated by such a
検索装置20は、CPU21、ROM22、RAM23、HDD24、入力装置25、出力装置26、通信制御装置27により構成される。各構成要素は、命令やデータを転送するための伝送経路であるシステムバスにより、相互に接続されている。
The
これらの構成要素は、基本的には図1に示された生成装置10の構成要素と同等なものである。すなわち、図1では、文書データ18から転置インデックスを生成するために機能した各構成要素が、ここでは生成された転置インデックスを用いて検索処理を行うために機能する。
These constituent elements are basically equivalent to the constituent elements of the
すなわち、CPU21は、検索装置20全体の動作を制御し、各構成要素と接続され制御信号やデータをやりとりする。
ROM22は、検索装置20全体の動作制御に必要なコンピュータプログラムや各種データを記憶する。CPU11は、ROM12に記憶されたコンピュータプログラムによって動作し、各種制御を実行する。
RAM23は、データやコンピュータプログラムを一時的に記憶するためのもので、ROM22から読み出したコンピュータプログラムやデータ、その他処理の進行に必要なデータが保持される。
HDD24は、検索処理の動作のために必要なデータ等を記憶する。このHDD24には、生成装置10によって生成された転置インデックス30と、その際に複数の文書データ18から順序が入れ換えられた複数の入換文書データ19と、が記憶される。検索装置20は、この転置インデックス30をもとに、ユーザによって指定された検索文字列が複数の入換文書データ19の中のどの入換文書データ19中に出現するかを特定する。
入力装置25は、例えばキーボードやタッチパネル等によって構成され、ユーザからの各種入力を受け付ける。
出力装置26は、例えばディスプレイ等によって構成され、検索装置20の種々の処理結果を出力する。
通信制御装置27は、検索装置20をインターネット等のコンピュータ通信網に接続するためのものであり、コンピュータ通信網に接続してデータをやり取りする場合に必要となる。
That is, the
The
The
The
The
The
The
本実施形態では、検索装置20は、Nグラム抽出手段と、文書特定手段と、を備える。これらは、上述したCPU11が、ROM12やRAM13と協働し、HDD14に記憶されたデータにアクセスしながら、入力装置15や出力装置16、通信制御装置17を用いて外部とやり取りすることで、実現される。
In the present embodiment, the
具体的に、検索装置20のNグラム抽出手段は、検索文字列からNグラムを抽出する。すなわち、例えば検索装置20の入力装置25が、ユーザが入力した検索文字列を受付ける。そして、Nグラム抽出手段は、検索装置20のCPU21などによって、検索文字列を構成するNグラムのうち、抽出可能なものを抽出する。具体的には、ユーザがM文字の検索文字列を入力したとき、Nグラム抽出部13は、検索文字列から抽出可能なすべてのNグラム(N文字列)を抽出する。すなわち、MがNより大きい場合は、M−N+1個のNグラムが抽出されることになる。
Specifically, the N-gram extraction means of the
そして、検索装置20の文書特定手段は、転置インデックス30から、Nグラム抽出手段において抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、複数の入換文書データ19のうちから検索文字列を含む入換文書データ19を特定する。さらに、文書特定手段は、特定した入換文書データ19に対応付けられた入換文書データ19を特定する。特定された入換文書データ19は、出力装置26や通信制御装置27を介して出力される。
Then, the document specifying unit of the
すなわち、生成装置10によって生成された転置インデックス30は、文字列を包含する文書データが対応付けられているので、文書特定手段は、複数の入換文書データ19のうち、1つの入換文書データ19を特定すると、当該入換文書データ19に対応付けられた入換文書データ19をさらに特定することとなる。
That is, since the transposed
このような構成によって実現される生成装置10と検索装置20における、処理の流れの詳細を説明する。ここではまず、図3を参照して、転置インデックス30の生成処理について、フローチャートを用いて説明する。
Details of the flow of processing in the
生成装置10が、例えば入力装置15を介してユーザからの生成処理の開始の指示を受け付けることで、転置インデックス30の生成処理を開始する。転置インデックス30の生成処理が開始されると、生成装置10の順序入換手段は、CPU11の機能により、例えばHDD14に記憶された複数の文書データ18のそれぞれについて、文字列の文字数を計数する(ステップS101)。ここで、文書データ18は、見出し語と当該見出し語の説明文とから構成される。順序入換手段は、文書データ18の文字数によって、複数の文書データ18の順序を入れ換えるために、見出し語の文字列及び説明文の文字列の文字数を計数する。例えば、順序入換手段は、見出し語の文字数が5であり、説明文の文字数が15である場合、文書データ18の文字数を20(=5+15)と計数する。順序入換手段により、複数の文書データ18のそれぞれについて文字数が計数されるため、文書データ18毎の文字数が導出される。
For example, the
次に、生成装置10の順序入換手段は、CPU11の機能により、順序入換手段により計数された文字数の少ない順に、複数の文書データ18の順序を入れ換える(ステップS102)。具体的に説明すると、複数の文書データ18は、図4に示されるように、例えば、当初は、見出し語1、見出し語2、見出し語3、というように、見出し語の順番で文書データ18が並べられて、文書データ18の文字数とは無関係に並べられていた。例えば、文字数の少ない見出し語2(15文字)の文書データ18よりも、文字数の多い見出し語1(30文字)の文書データ18の方が前に位置している。
Next, the order changing means of the generating
本実施形態では、順序入換手段が、この状態から、複数の文書データ18を文字数の少ない順に並べ替えて、複数の入換文書データ19とする。具体的に説明すると、複数の文書データ18のうち、最も文字数の少ない見出し語Zの文書データ18を先頭にし、最も文字数の多い見出し語3の文書データ18を末尾にする。また、当初は先頭にあった見出し語1の文書データ18は、複数の文書データ18の中では5番目に文字数が少ないものであるため、複数の入換文書データ19では5番目に並べる。
In this embodiment, the order changing means rearranges the plurality of
このように、順序入換手段は、文書データ18毎に文字数が計数された複数の文書データ18のうち、文字数が少ない順に、文書データ18の順序を入れ換えることにより、入換文書データ19を生成する。そして、順序入換手段は、入換文書データ19を、RAM13やHDD14に記憶する。
As described above, the order changing unit generates the
次に、生成装置10の対応付け手段は、CPU21の機能により、最初の入換文書データ19に着目する(ステップS103)。そして、対応付け手段は、複数の入換文書データ19の中に、着目された入れ過分書データ19の構成する見出し語と説明文との文字列を包含する入換文書データ19が、他にあるか否かを判定する(ステップS104)。例えば、着目された入換文書データ19の見出し語の文字列が「AB」であり、対応する説明文の文字列が「CDE」の場合、対応付け手段は、当該「AB」という文字列と当該「CDE」という文字列とを、いずれも含む入換文書データ19が他にあるか否かを判定する。このような文字列を包含する入換文書データ19としては、例えば、見出し語あるいは説明文に「ABCDE」、「ABXYZCDE」、「CDEAB」という文字列を含む入換文書データ19などが相当する。
Next, the associating means of the generating
そして、複数の入換文書データ19の中に、着目された入換文書データ19の文字列を包含するものがあると判定された場合(ステップS104;YES)、対応付け手段は、着目した入換文書データ19に、その文字列を包含する入換文書データ19を対応付けて、当該対応付けられた包含関係を保持する(ステップS105)。具体的に説明すると、図5に示されるように、例えば、見出し語20を有する入換文書データ19aに、4つの入換文書データ19c〜19fを対応付け、見出し語57を有する入換文書データ19bに、2つの入換文書データ19g〜19hを対応付ける。対応付け手段は、このように対応付けられた包含関係を、RAM13等に保持する。
When it is determined that there is a plurality of
一方で、複数の入換文書データ19の中に、着目された入換文書データ19の文字列を包含するものがあると判定されなかった場合(ステップS104;NO)、検索装置20の処理は上述したステップS105を通らない。すなわち、上述した包含関係を保持しない。
On the other hand, when it is not determined that there is a plurality of
そして、検索装置20の対応付け手段は、次の入換文書データ19があるかを判定する(ステップS106)。すなわち、対応付け手段は、現在着目している入換文書データ19が、最後の入換文書データ19かを判定する。次の入換文書データ19があれば(ステップS106;YES)、対応付け手段は、当該次の入換文書データ19に着目して(ステップS107)、その後、処理は再びステップS104へと戻る。
Then, the associating unit of the
このようなステップS104〜S107の処理を、入換文書データ19ごとに行う。そして、次の入換文書データ19がなくなるまで、ステップS103において着目された入換文書データ19の文字列を包含する、入換文書データ19を判定して、含まれていれば包含関係を保持する。
Such processing in steps S104 to S107 is performed for each
ここで、複数の入換文書データ19は、文字数の少ない順に入れ換えられているので、ステップS103において着目された入換文書データ19の文字数より文字数が多い入換文書データ19が、ステップS104〜S107の処理において、次々と着目されることとなる。このため、複数の入換文書データ19を先頭から順次着目するだけで、ステップS103において着目された入換文書データ19の文字列を包含する、他の入換文書データ19を特定することができる。
Here, since the plurality of
次に、生成装置10の生成手段は、CPU11の機能により、文字数が少ない順に入れ換えられて記憶された入換文書データ19から抽出されるNグラムのそれぞれについて、入換文書データ19中の出現位置と、を構成要素とし、さらにステップS105において保持された包含関係を記憶させて、転置インデックス30を生成する(ステップS108)。生成された転置インデックス30は、HDD14に記憶される、あるいは出力装置16、通信制御装置17を介して出力される。そして、その後、検索処理を終了する。
Next, the generation unit of the
以下、図6を用いて、本実施形態に係る転置インデックス30の具体的な構成を説明する。本図に示すように、転置インデックス30は、Nグラム文字列パターンと出現位置情報格納アドレスが記載されたファイル(pattern.idx)、各Nグラム文字列パターンについての出現位置が記載されたファイル(position.idx)、文書番号と各文書の先頭文字位置が記載されたファイル(number.idx)、および包含関係に関するファイル(relation.idx)から構成される。
Hereinafter, a specific configuration of the transposed
ここで、出現位置は、検索対象の文書群を文書番号順に並べたテキストの先頭文字位置を基準とした位置である。同様に、本図中の各文書番号の先頭文字位置も、検索対象の文書群を文書番号順に並べたテキストの先頭文字位置を基準とした位置である。 Here, the appearance position is a position based on the first character position of the text in which the document group to be searched is arranged in the document number order. Similarly, the first character position of each document number in the figure is also a position based on the first character position of the text in which the document groups to be searched are arranged in document number order.
包含関係に関するファイル(relation.idx)は、上述した生成処理のステップS105において保持された包含関係が記載される。具体的には、上記図5において、見出し語20の入換文書データ19aには、見出し語45、85、456、775の入換文書データ19c〜19fが対応付けられていたため、図6では、文書番号20(見出し語20)に対して、4つの包含文書番号45、85、456、775が対応付けられている。同様に、文書番号57(見出し語57)に対して、2つの包含文書番号203、360が対応付けられている。
The file (relation.idx) relating to the inclusion relationship describes the inclusion relationship held in step S105 of the generation process described above. Specifically, in FIG. 5, the
ステップS108において作成された転置インデックス30は、後述する検索装置20にて行われる検索処理に利用される。
The transposed
以上の処理により、本実施形態における転置インデックス30の生成装置10は、文書データ18毎の文字数が少ない順に、複数の文書データ18の順序を入れ換えた入換文書データ19を作成し、入換文書データ19中のNグラムについて、入換文書データ19中における出現位置を対応付けて、転置インデックス30を生成する。また、文字列を包含する関係にある入換文書データ19を対応付けて、その包含関係をさらに記憶させて転置インデックス30を生成する。文字列を包含する関係にある入換文書データ19が対応付け(紐付け)されているため、検索文字列を含む入換文書データ19が特定されると、当該入換文書データ19に紐付けられた入換文書データ19も特定されることとなる。これは、後述する検索処理を効率的なものにすることにつながる。
Through the above processing, the generating
次に、本実施形態に係る検索装置20にて行われる、検索処理について説明する。図7は、検索処理の流れを示すフローチャートである。
Next, a search process performed by the
まず、検索装置20の処理が開始されると、例えば検索装置20の入力装置25が、ユーザから検索文字列を受け付ける(ステップS201)。
First, when the processing of the
次に、Nグラム抽出手段は、CPU21の機能により、ステップS201において受け付けられた検索文字列から、Nグラムを抽出する(ステップS202)。ここでNの値は、検索装置20において予め定められている値であり、N=2、N=3、あるいはそれ以外の自然数の値をとる、以下では説明のために、その都度N=2やN=3などの場合を用いて説明をする。
Next, the N-gram extraction means extracts N-grams from the search character string received in step S201 by the function of the CPU 21 (step S202). Here, the value of N is a value determined in advance in the
具体的に、ユーザが「高速化全文検索処理」という9文字の検索文字列を入力したとする。このとき、N=2による検索処理の場合、抽出されるNグラム(バイグラム)は、前から順に「高速」、「速化」、「化全」、「全文」、「文検」、「検索」、「索処」、「処理」、の8個(9−2+1個)である。また、例えば、N=3による検索処理の場合、抽出されるNグラム(トリグラム)は、前から順に「高速化」、「速化全」、「化全文」、「全文検」、「文検索」、「検索処」、「索処理」の7個(9−3+1個)である。 Specifically, it is assumed that the user inputs a 9-character search character string “accelerated full-text search process”. At this time, in the case of search processing with N = 2, the extracted N-grams (bigrams) are “high speed”, “speed-up”, “general text”, “full text”, “text check”, “search” in order from the front. ”,“ Search process ”, and“ process ”(9-2 + 1). Further, for example, in the case of a search process with N = 3, the extracted N-grams (trigrams) are “accelerated”, “accelerated all”, “according full sentence”, “full text check”, “sentence search” in order from the front. ”,“ Search process ”, and“ search process ”(9-3 + 1).
次に、文書特定手段は、CPU21の機能により、最初の入換文書データ19に着目する(ステップS203)。そして、文書特定手段は、着目された入換文書データ19に、検索文字列が含まれるか否かを判定する(ステップS204)。ここで、入換文書データ19に検索文字列が含まれるかどうかを判定するために、転置インデックス30を用いる。具体的には、ステップS202において、検索文字列から抽出されたNグラムを用いて、それぞれのNグラムに対応付けられた出現位置を、転置インデックス30から取得する。
Next, the document specifying means pays attention to the first
ステップS204では、文書特定手段は、取得されたNグラムの出現位置のうち、検索文字列を構成するような連続した出現位置があるかを判定して、その検索文字列が着目された入換文書データ19中に含まれているかを判断する。そして、着目された入換文書データ19に検索文字列が含まれる場合(ステップS204;YES)、文書特定手段は、その入換文書データ19をRAM13等に一時的に保持して(ステップS205)、後の処理においてユーザへ出力する。
In step S204, the document specifying unit determines whether there is a continuous appearance position that constitutes the search character string among the appearance positions of the acquired N-gram, and the replacement in which the search character string is focused. It is determined whether it is included in the
一方、着目された入換文書データ19に検索文字列が含まれない場合(ステップS204;NO)、文書特定手段は、着目された入換文書データ19の次に、入換文書データ19があるか否かを判定する(ステップS208)。複数の入換文書データ19は、文字数が少ない順に入れ換えられているので、文書特定手段は、文字数が徐々に多くなる順に、入換文書データ19を着目していくこととなる。そして、文書特定手段は、現在着目している入換文書データ19が、最後の入換文書データ19かを判定する。
On the other hand, if the focused
次に、文書特定手段は、CPU21の機能により、検索文字列が含まれると判定された入換文書データ19に対応付けられる入換文書データ19があるか否かを判定する(ステップS206)。
Next, the document specifying unit determines whether or not there is
転置インデックス30の包含関係に関するファイル(relation.idx)では、文字列が対応する(文字列を包含する)文書番号がそれぞれ対応付けられている。このため、文書特定手段は、検索文字列が含まれると判定された入換文書データ19の文書番号に対応付けられた包含文書番号があるか否かを判定する。そして、対応付けられた包含文書番号がある場合、文書特定手段は、当該包含文書番号が付された入換文書データ19が、検索文字列が含まれると判定された入換文書データ19に対応付けられている文書データであると特定する。
In the file (relation.idx) relating to the inclusion relation of the transposed
対応付けられる入換文書データ19がある場合(ステップS206;YES)、文書特定手段は、ステップS204において、検索文字列が含まれると判定された入換文書データ19に対応付けられた、すべての入換文書データ19をRAM13等に一時的に保持する(ステップS207)。
If there is the
一方、対応付けられる入換文書データ19がない場合(ステップS206;NO)、文書特定手段は、着目された入換文書データ19の次に、入換文書データ19があるか否かを判定する(ステップS208)。そして、次の入換文書データ19があれば(ステップS208;YES)、文書特定手段は、当該次の入換文書データ19が、ステップS204において対応付けられていると判定された入換文書データ19であるか否かを判定する(ステップS209)。
On the other hand, when there is no associated replacement document data 19 (step S206; NO), the document specifying unit determines whether there is
次の入換文書データ19が、対応付けられていると判定された入換文書データ19である場合(ステップS209;YES)、文書特定手段は、当該次の入換文書データ19を着目せずに(ステップS210)、当該次の入換文書データ19のその次の入換文書データ19があるか否かを判定する(ステップS208)。これは、ステップS204において対応付けられていると判定された入換文書データ19は、検索文字列が含まれると判定された入換文書データの文字列を包含しているため、検索文字列が含まれるか否かを再度判定する必要がないからである。このため、ステップS208〜S210の処理を行うことにより、入換文書データ19に検索文字列が含まれるか否かを判定する処理回数を減らすことができる。
When the next
次の入換文書データ19が、対応付けられていると判定された入換文書データ19でない場合(ステップS209;NO)、文書特定手段は、当該次の入換文書データ19に着目して(ステップS211)、その後、処理は再びステップS204へと戻る。
If the next
次の入換文書データ19がない場合(ステップS208;NO)、文書特定手段は、すべての入換文書データ19について、検索文字列が含まれるか否かを判定したとして、上記のステップS204〜S211の繰り返し処理を抜ける。そして、文書特定手段は、ステップS205及びS207によって保持された検索文字列を含む入換文書データ19を、ユーザへ出力する(ステップS212)。すなわち、ステップS204の処理において、検索文字列を含むと特定された入換文書データ19と、ステップS206の処理において、当該入換文書データ19に対応付けられていると判定されたすべての入換文書データ19と、が出力されることになる。その後、検索処理を終了する。
If there is no next replacement document data 19 (step S208; NO), the document specifying unit determines whether or not the search character string is included in all the
このようなステップS204〜S211の処理を、入換文書データ19ごとに行う。検索文字列が含まれると判定された入換文書データ19に対応付けられた入換文書データ19がある場合、検索文字列が含まれる入換文書データ19がまず1つ特定され、当該入換文書データ19に対応付けられた入換文書データ19についてもさらに特定される。このため、検索文字列が含まれる入換文書データ19を一度に特定することができる。
Such processing in steps S204 to S211 is performed for each
ステップS212において、もし検索文字列を含むと特定された入換文書データ19が1つもなければ、文書特定手段は、いずれの入換文書データ19も出力せず、典型的には「検索文字列が見つかりませんでした。」等をユーザへ出力して、処理を終了する。
In step S212, if there is no
このように、本実施形態における検索装置20は、複数の入換文書データ19のうち、検索文字列が含まれる入換文書データ19が1つ特定されると、当該入換文書データ19に対応付けられた、文字列が一致する(文字列を包含する)入換文書データ19も同時に特定することができる。これによって、複数の入換文書データ19中から、検索文字列が含まれるか否かを判定する処理回数を減らすことができ、効率的に検索処理を行うことができる。そのため、例えば携帯電話や電子辞書などのような小型の電子機器では、使用できる資源が限られている環境において、とくに本実施形態は有用である。
As described above, when one
なお、本発明は上記の実施形態に限定されず、種々の変形及び応用が可能である。 In addition, this invention is not limited to said embodiment, A various deformation | transformation and application are possible.
例えば、本実施形態では、順序入換手段が入換文書データ19を作成する際に、入れ換えられる前の状態との対応関係が認識できるように、番号を付してもよい。図8では、順序入れ換え前の複数の文書データ18のそれぞれに昇順に見出し番号を付し、その状態で、文字数が多い順に文書データ18が入れ換えられて入換文書データ19が作成される様子を示している。ここで、最初は昇順に並んでいた見出し番号は、入換文書データ19では、ばらばらになって並べ替えられている。それに対して、図8では、改めて入換後の見出し番号が、昇順に付されている。
For example, in the present embodiment, when the order changing unit creates the
このように付された入換後の見出し番号と入換前の見出し番号とを対応付けて、生成手段が、例えば転置インデックス30に記憶することで、それぞれの入換文書データ19が、入れ換えられる前はどの順番で並んでいたかの対応を付けることができるようになる。
The generating unit stores the post-replacement heading number assigned in this way and the pre-replacement heading number in association with each other, for example, in the transposed
これにより、検索装置20の文書特定手段が、複数の入換文書データ19から生成された転置インデックス30に基づいて、検索文字列が含まれる入換文書データ19を特定した場合でも、複数の入換文書データ19の中においてどの入換文書データ19が特定されたかだけでなく、入れ換えられる前の順序で並んでいた複数の文書データ18の中においてもどの文書データ18が特定されたのかを判別することが可能になる。
Thus, even when the document specifying means of the
また、対応付け手段は、入換文書データ同士の対応構造が多層構造となるように、入換文書データ19同士を対応付けることもできる。図9では、入換文書データ19a(見出し語20)に対して、入換文書データ19c(見出し語45)が対応付けられ、さらに、当該入換文書データ19c(見出し語45)に対して、3つの入換文書データ19i〜19kが対応付けられた様子を示している。また、入換文書データ19f(見出し語775)に対しては、2つの入換文書データ19l〜19mが対応付けられ、さらに入換文書データ19lに対して、入換文書データ19nが対応付けられている。このように、対応付け手段は、文字列が一致する入換文書データ19を多層的に対応付けることもできる。これにより、1つの入換文書データ19が特定されると、当該入換文書データ19に対応付けられた複数の入換文書データ19を特定することができるため、効率的に検索処理を行うことができる。
The association unit can also associate the
また、ステップS108において、「&」、「*」、「+」等の記号や特殊文字を取り除いた、転置インデックス30を生成することもできる。当該記号等は、検索文字列としてユーザから入力されることが少ないため、記号等を取り除いた転置インデックス30を生成し、当該転置インデックスに基づいて、検索処理を行うことにより、検索対象となる単語等を効率的に絞り込むことができる。さらに、記号等を取り除いた転置インデックス30では、文字列を包含する関係にある入換文書データ19同士を対応付けた対応関係を示す構成要素の割合が相対的に大きくなるため、効率的な検索を行うことができる。
Further, in step S108, the transposed
また、ユーザから受け付けられる検索文字列は、1語であってもよいし、一方で、複数の検索文字列であってもよい。複数の検索文字列を受け付けた場合、複数の検索文字列の論理積、論理和、否定論理積など、演算方法に種類があり、いずれの演算方法による検索を行ってもよい。 Further, the search character string accepted from the user may be one word, or may be a plurality of search character strings. When a plurality of search character strings are accepted, there are types of calculation methods such as logical product, logical sum, and negative logical product of the plurality of search character strings, and the search may be performed by any of the calculation methods.
また、文書データ18の構成要素は、見出し語と説明文とに限られない。例えば、文書データ18は、見出し語、説明文、当該見出し語が説明された図面、当該見出し語が意味する反対の意味を有する見出し語など、から構成されてもよい。
Further, the constituent elements of the
そして、転置インデックス30の構成要素は、上記図5に示したような構成要素に限られない。例えば、抽出されたNグラムについて、検索対象の複数の文書データ18中における出現頻度を、さらに構成要素としてもよい。この場合、文書特定手段は、出現頻度の情報を利用することで、検索文字列を含む文書データ18を、さらに効率的に特定することができる。
And the component of the
さらに、順序入換手段は、文書データ18の順序を入れ換える際に、文字数を計数することに限られず、見出し語と説明文とから構成される文書データ18のデータ量を計測することもできる。そして、順序入換手段は、計測されたデータ量が少ない順に、複数の文書データ18の順序を入れ換えることにより、入換文書データ19を作成することもできる。
Further, the order changing means is not limited to counting the number of characters when changing the order of the
なお、本実施形態における生成装置10では、文書データ18は、例えば図1のようにHDD14内に記憶されるなどして生成装置10内に存在することに限られない。すなわち、例えば図11のように、文書データ18は、生成装置10内ではなくインターネット上に存在し、通信制御装置17を介して取得されうるものであってもよい。
In the
また、本実施形態における検索装置20では、上記の生成装置10と同様に、文書データ18は、例えば図2のようにHDD14内に記憶されるなどして検索装置20内に存在することに限られない。すなわち、例えば図11のように、文書データ18は、検索装置20内ではなくインターネット上に存在し、通信制御装置17を介して取得されうるものであってもよい。
Further, in the
このような構成をとることで、図11の実施形態では図2でのものに比べ、検索装置20内に文書データ18を記憶する必要がなく、インターネットに適切に接続可能な環境であれば、小型の電子辞書のような限られた容量の装置においても実現しやすくなる。
By adopting such a configuration, in the embodiment of FIG. 11, it is not necessary to store the
また、本発明での実施形態は、上述した実施形態に加え、上記生成装置10としてコンピュータ装置を機能させるためのコンピュータプログラムであってもよい。また、上記検索装置20としてコンピュータ装置を機能させるためのコンピュータプログラムであってもよい。
Further, the embodiment of the present invention may be a computer program for causing a computer device to function as the generating
上記コンピュータプログラムは、コンパクトディスク、フレキシブルディスク、ハードディスク、光磁気ディスク、ディジタルビデオディスク、磁気テープ、半導体メモリ等のコンピュータ読取可能な情報記憶媒体に記憶することができる。 The computer program can be stored in a computer-readable information storage medium such as a compact disk, flexible disk, hard disk, magneto-optical disk, digital video disk, magnetic tape, and semiconductor memory.
また、上記コンピュータプログラムは、コンピュータプログラムが実行されるコンピュータ装置とは独立して、コンピュータ通信網を介して配付・販売することができる。また、上記情報記憶媒体は、コンピュータ装置とは独立して配付・販売することができる。 Further, the computer program can be distributed and sold via a computer communication network independently of a computer device on which the computer program is executed. The information storage medium can be distributed and sold independently of the computer device.
10…生成装置、11…CPU、12…ROM、13…RAM、14…HDD、15…入力装置、16…出力装置、17…通信制御装置、18…文書データ、19…入換文書データ、20…検索装置、21…CPU、22…ROM、23…RAM、24…HDD、25…入力装置、26…出力装置、27…通信制御装置、30…転置インデックス
DESCRIPTION OF
Claims (10)
前記情報処理装置は、見出し語と対応する説明文とからそれぞれ構成される複数の文書データを記憶している記憶手段と、前記記憶手段に記憶されている前記複数の文書データに対する転置インデックスを生成する制御手段とを有し、
前記制御手段が、
前記記憶手段に記憶されている前記見出し語と対応する説明文とからそれぞれ構成される複数の文書データのそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データの順序を入れ換える順序入換ステップと、
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成ステップと、
を実行することを特徴とする転置インデックスの生成方法。 A method for generating an inverted index in an information processing device,
The information processing apparatus generates a transposing index for the plurality of document data stored in the storage unit, and a storage unit that stores a plurality of document data each composed of an entry word and a corresponding explanatory sentence Control means to
The control means is
For each of a plurality of document data each composed of the headword and the explanatory text corresponding to the headword stored in the storage means, the number of characters of the headword and the explanatory text is counted, An order change step for changing the order of a plurality of document data;
A generation step of generating a transposed index by associating appearance positions in a plurality of document data in which the order is changed for each of “N-grams (N is a natural number)” that is a character string of N characters;
Method for generating an inverted index, which comprises the run.
前記順序が入れ換えられた複数の文書データのそれぞれの見出し語と説明文との文字列を包含する文書データを抽出し、当該抽出された文書データと、当該抽出された文書データに文字列が包含される文書データと、の包含関係を対応付ける対応付けステップをさらに実行し、
前記制御手段が実行する前記生成ステップでは、当該包含関係をさらに記憶させて、前記転置インデックスを生成する、
ことを特徴とする請求項1に記載の転置インデックスの生成方法。 The control means includes
Document data including character strings of headwords and explanations of each of the plurality of document data in which the order is changed is extracted, and character strings are included in the extracted document data and the extracted document data. Moreover perform the document data, the correspondence step for associating inclusion relation,
In the generation step executed by the control unit , the inclusion relation is further stored, and the transposed index is generated.
Method for generating an inverted index of claim 1, wherein the this.
ことを特徴とする請求項1または2に記載の転置インデックスの生成方法。 In the generating step executed by the control means , the transposition index is generated by further storing the correspondence relationship between the plurality of document data whose order has been changed and the plurality of document data before the order has been changed. To
Method for generating an inverted index according to claim 1 or 2, characterized and this.
請求項1に記載された転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定ステップと、
を実行することを特徴とする検索方法。 Replaced document data storage means for storing a plurality of document data whose order is changed in the order changing step of the transposed index generation method according to claim 1;
Inverted index storage means for storing the inverted index generated in the generating step of the inverted index generating method according to claim 1;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N-gram extraction to get the appearance position associated with the N-gram extracted in step, on the basis of the occurrence position, the search character from among the plurality of document data in which the sequence has been replaced A document identification step for identifying document data including columns;
The search method characterized by performing .
請求項2に記載された転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定し、前記記憶された包含関係に基づいて、当該特定した文書データに対応付けられた文書データをさらに特定する文書特定ステップと、
を実行することを特徴とする検索方法。 Replaced document data storage means for storing a plurality of document data whose order has been changed in the order changing step of the transposed index generation method according to claim 2;
Inverted index storage means for storing the inverted index generated in the generating step of the inverted index generating method according to claim 2;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N-gram extraction to get the appearance position associated with the N-gram extracted in step, on the basis of the occurrence position, the search character from among the plurality of document data in which the sequence has been replaced A document specifying step of specifying document data including a column, and further specifying document data associated with the specified document data based on the stored inclusion relationship;
The search method characterized by performing .
請求項3に記載された転置インデックスの生成方法の生成ステップで生成された転置インデックスを記憶する転置インデックス記憶手段と、
前記転置インデックスを用いて前記文書データを検索する制御手段とを有する情報処理装置における検索方法であって、
前記制御手段は、
検索文字列からNグラムを抽出するNグラム抽出ステップと、
前記転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置と、前記順序が入れ換えられた複数の文書データと前記順序が入れ換えられる前の複数の文書データとの対応関係と、に基づいて、前記順序が入れ換えられる前の複数の文書データのうちから前記検索文字列を含む文書データを特定し、前記記憶された包含関係に基づいて、当該特定した文書データに対応付けられた文書データをさらに特定する文書特定ステップと、
を実行することを特徴とする検索方法。 Replaced document data storage means for storing a plurality of document data whose order has been changed in the order changing step of the transposed index generation method according to claim 3;
Transposed index storage means for storing the inverted index generated in the generating step of the inverted index generating method according to claim 3;
A search method in an information processing apparatus having control means for searching for the document data using the transposed index,
The control means includes
N-gram extraction step for extracting N-gram from the search character string;
From the inverted index, the N obtains the occurrence position associated with the N-gram extracted in grams extraction step, and the occurrence position, the sequence plurality of document data and the order before it is replaced, which is replaced Based on the correspondence relationship with a plurality of document data, the document data including the search character string is identified from the plurality of document data before the order is changed, and based on the stored inclusion relationship, A document specifying step for further specifying the document data associated with the specified document data;
The search method characterized by performing .
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成手段と、
を備えることを特徴とする転置インデックスの生成装置。 For each of a plurality of document data composed of a headword and a corresponding explanatory text, the number of characters between the headword and the explanatory text is counted, and the order of the plurality of document data is changed in the order of the smaller number of characters. Exchange means;
Generating means for generating an inverted index by associating appearance positions in a plurality of document data in which the order is changed for each of “N-grams (N is a natural number)” that is a character string of N characters;
Generator inverted index, characterized in that it comprises a.
請求項1に記載の生成方法によって生成された転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定手段と、
を備えることを特徴とする検索装置。 N-gram extracting means for extracting N-gram from the search character string;
An appearance position associated with the N-gram extracted in the N-gram extraction step is acquired from the transposed index generated by the generation method according to claim 1, and the order is changed based on the appearance position. Document specifying means for specifying document data including the search character string from a plurality of document data;
Search apparatus comprising: a.
見出し語と対応する説明文とからそれぞれ構成される複数の文書データのそれぞれについて、当該見出し語と当該説明文との文字数を計数し、文字数が少ない順に、当該複数の文書データの順序を入れ換える順序入換手段、
「N文字の文字列であるNグラム(Nは自然数)」のそれぞれについて、前記順序が入れ換えられた複数の文書データ中の出現位置を対応付けて、転置インデックスを生成する生成手段、
として機能させるためのコンピュータプログラム。 Computer
For each of a plurality of document data composed of a headword and a corresponding explanatory text, the number of characters between the headword and the explanatory text is counted, and the order of the plurality of document data is changed in the order of the smaller number of characters. Replacement means,
Generating means for generating a transposed index by associating appearance positions in a plurality of document data in which the order is changed with respect to each of “N-grams (N is a natural number)” that is a character string of N characters;
Computer program for functioning as a.
検索文字列からNグラムを抽出するNグラム抽出手段、
請求項1に記載の生成方法によって生成された転置インデックスから、前記Nグラム抽出ステップにおいて抽出されたNグラムに対応付けられた出現位置を取得し、当該出現位置に基づいて、前記順序が入れ換えられた複数の文書データのうちから前記検索文字列を含む文書データを特定する文書特定手段、
として機能させるためのコンピュータプログラム。 Computer
N-gram extraction means for extracting N-gram from the search character string;
An appearance position associated with the N-gram extracted in the N-gram extraction step is acquired from the transposed index generated by the generation method according to claim 1, and the order is changed based on the appearance position. Document specifying means for specifying document data including the search character string from a plurality of document data;
Computer program for functioning as a.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010215611A JP5601121B2 (en) | 2010-09-27 | 2010-09-27 | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010215611A JP5601121B2 (en) | 2010-09-27 | 2010-09-27 | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2012069071A JP2012069071A (en) | 2012-04-05 |
JP5601121B2 true JP5601121B2 (en) | 2014-10-08 |
Family
ID=46166221
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010215611A Active JP5601121B2 (en) | 2010-09-27 | 2010-09-27 | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5601121B2 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2885487B2 (en) * | 1990-07-26 | 1999-04-26 | 日本電信電話株式会社 | Document information retrieval device |
JPH11161666A (en) * | 1997-11-28 | 1999-06-18 | Hitachi Ltd | Method and device for document data retrieval and document editing device |
JP3347088B2 (en) * | 1999-02-12 | 2002-11-20 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Related information search method and system |
JP4074564B2 (en) * | 2003-07-30 | 2008-04-09 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Computer-executable dimension reduction method, program for executing the dimension reduction method, dimension reduction apparatus, and search engine apparatus using the dimension reduction apparatus |
JP5184987B2 (en) * | 2008-06-17 | 2013-04-17 | 新日鉄住金ソリューションズ株式会社 | Index information creating apparatus, index information creating method and program |
-
2010
- 2010-09-27 JP JP2010215611A patent/JP5601121B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2012069071A (en) | 2012-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5798814B2 (en) | Method and system for providing representative phrases for real-time popular keywords | |
US8117026B2 (en) | String matching method and system using phonetic symbols and computer-readable recording medium storing computer program for executing the string matching method | |
KR101435265B1 (en) | Method for disambiguating multiple readings in language conversion | |
US20070055493A1 (en) | String matching method and system and computer-readable recording medium storing the string matching method | |
JP2007004633A (en) | Language model generation device and language processing device using language model generated by the same | |
JP2007328654A (en) | Retrieval device, retrieval program, and retrieval method | |
JP5273735B2 (en) | Text summarization method, apparatus and program | |
Akram et al. | Word segmentation for Urdu OCR system | |
Bahassine et al. | Arabic text classification using new stemmer for feature selection and decision trees | |
JP5083367B2 (en) | SEARCH DEVICE, SEARCH METHOD, AND COMPUTER PROGRAM | |
JP5869948B2 (en) | Passage dividing method, apparatus, and program | |
JP5601121B2 (en) | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program | |
JP5601123B2 (en) | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program | |
WO2015075920A1 (en) | Input assistance device, input assistance method and recording medium | |
KR101113787B1 (en) | Apparatus and method for indexing text | |
JP5601116B2 (en) | Transposed index generation method and generation apparatus for N-gram search, search method and search apparatus using the inverted index, and computer program | |
JP5112416B2 (en) | Term extraction device, method and term dictionary data structure | |
JP2009271819A (en) | Document search system, document search method and document search program | |
JP5380566B2 (en) | Language processing apparatus, program, and method | |
JP2010146061A (en) | Example display, example display method, and example display program | |
JP5547030B2 (en) | Information analysis apparatus, method and program | |
JP2009140411A (en) | Text summarization device and text summarization method | |
JP2008276561A (en) | Morpheme analysis device, morpheme analysis method, morpheme analysis program, and recording medium with computer program recorded thereon | |
JP5533197B2 (en) | Search device and computer program | |
WO2007011140A1 (en) | Method of extracting topics and issues and method and apparatus for providing search results based on topics and issues |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130918 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140319 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140507 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140702 |
|
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: 20140722 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140804 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5601121 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |