[go: up one dir, main page]

JPH1153381A - Device and method for retrieving similar document - Google Patents

Device and method for retrieving similar document

Info

Publication number
JPH1153381A
JPH1153381A JP9208039A JP20803997A JPH1153381A JP H1153381 A JPH1153381 A JP H1153381A JP 9208039 A JP9208039 A JP 9208039A JP 20803997 A JP20803997 A JP 20803997A JP H1153381 A JPH1153381 A JP H1153381A
Authority
JP
Japan
Prior art keywords
document
word
word frequency
norm
search target
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.)
Withdrawn
Application number
JP9208039A
Other languages
Japanese (ja)
Inventor
Yasuo Tanosaki
康雄 田野崎
Naohide Kubota
直秀 久保田
Yukio Nakamoto
幸夫 中本
Takuya Nishina
卓哉 仁科
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.)
Toshiba Corp
Toshiba Computer Engineering Corp
Original Assignee
Toshiba Corp
Toshiba Computer Engineering Corp
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 Toshiba Corp, Toshiba Computer Engineering Corp filed Critical Toshiba Corp
Priority to JP9208039A priority Critical patent/JPH1153381A/en
Publication of JPH1153381A publication Critical patent/JPH1153381A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To retrieve the similar documents in consideration of their frequency of occurrence and also to simultaneously retrieve plural similar retrieving and retrieved object documents with high accuracy and high efficiency by calculating the similarity between both document data based on a word frequency table and a document norm table. SOLUTION: A main processing part 11a takes a word frequency table out of a retrieving object/word frequency table store buffer 11j and a retrieved object/word frequency table store buffer 11k respectively and transfers its processing to a word correspondence table production part 11d. When a word correspondence table is produced at the part 11d and stored in a word correspondence table store buffer 11m, the part 11a transfers its processing to a similarity calculation part 11e. The part 11e refers to the word correspondence table and a document norm table to calculate the similarity between the retrieving and retrieved object documents for each paragraph of word frequency tables of both retrieving and retrieved object documents. Then the similarity is calculated between both documents by calculating the average similarity value of paragraphs, etc., and this calculation result is outputted to an external storage.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、電子化された文書
データの検索装置に係り、特にある文書データに対して
これと類似した文書データを検索する類似文書検索装置
および類似文書検索方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an electronic document data search apparatus, and more particularly to a similar document search apparatus and a similar document search method for searching document data similar to certain document data.

【0002】[0002]

【従来の技術】近年、大量の電子化された文書データが
流通するようになり、自動分類等を行う目的で、文書デ
ータベース中から指定された文書に類似する文書を自動
検索するシステムが実用されてきている。これらのシス
テムでは、指定された文書(これを検索対象文書と呼
ぶ。)の類似文書を検索するにあたって、この検索対象
文書と他の文書(これを被検索対象文書と呼ぶ。)との
間で共通する単語の種類数を反映した類似度を計算し、
この値の大きなものを検索結果として出力する。
2. Description of the Related Art In recent years, a large amount of electronic document data has been distributed, and a system for automatically retrieving a document similar to a designated document from a document database for the purpose of automatic classification and the like has been put into practical use. Is coming. In these systems, when searching for a similar document of a specified document (this is referred to as a search target document), a search is made between this search target document and another document (this is referred to as a search target document). Calculate similarity that reflects the number of common word types,
The one with the larger value is output as a search result.

【0003】例えば、図27に示すように、予めいくつ
かの単語i1,i2,…,inを一次の検索条件として
指定しておき、文書データベースに格納されたm個の文
書データb1,b2,…,bmについて、該文書中にお
ける個々の一次検索条件単語i1,i2,…,inの有
無を調べる。このように各文書についての単語有無表を
作成した後、上記一次検索条件単語i1,i2,…,i
nの中で検索対象文書中に存在するいくつかの単語を二
次検索条件として指定し、この単語をより多く含む文書
を上記単語有無表を参照することによって判定し、これ
を類似文書の検索結果として出力する。
For example, as shown in FIG. 27, several words i1, i2,..., In are specified in advance as primary search conditions, and m pieces of document data b1, b2, .., Bm, the presence or absence of individual primary search condition words i1, i2,. After creating the word presence / absence table for each document as described above, the primary search condition words i1, i2,.
n, a number of words existing in the search target document are designated as secondary search conditions, and a document containing more words is determined by referring to the above-mentioned word presence / absence table. Output as result.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、このよ
うな従来の類似文書検索方式では、被検索対象文書中に
検索条件となる単語の有る/無しを判定基準として類似
検索を行っているにすぎないため、被検索対象文書中の
検索条件単語の持つ重みまでは考慮されないものとな
り、常により多くの種類の単語を含んだ長文の文書が類
似文書の候補として選ばれやすくなるなど、精度的に難
があることが指摘されている。また、上記従来の方式で
は、類似文書の検索を行おうとする度に検索対象文書中
に存在する、該文書の特徴をよく表すような単語を二次
検索条件として正しく指定し、そうでない種類の単語は
二次検索条件から必ず除外する必要があり、二次検索条
件の選定の際に、例えばオペレータが検索対象文書を参
照してキーとなる単語を見付け出すなどの人為的な労力
を要するなどの問題もあった。
However, in such a conventional similar document search system, similar search is performed only based on the presence / absence of a word serving as a search condition in the search target document. Therefore, the weight of the search condition word in the search target document is not taken into account, and a long document containing more types of words is always easily selected as a similar document candidate. It has been pointed out that there is. Further, in the above-described conventional method, every time a search for a similar document is performed, a word that exists in the search target document and that well represents the characteristics of the document is correctly specified as a secondary search condition. Words must always be excluded from secondary search conditions, and when selecting secondary search conditions, for example, an operator needs to refer to the search target document to find a key word, which requires artificial labor. There was also a problem.

【0005】本発明はこのような課題を解決するために
なされたもので、検索精度に優れ高速処理が可能な類似
文書検索装置および類似文書検索方法を提供することを
目的としている。
The present invention has been made to solve such a problem, and an object of the present invention is to provide a similar document search device and a similar document search method which have high search accuracy and can perform high-speed processing.

【0006】[0006]

【課題を解決するための手段】上記した目的を達成する
ために、請求項1記載の発明の類似文書検索装置は、複
数の文書データを格納する格納手段と、前記格納手段に
格納された文書データごとに、予め設定された検索条件
単語ごとの出現頻度を求めて単語頻度表を作成する単語
頻度表作成手段と、前記格納手段に格納された文書デー
タごとに、前記単語頻度表作成手段により作成された単
語頻度表中の検索条件単語ごとの出現頻度を要素とする
1次元ベクトルのノルムを算出して文書ノルム表を作成
する文書ノルム表作成手段と、前記格納手段に格納され
た文書データの中から検索対象および被検索対象の文書
データを指定する指定手段と、前記指定手段により指定
された各文書データ間の類似度を、前記単語頻度表およ
び前記文書ノルム表に基づき算出する類似度算出手段と
を有することを特徴とする。
According to another aspect of the present invention, there is provided a similar document search apparatus comprising: a storage unit for storing a plurality of document data; and a document stored in the storage unit. For each data, a word frequency table creating means for finding a frequency of appearance for each preset search condition word to create a word frequency table, and for each document data stored in the storage means, the word frequency table creating means Document norm table creating means for calculating a norm of a one-dimensional vector having an appearance frequency for each search condition word in the created word frequency table as an element to create a document norm table, and document data stored in the storage means Means for designating the document data to be searched and searched for from among the document data; and the similarity between the document data designated by the designating means, the word frequency table and the document norm. And having a similarity calculation means for calculating, based on the.

【0007】本発明によれば、文書データ中の検索条件
単語の出現頻度を考慮した類似文書検索が可能となり、
また、同時に複数の検索対象文書と複数の被検索対象文
書を対象とした類似文書検索を高効率にかつ高精度に行
うことが可能となる。
According to the present invention, a similar document search can be performed in consideration of the frequency of occurrence of search condition words in document data.
Further, it becomes possible to perform a similar document search for a plurality of search target documents and a plurality of search target documents simultaneously with high efficiency and high accuracy.

【0008】また、請求項1の発明では、格納手段に格
納された各文書データについて単語頻度表と文書ノルム
表を予め計算して記憶しておき、検索対象および被検索
対象の文書データが指定されたところで、類似度算出手
段によって、該当する各文書データの単語頻度表および
文書ノルム表から文書データ間の類似度を求めること
で、連続して複数の検索対象文書と複数の被検索対象文
書を対象とした類似文書検索を行う場合、すなわち1つ
の検索対象文書と各被検索対象文書との類似度計算を行
った後、続けて次の1つの検索対象文書と各被検索対象
文書との類似度計算を行うような場合でも、各被検索対
象文書に対する単語頻度表の作成やノルム計算が各々一
回で済むので高速処理が可能となる。
According to the first aspect of the invention, a word frequency table and a document norm table are calculated and stored in advance for each document data stored in the storage means, and the search target and the search target document data are designated. Then, the similarity calculating means obtains the similarity between the document data from the word frequency table and the document norm table of the corresponding document data, so that a plurality of documents to be searched and a plurality of documents to be searched are successively obtained. Is performed, that is, after calculating the similarity between one search target document and each search target document, the similarity search between the next one search target document and each search target document is performed. Even when the similarity calculation is performed, high-speed processing can be performed because the creation of the word frequency table and the norm calculation for each document to be searched need to be performed only once.

【0009】さらに、請求項2記載の発明の類似文書検
索装置は、複数の文書データを格納する格納手段と、前
記格納手段に格納された文書データごとに、予め設定さ
れた検索条件単語ごとの出現頻度を求めて単語頻度表を
作成する単語頻度表作成手段と、前記格納手段に格納さ
れた文書データごとに、前記単語頻度表作成手段により
作成された単語頻度表中の検索条件単語ごとの出現頻度
を要素とする1次元ベクトルのノルムを算出して文書ノ
ルム表を作成する文書ノルム表作成手段と、前記格納手
段に格納された文書データの中から検索対象および被検
索対象の文書データを指定する指定手段と、前記指定手
段により指定された各文書データに対して前記単語頻度
表作成手段にて作成された各単語頻度表間の共通単語の
登録位置関係を示す単語対応表を作成する単語対応表作
成手段と、前記指定手段により指定された各文書データ
間の類似度を、前記単語頻度表、前記文書ノルム表およ
び前記単語対応表に基づき算出する類似度算出手段とを
有することを特徴とする。この発明では、各文書データ
間の類似度算出において、各単語頻度表のベクトルデー
タの内積計算に必要な、検索対象文書の単語頻度表と被
検索対象文書の単語頻度表との間での共通単語について
の出現頻度情報を単語対応表を参照することによって一
意に得られるので、より一層の処理の高速化を図ること
ができる。また、上記目的を達成するために、本発明の
類似文書検索方法は、請求項3に記載されるように、文
書データベースに格納された個々の文書データごとに、
予め設定された検索条件単語ごとの出現頻度を求めて単
語頻度表を作成する工程と、文書データベースに格納さ
れた個々の文書データごとに、前記作成された単語頻度
表中の検索条件単語ごとの出現頻度を要素とする1次元
ベクトルのノルムを算出して文書ノルム表を作成する工
程と、前記文書データベースに格納された文書データの
中から検索対象および被検索対象の文書データを指定す
る工程と、前記指定された各文書データ間の類似度を、
前記単語頻度表および前記文書ノルム表に基づき算出す
る工程とを有することを特徴とするものであり、この発
明の作用、効果は請求項1の発明のそれと等価である。
Further, according to a second aspect of the present invention, there is provided a similar document search apparatus, wherein a storage means for storing a plurality of document data, and a predetermined search condition word for each of the document data stored in the storage means. A word frequency table creating means for creating a word frequency table by obtaining an appearance frequency; and for each document condition stored in the storage means, for each search condition word in the word frequency table created by the word frequency table creating means. A document norm table creating means for calculating a norm of a one-dimensional vector having an appearance frequency as an element to create a document norm table; and a search target and a search target document data from the document data stored in the storage means. The designation means to designate, and the registration position relationship of common words between the respective word frequency tables created by the word frequency table creation means for each document data designated by the designation means are shown. Word correspondence table creation means for creating a word correspondence table, and similarity calculation for calculating the similarity between the respective document data designated by the designation means based on the word frequency table, the document norm table and the word correspondence table. Means. According to the present invention, in calculating the similarity between the respective document data, the commonality between the word frequency table of the search target document and the word frequency table of the search target document, which is necessary for calculating the inner product of the vector data of each word frequency table Since the appearance frequency information of a word can be uniquely obtained by referring to the word correspondence table, it is possible to further speed up the processing. Further, in order to achieve the above object, a similar document search method according to the present invention provides, for each of the individual document data stored in a document database,
A step of creating a word frequency table by obtaining the appearance frequency of each preset search condition word; and for each document data stored in the document database, for each search condition word in the created word frequency table. Calculating a norm of a one-dimensional vector having an appearance frequency as an element to create a document norm table; and specifying document data to be searched and searched for from document data stored in the document database. , The similarity between the specified document data,
A step of calculating based on the word frequency table and the document norm table. The operation and effect of the present invention are equivalent to those of the first embodiment.

【0010】さらに、本発明の類似文書検索方法は、請
求項4に記載されるように、文書データベースに格納さ
れた個々の文書データごとに、予め設定された検索条件
単語ごとの出現頻度を求めて単語頻度表を作成する工程
と、文書データベースに格納された個々の文書データご
とに、前記作成された単語頻度表中の検索条件単語ごと
の出現頻度を要素とする1次元ベクトルのノルムを算出
して文書ノルム表を作成する工程と、前記文書データベ
ースに格納された文書データの中から検索対象および被
検索対象の文書データを指定する工程と、前記指定され
た各文書データに対して作成された各単語頻度表間の共
通単語の登録位置関係を示す単語対応表を作成する工程
と、前記指定された各文書データ間の類似度を、前記単
語頻度表、前記文書ノルム表および単語対応表に基づき
算出する工程とを有することを特徴とものであり、この
発明の作用、効果は請求項2の発明のそれと等価であ
る。
Further, according to the similar document search method of the present invention, the appearance frequency of each preset search condition word is determined for each document data stored in the document database. Creating a word frequency table, and calculating, for each document data stored in the document database, the norm of a one-dimensional vector having an appearance frequency for each search condition word in the created word frequency table as an element Creating a document norm table, specifying a search target and a search target document data from the document data stored in the document database, and generating a document norm table for each of the specified document data. Creating a word correspondence table indicating the registered positional relationship of common words between the respective word frequency tables, and calculating the similarity between the designated document data by using the word frequency table and the sentence. Is intended and characterized by a step of calculating, based on the norm table and word alignment table, the action of the present invention, the effect is the same equivalent of the invention of claim 2.

【0011】[0011]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0012】図1は本発明に係る一実施形態である類似
文書検索装置のハードウェア構成を示す図である。
FIG. 1 is a diagram showing a hardware configuration of a similar document search apparatus according to an embodiment of the present invention.

【0013】同図に示すように、この類似文書検索装置
は、入力装置1、表示装置2、制御装置3、メモリ4、
外部記憶装置5および通信装置6から構成され、各装置
は互いにバスを介して結合されている。
As shown in FIG. 1, the similar document search device includes an input device 1, a display device 2, a control device 3, a memory 4,
It comprises an external storage device 5 and a communication device 6, and each device is connected to each other via a bus.

【0014】入力装置1はキーボード、マウス、タブレ
ット或いはタッチパネルなどからなり、文字列を入力し
たり、本装置に各種のデータおよび命令の入力を行う。
表示装置2はCRT或いは液晶ディスプレイと表示コン
トローラなどからなり、検索結果やシステムからユーザ
への指示を表示する。制御装置3はCPUから構成さ
れ、各装置の制御、装置間のデータの転送などの処理を
行うものである。
The input device 1 is composed of a keyboard, a mouse, a tablet, a touch panel or the like, and inputs a character string and inputs various data and commands to the apparatus.
The display device 2 includes a CRT or a liquid crystal display and a display controller, and displays search results and instructions from the system to the user. The control device 3 is configured by a CPU, and performs processes such as control of each device and transfer of data between the devices.

【0015】メモリ4はRAMなどからなり、図2、図
3に示すように、制御装置3が各種制御や処理を実行す
るためのプログラムを格納するプログラム部と、処理の
際に必要なデータを格納するためのバッファ部からなっ
ている。
The memory 4 comprises a RAM or the like. As shown in FIGS. 2 and 3, the control device 3 stores a program for storing programs for executing various controls and processes, and stores data necessary for the processes. It consists of a buffer for storing.

【0016】プログラム部は、図2に示すように、単語
抽出処理のための単語抽出部10aのほか、図3に示す
ように、処理全体の制御を行うメイン処理部11a、メ
イン処理部11aで呼び出されるサブルーチンとして、
初期化部11b、ノルム計算部11c、単語対応表作成
部11d、類似度算出部11e、出力編集部11f、文
書一覧表示部11g、文書選択部11h、文書内容表示
部11iからなる。
The program section includes, as shown in FIG. 2, a main processing section 11a for controlling the entire processing, and a main processing section 11a for controlling the whole processing, as shown in FIG. As a called subroutine,
It comprises an initialization section 11b, a norm calculation section 11c, a word correspondence table creation section 11d, a similarity calculation section 11e, an output editing section 11f, a document list display section 11g, a document selection section 11h, and a document content display section 11i.

【0017】バッファ部は、図2に示すように、単語抽
出部10aの作業領域としての、入力文書データ格納バ
ッファ10b、単語ID−単語表格納バッファ10c、
単語頻度表格納バッファ10dおよび単語抽出表格納バ
ッファ10eからなる。また、メイン処理部11aの作
業領域として、図3に示すように、検索対象・単語頻度
表格納バッファ11j、被検索対象・単語頻度表格納バ
ッファ11k、文書ノルム表格納バッファ11l、単語
対応表格納バッファ11m、類似度算出結果格納バッフ
ァ11n、出力編集結果格納バッファ11oがある。
As shown in FIG. 2, the buffer unit includes an input document data storage buffer 10b, a word ID-word table storage buffer 10c, and a work area for the word extraction unit 10a.
It comprises a word frequency table storage buffer 10d and a word extraction table storage buffer 10e. As the work areas of the main processing unit 11a, as shown in FIG. 3, a search target / word frequency table storage buffer 11j, a search target / word frequency table storage buffer 11k, a document norm table storage buffer 111, a word correspondence table storage There is a buffer 11m, a similarity calculation result storage buffer 11n, and an output editing result storage buffer 11o.

【0018】入力文書データ格納バッファ10bには図
4に示すような文書データが格納される。図4において
A、B、Cは一文書の個々の節である。単語ID−単語
表格納バッファ10cには、図5に示すように単語ID
と単語との対応を示す形式の単語ID−単語表データが
格納される。単語頻度表格納バッファ10dには、図6
或いは図7に示すような形式の単語頻度表が格納され
る。検索対象・単語頻度表格納バッファ11jには、図
6に示すような形式の検索対象文書の単語頻度表が格納
される。被検索対象・単語頻度表格納バッファ11kに
は、図7に示すような形式の被検索対象文書の単語頻度
表が格納される。文書ノルム表格納バッファ11lに
は、図8に示すような形式の文書ノルム表が格納され
る。単語対応表格納バッファ11mには、図9に示すよ
うな形式の単語対応表が格納される。類似度算出結果格
納バッファ11nには、図10に示すような形式の類似
度算出結果が格納される。出力編集結果バッファ11o
には、図11に示すような形式の類似度算出結果の出力
編集結果が格納される。
The input document data storage buffer 10b stores document data as shown in FIG. In FIG. 4, A, B, and C are individual sections of one document. In the word ID-word table storage buffer 10c, as shown in FIG.
A word ID-word table data in a format indicating the correspondence between the word and the word is stored. In the word frequency table storage buffer 10d, FIG.
Alternatively, a word frequency table in a format as shown in FIG. 7 is stored. The search target / word frequency table storage buffer 11j stores a word frequency table of a search target document in a format as shown in FIG. The search target / word frequency table storage buffer 11k stores a word frequency table of the search target document in a format as shown in FIG. The document norm table storage buffer 111 stores a document norm table in a format as shown in FIG. The word correspondence table storage buffer 11m stores a word correspondence table in a format as shown in FIG. The similarity calculation result storage buffer 11n stores similarity calculation results in a format as shown in FIG. Output editing result buffer 11o
Stores an output editing result of a similarity calculation result in a format as shown in FIG.

【0019】バッファ部にはその他、作業用変数のため
の領域10f、11pが確保されている。これら作業用
変数のための領域内10f、11pには、後で述べる処
理で用いられる変数として、検索対象・単語頻度表の総
数dat、被検索対象・単語頻度表の総数dbt、総文
書数dt、現在参照中の検索対象・単語頻度表のIDと
してda、被検索対象・単語頻度表のIDとしてdbな
どが確保される。
In the buffer section, other areas 10f and 11p for working variables are secured. In the areas 10f and 11p for these work variables, variables used in the processing described later include the total number dat of the search target / word frequency table, the total number dbt of the search target / word frequency table, and the total number of documents dt. In addition, da is secured as the ID of the search target / word frequency table currently being referred to, and db is secured as the ID of the search target / word frequency table.

【0020】外部記憶装置5はハードディスク或いはフ
ラッシュメモリ或いは光磁気ディスクとコントローラか
らなり、文書データ、単語頻度表、単語抽出表などを格
納する。この外部記憶装置5に格納されている文書デー
タおよび単語頻度表の格納形式を図12に、単語抽出表
の格納形式を図13にそれぞれ示す。図12に示すよう
に、各文書データは、文書タイトル、ファイル作成日
時、作成者などの属性データなどを格納したへッダ部
と、文書を構成する文字コードデータであるテキストデ
ータ部からなっており、これらがID順に格納されてい
る。単語抽出表はテキストデータから単語頻度表を作成
する際に単語を抽出するために参照される。この単語抽
出表は例えばオペレータによって任意に設定される。
The external storage device 5 comprises a hard disk, a flash memory or a magneto-optical disk and a controller, and stores document data, a word frequency table, a word extraction table, and the like. FIG. 12 shows the storage format of the document data and the word frequency table stored in the external storage device 5, and FIG. 13 shows the storage format of the word extraction table. As shown in FIG. 12, each document data includes a header section storing attribute data such as a document title, a file creation date and time, and a creator, and a text data section which is character code data constituting the document. And these are stored in order of ID. The word extraction table is referred to when extracting a word when creating a word frequency table from text data. This word extraction table is arbitrarily set by, for example, an operator.

【0021】前記の図5に示した単語ID−単語表は、
図13の単語抽出表に基づいて作成されたものであり、
単語IDに対応する実際の単語が記述されている。この
単語ID−単語表は単語IDと単語との間の変換に用い
られるものである。
The word ID-word table shown in FIG.
It is created based on the word extraction table of FIG.
An actual word corresponding to the word ID is described. This word ID-word table is used for conversion between word IDs and words.

【0022】図6に示した単語頻度表は単語抽出処理に
よって個々の文書データから作成されたもので、この単
語頻度表には文書の構成要素である節ごとの、単語ID
−単語表に記述された単語ID(単語抽出表に記述され
た単語)に対応する単語の出現頻度が記述される。な
お、図6に示す単語頻度表の内容は図4に示した文書デ
ータを単語抽出処理した例である。この単語頻度表に
は、文書データの節A〜Zごとに単語出現頻度情報が記
述される。
The word frequency table shown in FIG. 6 is created from individual document data by a word extraction process. The word frequency table includes a word ID for each section which is a component of the document.
-The appearance frequency of the word corresponding to the word ID described in the word table (the word described in the word extraction table) is described. Note that the contents of the word frequency table shown in FIG. 6 are examples in which the document data shown in FIG. 4 is subjected to word extraction processing. In this word frequency table, word appearance frequency information is described for each of the nodes A to Z of the document data.

【0023】図8に示した文書ノルム表には、個々の単
語頻度表に対する、節(A〜Z)ごとのベクトルの大き
さ(ノルム)が記述される。
In the document norm table shown in FIG. 8, the magnitude (norm) of a vector for each clause (A to Z) for each word frequency table is described.

【0024】図9に示した単語対応表は類似度算出処理
が行われる際に一時的に作成される表である。この単語
対応表には、図6に示した検索対象文書の単語頻度表に
記載されている単語IDと、この単語IDと図7に示し
た被検索対象文書の単語頻度表における同一の単語ID
とを対応付けるための情報が記述されている。具体的に
は、検索対象文書と被検索対象文書において共通に存在
する単語IDの場合、前記対応付け情報として被検索対
象文書の単語頻度表上での当該単語IDのオフセット位
置が記述されている。被検索対象文書において存在しな
い単語IDの場合はこれを示す値(例えば(−1))が
記述される。この単語対応表は文書データ間の類似度算
出の際に内積を必要最小限の計算で求めることを目的と
して利用される。
The word correspondence table shown in FIG. 9 is a table temporarily created when the similarity calculation process is performed. In this word correspondence table, the word ID described in the word frequency table of the search target document shown in FIG. 6 and the same word ID in the word frequency table of the search target document shown in FIG.
And information for associating with. Specifically, in the case of a word ID that is commonly present in the search target document and the search target document, the offset position of the word ID on the word frequency table of the search target document is described as the association information. . In the case of a word ID that does not exist in the search target document, a value indicating this (for example, (-1)) is described. This word correspondence table is used for the purpose of calculating the inner product by the minimum necessary calculation when calculating the similarity between document data.

【0025】図10に示す類似度算出結果は、類似度算
出処理によって作成される表で、一つの検索対象文書に
対する各被検索対象文書の各々の類似度が記述される。
ここで、全ての被検索対象文書をr個のブロックに分割
したとき、1つの検索対象文書に対応する類似度算出結
果はr(図10の例では2)個作成される。すなわち、
図14(a)において、検索対象文書としてa1〜an
のn個、被検索対象文書としてbl〜bnのn個が与え
られているものとする。n=10とし、分割数r=2と
すると、1つのブロックの文書数は5となる。この例で
は、a1の検索対象文書に対し図14(c)に示すよう
に類似度算出結果としてo11(bl〜b5に対応する類
似度)とo12(bn−4〜bnに対応する類似度)の2
つが得られる。
The similarity calculation result shown in FIG. 10 is a table created by the similarity calculation process, and describes each similarity of each search target document with respect to one search target document.
Here, when all the search target documents are divided into r blocks, r (2 in the example of FIG. 10) similarity calculation results corresponding to one search target document are created. That is,
In FIG. 14A, as search target documents, a1 to an
, And n documents bl to bn are given as search target documents. Assuming that n = 10 and the number of divisions r = 2, the number of documents in one block is 5. In this example, as shown in FIG. 14C, as the similarity calculation results, o11 (similarity corresponding to bl to b5) and o12 (similarity corresponding to bn-4 to bn) are obtained for the search target document a1. 2
One is obtained.

【0026】通信装置6は、通信回線を介して外部とデ
ータのやり取りを行う装置であり、たとえばLAN回線
とLANコントローラ等から構成される。
The communication device 6 is a device for exchanging data with the outside via a communication line, and includes, for example, a LAN line and a LAN controller.

【0027】以下、本実施形態の動作について説明す
る。
The operation of this embodiment will be described below.

【0028】外部記憶装置5には図12に示すように、
文書IDが0〜nのn個の文書データと個々の文書デー
タに対応する単語頻度表が格納されているものとする。
As shown in FIG. 12, the external storage device 5
It is assumed that n document data having document IDs 0 to n and a word frequency table corresponding to each document data are stored.

【0029】この動作説明では、はじめに、本装置の全
体的な処理動作を説明し、その後で個々の重要な処理に
ついての詳細を説明することにする。
In the description of the operation, first, the overall processing operation of the present apparatus will be described, and then details of each important processing will be described.

【0030】本装置におけるプログラム処理は単語抽出
処理とメイン処理の2つからなる。単語抽出処理は文書
データから単語頻度表を作成する処理である。メイン処
理は単語抽出処理で作成された単語頻度表を用いて類似
文書の検索を行う処理である。したがって単語抽出処理
はメイン処理よりも前に行われる。
The program processing in the present apparatus includes two processes, a word extraction process and a main process. The word extraction process is a process for creating a word frequency table from document data. The main process is a process of searching for a similar document using the word frequency table created in the word extraction process. Therefore, the word extraction processing is performed before the main processing.

【0031】図15は単語抽出処理の全体的な手順を示
すフローチャートである。
FIG. 15 is a flowchart showing the overall procedure of the word extraction process.

【0032】単語抽出部10aは起動後直ちにバッファ
部10b〜10f内の各バッファをクリアする。また、
単語抽出部10aは外部記憶装置5に格納されている単
語抽出表(図13)を単語抽出表格納バッファ10d
に、単語ID−単語表(図5)を単語ID−単語表格納
バッファ10cにそれぞれ格納する(ステップS1)。
その際、単語抽出部10aは単語抽出表(図13)を参
照して単語ID−単語表の作成を行い、これを単語ID
−単語表格納バッファ10cに格納する。
The word extracting unit 10a clears the buffers in the buffer units 10b to 10f immediately after the activation. Also,
The word extraction unit 10a stores the word extraction table (FIG. 13) stored in the external storage device 5 in a word extraction table storage buffer 10d.
Then, the word ID-word table (FIG. 5) is stored in the word ID-word table storage buffer 10c (step S1).
At this time, the word extracting unit 10a creates a word ID-word table with reference to the word extraction table (FIG. 13), and
-Store in the word table storage buffer 10c.

【0033】次に、単語抽出部10aは外部記憶装置5
に格納された文書データを読み出し、この文書データに
対応する単語頻度表(図6、図7)を作成し、これを外
部記憶装置5に格納する(ステップS2)。全ての文書
データに対する単語頻度表の作成および格納を終えると
単語抽出処理を終了する(ステップS3)。
Next, the word extracting section 10a is connected to the external storage device 5
Is read out, word frequency tables (FIGS. 6 and 7) corresponding to the document data are created, and stored in the external storage device 5 (step S2). When the creation and storage of the word frequency tables for all the document data have been completed, the word extraction processing ends (step S3).

【0034】次に、メイン処理の動作を図16により説
明する。
Next, the operation of the main processing will be described with reference to FIG.

【0035】メイン処理部11aが起動されると、まず
初期化部11bにて各バッファ部11j〜11pのクリ
アや、検索対象文書と被検索対象文書の単語頻度表の数
を変数にセットするなど、類似文書検索に必要な各種の
初期化処理を行う(ステップS4)。
When the main processing unit 11a is started, the initialization unit 11b first clears each of the buffer units 11j to 11p, and sets the number of word frequency tables of the documents to be searched and the documents to be searched as variables. Then, various initialization processes necessary for similar document search are performed (step S4).

【0036】この後、ノルム計算部11cが起動され
る。ノルム計算部11cは各単語頻度表に格納された検
索対象文書および被検索対象文書の各節ごとに、単語I
Dごとの単語出現頻度を要素とする1次元ベクトルのノ
ルム(=ベクトルの大きさ)を計算し、文書ノルム表格
納バッファ11l上に文書ノルム表を作成して外部記憶
装置5へ出力する(ステップS5)。
Thereafter, the norm calculation unit 11c is started. The norm calculation unit 11c calculates the word I for each section of the search target document and the search target document stored in each word frequency table.
The norm (= vector size) of a one-dimensional vector having the word appearance frequency as an element for each D is calculated, a document norm table is created on the document norm table storage buffer 111, and output to the external storage device 5 (step). S5).

【0037】文書ノルム表が作成されると、メイン処理
部11aは初期化処理S4で指定された数の検索対象文
書の単語頻度表(図6)を外部記憶装置5から読み込
み、検索対象・単語頻度表格納バッファ11jに格納す
る(ステップS6)。次にメイン処理部11aは、指定
された数の被検索対象文書の単語頻度表(図7)を外部
記憶装置5から読み込み、被検索対象・単語頻度表格納
バッファ11kに格納する(ステップS7)。
When the document norm table is created, the main processing section 11a reads the word frequency table (FIG. 6) of the number of documents to be searched specified in the initialization processing S4 from the external storage device 5, and retrieves the words to be searched. The data is stored in the frequency table storage buffer 11j (step S6). Next, the main processing unit 11a reads the word frequency table (FIG. 7) of the designated number of documents to be searched from the external storage device 5 and stores it in the search object / word frequency table storage buffer 11k (step S7). .

【0038】この後、メイン処理部11aは検索対象・
単語頻度表格納バッファ11jと被検索対象・単語頻度
表格納バッファ11kから各々1つずつ単語頻度表を取
り出し、単語対応表作成部11dへ処理を渡す。単語対
応表作成部11dにて単語対応表(図9)が作成され、
単語対応表格納バッファ11mにこれが格納されると
(ステップS8)、メイン処理部11aは類似度算出部
11eに処理をわたす。類似度算出部11eは、単語対
応表と文書ノルム表を参照して、検索対象文書と被検索
対象文書の各単語頻度表の各節ごとに両者の類似度を算
出する。そして、節ごとの類似度の平均値をとるなどし
て文書間の類似度を算出し、この類似度算出結果を外部
記憶装置5へ出力する(ステップS9)。
Thereafter, the main processing unit 11a searches for
One word frequency table is extracted from each of the word frequency table storage buffer 11j and the search target / word frequency table storage buffer 11k, and the process is passed to the word correspondence table creating unit 11d. The word correspondence table creation unit 11d creates a word correspondence table (FIG. 9),
When this is stored in the word correspondence table storage buffer 11m (step S8), the main processing unit 11a passes the processing to the similarity calculation unit 11e. The similarity calculating unit 11e calculates the similarity between each of the word frequency tables of the search target document and the search target document with reference to the word correspondence table and the document norm table. Then, the similarity between the documents is calculated by, for example, averaging the similarity for each node, and the similarity calculation result is output to the external storage device 5 (step S9).

【0039】そして、検索対象・単語頻度表格納バッフ
ァ11jに格納されたすべて(指定数分)の検索対象文
書の単語頻度表について、検索対象・単語頻度表格納バ
ッファ11kに格納されたすべて(指定数分)の被検索
対象文書の単語頻度表との類似度算出が完了するまでス
テップS8、ステップS9を繰り返す(ステップS1
0)。
Then, with respect to the word frequency tables of all the documents to be searched (for the specified number) stored in the search target / word frequency table storage buffer 11j, all of the word storage tables (designated numbers) stored in the search target / word frequency table storage buffer 11k are stored. Steps S8 and S9 are repeated until the similarity calculation with the word frequency table of the searched document (several minutes) is completed (step S1).
0).

【0040】この後、次の指定数分の被検索対象文書の
単語頻度表を外部記憶装置5から読み込み、これらの単
語頻度表で被検索対象・単語頻度表格納バッファ11k
を書き換えて、検索対象・単語頻度表格納バッファ11
jに格納されたすべて(指定数分)の検索対象文書の単
語頻度表について、前記と同様に検索対象・単語頻度表
格納バッファ11kに格納されたすべて(指定数分)の
被検索対象文書の単語頻度表との類似度算出が完了する
までステップS7〜S10を繰り返す(ステップS1
1)。
Thereafter, the word frequency tables of the next specified number of documents to be searched are read from the external storage device 5, and the word frequency tables for the documents to be searched are stored in these word frequency tables.
Is rewritten, and the search target / word frequency table storage buffer 11
As for the word frequency tables of all (specified number of) search target documents stored in j, the search target / word frequency table storage buffer 11k stores all (specified number of) search target documents in the same manner as described above. Steps S7 to S10 are repeated until the calculation of the similarity with the word frequency table is completed (step S1).
1).

【0041】その後、次の指定数分の検索対象文書の単
語頻度表を外部記憶装置5から読み込み、これらの単語
頻度表で検索対象・単語頻度表格納バッファ11jを書
き替えて同様に類似度計算を行う(ステップS12)。
Thereafter, the word frequency tables of the next specified number of search target documents are read from the external storage device 5, and the search target / word frequency table storage buffer 11j is rewritten with these word frequency tables to similarly calculate the similarity. Is performed (step S12).

【0042】次に、このステップS6からS12までの
処理について図14を参照して具体的に説明する。
Next, the processing from steps S6 to S12 will be specifically described with reference to FIG.

【0043】まず、図14(a)の太線枠で囲まれてい
る範囲、つまり複数の検索対象文書の単語頻度表a1〜
a5と複数の被検索対象文書の単語頻度表b1〜b5を
メモリ上に一括して書き込み、先頭の検索対象文書の単
語頻度表a1 と各被検索対象文書の単語頻度表b1〜b
5との各々の類似度を計算して図10に示したような類
似度算出結果o11を出力する。続いて、図14(b)に
示すように、次の検索対象文書の単語頻度表a2と被検
索対象文書の単語頻度表b1〜b5との各々の類似度計
算を行って類似度算出結果o21を出力する。同様に検索
対象文書の単語頻度表a3,a4,a5と被検索対象文
書の単語頻度表b1〜b5との各々の類似度計算を行っ
て類似度算出結果o31,o41,o51を出力する。
First, the range surrounded by the thick line frame in FIG. 14A, that is, the word frequency tables a1 to a1 of a plurality of search target documents.
a5 and the word frequency tables b1 to b5 of a plurality of documents to be searched are collectively written in the memory, and the word frequency table a1 of the first document to be searched and the word frequency tables b1 to b of each document to be searched.
5 and outputs a similarity calculation result o11 as shown in FIG. Subsequently, as shown in FIG. 14B, the similarity calculation is performed for each of the word frequency table a2 of the next search target document and the word frequency tables b1 to b5 of the search target document, and the similarity calculation result o21 is obtained. Is output. Similarly, the similarity calculation is performed between the word frequency tables a3, a4, a5 of the search target document and the word frequency tables b1 to b5 of the search target document, and the similarity calculation results o31, o41, o51 are output.

【0044】次に、図14(c)に示すように、メモリ
上のb1〜b5の被検索対象文書の単語頻度表の確保領
域を解放し、そこにbn−4〜bnの被検索対象文書の
単語頻度表を書き込む。そして前記と同様に、検索対象
文書の単語頻度表a1〜a5と被検索対象文書の単語頻
度表bn−4〜bnとの各々類似度を計算して類似度算
出結果o12を出力する。
Next, as shown in FIG. 14C, the reserved area of the word frequency table of the search target documents b1 to b5 on the memory is released, and the search target documents bn-4 to bn are stored there. Write the word frequency table of Then, in the same manner as described above, the similarity between the word frequency tables a1 to a5 of the search target document and the word frequency tables bn-4 to bn of the search target document is calculated, and the similarity calculation result o12 is output.

【0045】さらにこの後、図14(d)に示すよう
に、メモリ上のa1〜a5の検索対象文書の単語頻度表
の確保領域を解放し、そこに次の指定数分の検索対象文
書の単語頻度表an−4〜anを書き込むとともに、メ
モリ上のbn−4〜bnの被検索対象文書の単語頻度表
の確保領域を解放し、そこに再び被検索対象文書の単語
頻度表b1〜b5を書き込み、前記と同様に検索対象文
書の単語頻度表an−4〜anと被検索対象文書の単語
頻度表b1〜b5との各々の類似度を計算し、続いてメ
モリ上の被検索対象文書の単語頻度表b1〜b5の確保
領域を解放してそこに被検索対象文書の単語頻度表bn
−4〜bnを書き込み、同様に類似度を計算する。
Thereafter, as shown in FIG. 14D, the reserved area of the word frequency table of the search target documents a1 to a5 in the memory is released, and the next specified number of search target documents are stored there. The word frequency tables an-4 to an are written, the reserved area of the word frequency table of the search target documents bn-4 to bn on the memory is released, and the word frequency tables b1 to b5 of the search target documents are re-stored there. Is written, and the similarities between the word frequency tables an-4 to an of the search target document and the word frequency tables b1 to b5 of the search target document are calculated in the same manner as described above. The reserved areas of the word frequency tables b1 to b5 are released, and the word frequency table bn of the search target document is stored therein.
-4 to bn are written, and the similarity is calculated in the same manner.

【0046】以上、外部記憶装置5に存在するすべての
検索対象文書の単語頻度表とすべての被検索対象文書の
単語頻度表との類似度が算出され、その類似度算出結果
が外部記憶装置5に記憶されると、メイン処理部11a
は出力編集部11fへ制御を移す。
As described above, the similarities between the word frequency tables of all the documents to be searched existing in the external storage device 5 and the word frequency tables of all the documents to be searched are calculated. Is stored in the main processing unit 11a
Transfers control to the output editing unit 11f.

【0047】出力編集部11fは、外部記憶装置5に格
納されている、個々の検索対象文書に対する全被検索対
象文書との間の類似度算出結果を順次読み込み、例えば
類似度の高いものを上位に配置するなどのソートを行
い、図11に示すような出力編集結果として外部記憶装
置5に格納する(ステップS13)。
The output editing unit 11f sequentially reads the similarity calculation results of the individual search target documents and all the search target documents stored in the external storage device 5, and, for example, ranks a higher similarity higher rank. Are stored in the external storage device 5 as output editing results as shown in FIG. 11 (step S13).

【0048】すべての検索対象文書に対応する出力編集
結果が外部記憶装置5に記憶されたところで、メイン処
理部11aは、図18に示すような文書一覧画面を文書
一覧表示部11gを介して表示装置2に出力し(ステッ
プS14)、引き続き文書選択部11hを起動する(ス
テップS15)。この文書一覧画面には、ユーザが検索
対象文書のIDを入力するための入力項目が設けられて
おり、この入力項目に文書選択部11hを通じて検索対
象文書ID(例えばa1)を入力することで、その検索
結果となる被検索対象文書IDの一覧と各々の類似度が
表示される。
When the output and editing results corresponding to all the search target documents are stored in the external storage device 5, the main processing section 11a displays a document list screen as shown in FIG. 18 via the document list display section 11g. The document is output to the device 2 (step S14), and the document selection unit 11h is subsequently activated (step S15). The document list screen is provided with input items for the user to input the ID of the search target document. By inputting the search target document ID (for example, a1) to the input item through the document selection unit 11h, A list of search target document IDs that are the search results and their similarities are displayed.

【0049】また、被検索対象文書IDに対応するチェ
ックボックスをマウスなどのポインティングディバイス
などで選択することにより、文書内容表示部11iが起
動され、図19に示すように、選択された文書の類似度
とその文書内容が表示される(ステップS16)。
By selecting a check box corresponding to the search target document ID with a pointing device such as a mouse, the document content display section 11i is activated and, as shown in FIG. The degree and the contents of the document are displayed (step S16).

【0050】これら類似検索結果の表示処理は、図18
または図19に示す画面左上のクローズボックスをポイ
ンティングディバイスなどで選択することで終了する
(ステップS17)。
The display processing of these similar search results is shown in FIG.
Alternatively, the process ends by selecting a close box at the upper left of the screen shown in FIG. 19 with a pointing device or the like (step S17).

【0051】次に、ステップS2の単語抽出処理、ステ
ップS4の初期化処理、ステップS5のノルム計算処
理、ステップS8の単語対応表作成処理、ステップS9
の類似度算出処理、ステップS13の出力編集処理につ
いて具体的に説明する。
Next, a word extraction process in step S2, an initialization process in step S4, a norm calculation process in step S5, a word correspondence table creation process in step S8, and a step S9
The similarity calculation process and the output editing process in step S13 will be specifically described.

【0052】まず、ステップS2の単語抽出処理につい
て説明する。図20はステップS2の単語抽出処理を示
す詳細フローチャートである。
First, the word extraction process in step S2 will be described. FIG. 20 is a detailed flowchart showing the word extraction processing in step S2.

【0053】外部記憶装置5に文書データが格納された
状態で、初期化処理ステップS1で文書数などの環境が
設定されると単語抽出部10aが起動する。単語抽出部
10aは指定された入力文書データを入力文書データ格
納バッファ10bに格納する(ステップS21)。次
に、単語抽出部10aは単語抽出表を参照し、入力文書
データ中から単語抽出表に含まれる単語を抽出して作業
用領域に格納する(ステップS22)。
When the environment such as the number of documents is set in the initialization processing step S1 in a state where the document data is stored in the external storage device 5, the word extracting unit 10a starts. The word extracting unit 10a stores the specified input document data in the input document data storage buffer 10b (Step S21). Next, the word extracting unit 10a refers to the word extraction table, extracts words included in the word extraction table from the input document data, and stores the words in the work area (step S22).

【0054】次に、単語抽出部10aは単語ID−単語
表を参照し、抽出された単語が既に単語ID−単語表に
登録されていなければ制御をステップS25へ移し、登
録されていれば制御をステップS24へ移す(ステップ
S23)。ステップS24では、単語ID−単語表に未
登録の単語の追加処理を行う。また、該当の単語に対し
て新規の単語IDを発行する(ステップS24)。ステ
ップS22で格納された単語は、単語ID−単語表に基
づいて単語IDに置き換えられる(ステップS25)。
Next, the word extracting section 10a refers to the word ID-word table, and if the extracted word is not already registered in the word ID-word table, shifts the control to step S25. To step S24 (step S23). In step S24, a process of adding a word that has not been registered in the word ID-word table is performed. Further, a new word ID is issued for the corresponding word (step S24). The word stored in step S22 is replaced with a word ID based on the word ID-word table (step S25).

【0055】次に、単語抽出部10aは作業領域に格納
された単語を再集計し、文書データの節ごとに単語(単
語抽出表に含まれる単語と同じ単語)の出現頻度を調
べ、その結果を単語頻度表格納バッファ11mに書き込
む(ステップS26)。そして文書データのすべての節
について単語出現頻度の算出および算出結果の書き込み
が完了したところで次のステップ28に移行する(ステ
ップS27)。最後に、単語抽出部10aは単語頻度表
格納バッファ11mに書き込まれた内容を単語頻度表と
して外部記憶装置5に出力する(ステップS28)。
Next, the word extraction unit 10a recounts the words stored in the work area, checks the appearance frequency of the word (the same word as the word included in the word extraction table) for each section of the document data, and as a result, Is written into the word frequency table storage buffer 11m (step S26). When the calculation of the word appearance frequency and the writing of the calculation result have been completed for all the sections of the document data, the process proceeds to the next step 28 (step S27). Finally, the word extraction unit 10a outputs the contents written in the word frequency table storage buffer 11m to the external storage device 5 as a word frequency table (Step S28).

【0056】次に、ステップS4の初期化処理について
説明する。図21はこの初期化処理の詳細を示すフロー
チャートである。
Next, the initialization processing in step S4 will be described. FIG. 21 is a flowchart showing details of the initialization processing.

【0057】外部記憶装置5に単語頻度表が格納される
と、メイン処理部11aは初期化部11bへ制御を移
す。初期化部11bは作業用変数のための領域11p
に、作業用変数として検索対象文書と被検索対象文書の
各単語頻度表格納バッファ11j,11kに単語頻度表
を格納する際に、1回に読み込む文書数:sep、検索
対象・単語頻度表の総数:dat、被検索対象・単語頻
度表の総数:dbt、単語頻度表の総数:dt、計算対
象となる検索対象・単語頻度表のID:da、計算対象
となる被検索対象・単語頻度表のID:dbを用意す
る。また、これらの変数に初期値を代入する。本実施形
態では、読み込む文書数sepに5、それ以外の変数0
を代入する(ステップS41)。
When the word frequency table is stored in the external storage device 5, the main processing unit 11a transfers control to the initialization unit 11b. The initialization unit 11b stores an area 11p for a work variable.
When storing the word frequency tables in the word frequency table storage buffers 11j and 11k of the search target document and the search target document as work variables, the number of documents read at one time: sep, and the search target / word frequency table Total number: dat, total number of search target / word frequency tables: dbt, total number of word frequency tables: dt, ID of search target / word frequency table to be calculated: da, target search / word frequency table to be calculated ID: db is prepared. In addition, initial values are assigned to these variables. In the present embodiment, the number of documents to be read sep is 5, and other variables are 0.
Is substituted (step S41).

【0058】この後、初期化部11bは外部記憶装置5
中の検索対象文書の単語頻度表の数を調べ、その値を検
索対象・単語頻度表の総数datへ代入する(ステップ
S42)。さらに、初期化部11bは外部記憶装置5中
の被検索対象文書の単語頻度表の数を調べ、被検索対象
・単語頻度表の総数dbtへ代入する(ステップS4
3)。最後に、初期化部11bは、検索対象・単語頻度
表の総数datと、被検索対象・単語頻度表の総数db
tの和を単語頻度表の総数dtへ代入する(ステップS
44)。
Thereafter, the initialization unit 11b stores the external storage device 5
The number of word frequency tables of the search target document is checked, and the value is substituted for the total number dat of the search target / word frequency table (step S42). Further, the initialization unit 11b checks the number of word frequency tables of the search target document in the external storage device 5 and substitutes it into the total number dbt of the search target / word frequency tables (step S4).
3). Finally, the initialization unit 11b calculates the total number dat of the search target / word frequency table and the total number db of the search target / word frequency table.
t is substituted for the total number dt of the word frequency table (step S
44).

【0059】次に、ステップS5のノルム計算処理につ
いて説明する。図22はこのノルム計算処理の詳細を示
すフローチャートである。
Next, the norm calculation processing in step S5 will be described. FIG. 22 is a flowchart showing details of the norm calculation processing.

【0060】ノルムとは、1次元の行列をA=[a1,
a2,…,an]としたとき、
The norm means that a one-dimensional matrix is represented by A = [a1,
a2, ..., an],

【数1】 で表せられる値のことである。本実施形態では、1つの
文書データが複数の節に分割されるため、文書ノルム表
の文書IDごとに節の数と等しいp個のノルムが計算さ
れる。
(Equation 1) Is the value represented by In the present embodiment, since one document data is divided into a plurality of sections, p norms equal to the number of sections are calculated for each document ID in the document norm table.

【0061】ノルム計算処理は次のようにして行われ
る。初期化部11bの処理が終わるとメイン処理部11
aに制御が戻され、メイン処理部11aはノルム計算部
11cへ制御を移す。ノルム計算部11cは、作業用変
数のための領域11pに、作業用変数として、参照中の
節:p、節の総数:pt、参照中の単語ID:q、単語
の総数:qt、参照中の文書:d、参照中の単語出現頻
度:f、作業用:w、ノルム:normを用意する。ま
た、これらの変数に初期値0を代入する(ステップS5
01)。
The norm calculation processing is performed as follows. When the processing of the initialization unit 11b is completed, the main processing unit 11
The control is returned to a, and the main processing unit 11a transfers the control to the norm calculation unit 11c. The norm calculation unit 11c stores, in the area 11p for the working variable, as the working variable, the clause being referred to: p, the total number of clauses: pt, the word ID being referenced: q, the total number of words: qt, Document: d, frequency of appearance of the word being referred to: f, work: w, norm: norm. Further, the initial value 0 is substituted into these variables (step S5).
01).

【0062】次に、ノルム計算部11cは外部記憶装置
5から文書ノルムを読み出し、文書ノルム表格納バッフ
ァ11lヘ格納する(ステップS502)。続いてノル
ム計算部11cは、外部記憶装置5に格納されたd番目
の単語頻度表を、検索対象・単語頻度表格納バッファ1
1jに書き込む(ステップS503)。さらにノルム計
算部11cは検索対象・単語頻度表格納バッファ11j
から節の総数と単語の総数を読み出し、それぞれ変数p
t、qtへ代入する(ステップS504)。
Next, the norm calculation unit 11c reads out the document norm from the external storage device 5 and stores it in the document norm table storage buffer 111 (step S502). Subsequently, the norm calculation unit 11c stores the d-th word frequency table stored in the external storage device 5 in the search target / word frequency table storage buffer 1.
1j (step S503). Further, the norm calculation unit 11c stores a search target / word frequency table storage buffer 11j.
Read the total number of clauses and the total number of words from
Substitute t and qt (step S504).

【0063】続いて、ノルム計算部11cは指定された
節:p、単語ID:qごとの単語出現頻度を調べ、単語
出現頻度:fへ代入する(ステップS505)。また、
指定された節:pのノルムを求めるため、指定された単
語ID:qの単語出現頻度fを2乗した値を作業変数w
に累積加算して行く(ステップS506)。さらに、単
語IDを進めるためqの値を1加算する(ステップS5
07)。そして指定する節の単語すべてが参照されるま
でステップS505〜S507を繰り返す(ステップS
508)。
Subsequently, the norm calculation unit 11c checks the word appearance frequency for each of the designated clause: p and the word ID: q, and substitutes the word appearance frequency for f (step S505). Also,
To find the norm of the specified clause: p, the value obtained by squaring the word appearance frequency f of the specified word ID: q is used as the work variable w.
(Step S506). Further, the value of q is incremented by 1 to advance the word ID (step S5).
07). Steps S505 to S507 are repeated until all the words of the designated section are referred to (step S505).
508).

【0064】次に、ノルム計算部11cは節pのノルム
の計算する。節pのノルムはnorm←W1/2 によって
求められ、求められた節pのノルムは文書ノルム表格納
バッファ11lの該当する箇所へ格納される(ステップ
S509)。続いて次の節のノルムを計算するため、単
語qとノルム作業領域wをクリアする(ステップS51
0)。全ての節のノルム計算が終了したならば制御をス
テップS512へ移す(ステップS511)。ステップ
S512では、次の文書ΙDを進めるためにdの値を1
つ進める。全ての文書について以上のノルム計算を終了
したところで制御がステップS514に移り(ステップ
S513)、最後に、文書ノルム表格納バッファ11l
の内容を文書ノルム表として外部記憶装置5へ出力(ス
テップS514)。
Next, the norm calculator 11c calculates the norm of the node p. The norm of the node p is obtained by norm ← W 1/2 , and the obtained norm of the node p is stored in a corresponding portion of the document norm table storage buffer 111 (step S509). Subsequently, to calculate the norm of the next section, the word q and the norm work area w are cleared (step S51).
0). When the norm calculation for all the nodes is completed, the control is moved to step S512 (step S511). In step S512, the value of d is set to 1 in order to advance the next document $ D.
Go forward. When the above-described norm calculation is completed for all the documents, the control proceeds to step S514 (step S513), and finally, the document norm table storage buffer 111
Is output to the external storage device 5 as a document norm table (step S514).

【0065】次に、ステップS8の単語対応表作成処理
について説明する。図23はこの単語対応表作成処理の
詳細を示すフローチャートである。
Next, the word correspondence table creation processing in step S8 will be described. FIG. 23 is a flowchart showing details of the word correspondence table creation processing.

【0066】外部記憶装置5に文書ノルム表が格納され
ると、メイン処理部11aは単語対応表作成部11dヘ
制御を移す。単語対応表作成部11dはステップS4で
指定された、検索対象・単語頻度表のID:da、被検
索対象・単語頻度表のID:dbの値を受けとる。この
値は、単語対応表作成時に参照される単語頻度表の文書
IDである(ステップS801)。
When the document norm table is stored in the external storage device 5, the main processing section 11a transfers control to the word correspondence table creating section 11d. The word correspondence table creating unit 11d receives the values of the ID of the search target / word frequency table: da and the ID of the search target / word frequency table: db specified in step S4. This value is the document ID of the word frequency table that is referred to when creating the word correspondence table (step S801).

【0067】次に、単語対応表作成部11dは単語対応
表格納バッファ11m内に、図9に示したように、検索
対象文書の単語頻度表中で使われている単語数と同数の
単語対応表を作成し、被検索対象文書中の単語IDの位
置情報欄をすべて初期値(例では(−1))で埋める
(ステップS802)。
Next, as shown in FIG. 9, the word correspondence table creator 11d stores, in the word correspondence table storage buffer 11m, the same number of word correspondences as the number of words used in the word frequency table of the search target document. A table is created, and the position information fields of the word IDs in the search target document are all filled with initial values ((-1) in the example) (step S802).

【0068】続いて、単語対応表作成部11dは検索対
象・単語頻度表格納バッファ11jから検索対象文書I
D=daの単語頻度表と、被検索対象・単語頻度表格納
バッファ11kから被検索対象文書ID=dbの単語頻
度表を各々参照する。ここでは、検索対象・単語頻度表
と被検索対象・単語頻度表中で使われている単語のマッ
チングをとり、検索対象・単語頻度表中の単語が被検索
対象・単語頻度表中に含まれている場合はその単語の被
検索対象・単語頻度表中での位置情報を単語対応表格納
バッファ11mの単語対応表に書き込み、検索対象・単
語頻度表中の単語が被検索対象・単語頻度表中に含まれ
ていない場合は「参照先なし」を示す任意の値(例では
(−1))を単語対応表に書き込む(ステップS80
3)。
Subsequently, the word correspondence table creator 11d stores the search target document I from the search target / word frequency table storage buffer 11j.
Reference is made to the word frequency table of D = da and the word frequency table of the search target document ID = db from the search target / word frequency table storage buffer 11k. Here, the words used in the search target / word frequency table are matched with the words used in the search target / word frequency table, and the words in the search target / word frequency table are included in the search target / word frequency table. If it is found, the position information of the word in the search target / word frequency table is written into the word correspondence table of the word correspondence table storage buffer 11m, and the word in the search target / word frequency table becomes the search target / word frequency table. If not included, an arbitrary value (in the example, (-1)) indicating "no reference destination" is written in the word correspondence table (step S80).
3).

【0069】そして単語対応表作成部11dは検索対象
・単語頻度表の単語数または、被検索対象・単語頻度表
の単語数のどちらかがなくなったらステップS805へ
制御を進める。それ以外は、ステップS803を繰り返
すためにステップS803へ制御を戻す(ステップS8
04)。また、単語対応表作成部11dは検索対象・単
語頻度表の単語数が被検索対象・単語頻度表の単語数よ
り多いときはステップS806へ制御を移し、それ以外
はステップS9へ制御を移す(ステップS805)。
If there is no longer any of the number of words in the search target / word frequency table or the number of words in the search target / word frequency table, the word correspondence table creating unit 11d advances the control to step S805. Otherwise, control is returned to step S803 to repeat step S803 (step S8
04). When the number of words in the search target / word frequency table is larger than the number of words in the search target / word frequency table, the word correspondence table creating unit 11d transfers control to step S806, and otherwise transfers control to step S9 ( Step S805).

【0070】検索対象・単語頻度表の単語数が被検索対
象・単語頻度表の単語数よりも多い場合、単語対応表作
成部11dは、単語対応表格納バッファ11mの単語対
応表に空欄ができている箇所に対してステップS803
と同様に「参照先なし」を示す任意の値を書き込む(ス
テップS806)。
When the number of words in the search target / word frequency table is larger than the number of words in the search target / word frequency table, the word correspondence table creating unit 11d leaves a blank in the word correspondence table of the word correspondence table storage buffer 11m. Step S803
An arbitrary value indicating "no reference destination" is written in the same manner as (1) (step S806).

【0071】次に、ステップS9の類似度算出処理につ
いて説明する。図24、図25はこの類似度算出処理の
詳細を示すフローチャートである。
Next, the similarity calculation processing in step S9 will be described. FIG. 24 and FIG. 25 are flowcharts showing details of the similarity calculation processing.

【0072】文書類似度sは、類似度:s、各節の類似
度sp、節の数i、各節の検索対象・単語出現頻度を要
素とするベクトルをfap、各節の被検索対象・単語出
現頻度を要素とするベクトルをfbpとするとき、
The document similarity s is a similarity: s, the similarity sp of each section, the number of sections i, the search target of each section, a vector having the word appearance frequency as an element, and the search target of each section When a vector having a word appearance frequency as an element is fbp,

【数2】 で表される。(Equation 2) It is represented by

【0073】単語対応表格納バッファ11mに単語対応
表が格納されると、メイン処理部11aは類似度算出部
11eへ制御を移す。類似度算出部11eは作業用変数
のための領域11pに、作業用変数として、参照中の
節:p、節の総数:pt、参照中の単語ID:q、単語
の総数:qt、検索対象文書の単語出現頻度:fa、被
検索対象文書の単語出現頻度:fb、作業用:w、検索
対象文書のノルム作業用:norma、被検索対象文書
のノルム作業用:normb、文書類似度:sと、大き
さptの配列として、内積:innprd[pt]、節
ごとの類似度:sp[pt]を用意し、これらの変数に
初期値を代入する(ステップS901)。
When the word correspondence table is stored in the word correspondence table storage buffer 11m, the main processing unit 11a transfers control to the similarity calculation unit 11e. The similarity calculating unit 11e stores, as working variables, in the area for working variables 11p, the section being referred to: p, the total number of sections: pt, the word ID being referred to: q, the total number of words: qt, and the search target. Word appearance frequency of document: fa, word appearance frequency of search target document: fb, work: w, norm work of search target document: norma, norm work of search target document: normb, document similarity: s And an inner product: innprd [pt] and a similarity per node: sp [pt] as an array of size pt, and assign initial values to these variables (step S901).

【0074】次に、類似度算出部11eはステップS4
で指定された、検索対象・単語頻度表の文書ID:d
a、被検索対象・単語頻度表の文書ID:dbの値を受
けとる。この文書IDはステップS8で受け取った文書
IDと同じものである(ステップS902)。
Next, the similarity calculating section 11e proceeds to step S4
The document ID of the search target / word frequency table specified in the above: d
a, The value of the document ID: db of the search target / word frequency table is received. This document ID is the same as the document ID received in step S8 (step S902).

【0075】続いて、類似度算出部11eはステップS
8で単語対応表格納バッファ11mに作成した単語対応
表を参照し、節p、単語qにおける、検索対象・単語頻
度表中の位置情報を読みとる。この位置情報が「参照先
なし(−1)」である場合は、制御をステップS904
へ移し、それ以外の場合は制御をステップS905へ移
す(ステップS903)。
Subsequently, the similarity calculating section 11e determines in step S
Referring to the word correspondence table created in the word correspondence table storage buffer 11m in step 8, the position information in the search target / word frequency table in the section p and the word q is read. If the position information is “no reference destination (−1)”, control is performed in step S904.
Otherwise, control is passed to step S905 (step S903).

【0076】ステップS903において、参照先が「参
照先なし」のとき、類似度算出部11eは節p、単語q
における、検索対象文書の単語出現頻度を格納する変数
faに0を代入する(ステップS904)。また、ステ
ップS903において、参照先に「参照先なし」以外の
何らかの値が入っているとき、類似度算出部11eは節
p,単語qにおける検索対象文書の単語出現頻度fa
に、その検索対象文書の単語出現頻度を、また被検索対
象文書の単語出現頻度fbには、被検索対象文書の単語
出現頻度をそれぞれ代入する(ステップS905)。
If the reference destination is “no reference destination” in step S 903, the similarity calculation unit 11 e sets the node p, the word q
In step S904, 0 is substituted for a variable fa for storing the word appearance frequency of the search target document. In step S903, when the reference destination includes any value other than “no reference destination”, the similarity calculation unit 11e determines the word appearance frequency fa of the search target document in the node p and the word q.
Then, the word appearance frequency of the search target document is substituted for the search target document, and the word appearance frequency of the search target document is substituted for the word appearance frequency fb of the search target document (step S905).

【0077】検索対象文書の単語出現頻度faおよび被
検索対象文書の単語出現頻度fbがセットされると、類
似度算出部11eは節ごとの内積を計算する。節の内積
innprd[p]は innprd[p]←innprd[p]+fa×fb で表される(ステップS906)。
When the word appearance frequency fa of the search target document and the word appearance frequency fb of the search target document are set, the similarity calculator 11e calculates the inner product of each node. The inner product of nodes innprd [p] is expressed by innprd [p] ← innprd [p] + fa × fb (step S906).

【0078】また、類似度算出部11eは単語頻度表の
すべての節の内積を計算したならばステップS908
へ、計算途中であればステップS903へ制御を移す
(ステップS907)。さらに、類似度算出部11eは
単語頻度表のすべての単語について計算を完了したなら
ばステップS909へ、計算途中であればステップS9
03へ制御を移す(ステップS908)。
If the similarity calculation unit 11e calculates the inner product of all the clauses of the word frequency table, the process proceeds to step S908.
If the calculation is in progress, control is transferred to step S903 (step S907). Further, the similarity calculation unit 11e proceeds to step S909 if the calculation has been completed for all the words in the word frequency table, and proceeds to step S9 if the calculation is in progress.
The control is shifted to 03 (step S908).

【0079】以上までが節ごとの類似度の分子に関する
計算である。次に分母に関する計算を行う。
The above is the calculation of the numerator of the similarity for each node. Next, calculation regarding the denominator is performed.

【0080】まず、類似度算出部11eはステップS5
で計算した文書ノルム表を参照し(ステップ909)、
文書ID=da、節pにおけるノルムを変数norma
に、文書ID=db、節pにおけるノルムを変数nor
mbにそれぞれ代入する(ステップ910)。
First, the similarity calculating section 11e determines in step S5
With reference to the document norm table calculated in step (909),
Document ID = da, norm in section p is set to variable norma
And the norm in the document ID = db and the section p is set to the variable nor
mb (step 910).

【0081】次に、類似度算出部11eは節pの類似度
sp[p]を求める。節pの類似度sp[p]は、ステ
ップS906で計算したinnprd[p]と、ステッ
プS910のnorma、normbから、 sp[p]←innprd[p]/(norma×no
rmb) で求められる(ステップS911)。
Next, the similarity calculating section 11e obtains the similarity sp [p] of the node p. The similarity sp [p] of the node p is calculated from spnprd [p] calculated in step S906 and norma and normb in step S910, as follows: sp [p] ← inprd [p] / (norma × no)
rmb) (step S911).

【0082】続いて類似度算出部11eは節pのチェッ
クを行い、全ての節の類似度が求められていないときは
制御をステップS901へ戻し、全ての節の類似度が求
められたときは制御をステップS913へ進める(ステ
ップS912)。
Subsequently, the similarity calculating unit 11e checks the node p. If the similarities of all the nodes have not been obtained, the control returns to step S901. If the similarities of all the nodes have been obtained, the control returns to step S901. The control proceeds to step S913 (step S912).

【0083】ここで文書の類似度を求める。ここで、総
節数:pt、節:p、節pの類似度:sp[p]とする
と、文書類似度sは
Here, the similarity of the document is obtained. Here, assuming that the total number of sections is pt, the section is p, and the similarity of the section p is sp [p], the document similarity s is

【数3】 により求められる(ステップS913)。(Equation 3) (Step S913).

【0084】最後に類似度算出部11eは、ステップS
913で求めた文書類似度sを被検索対象となった文書
IDと共に外部記憶装置5へ類似度算出結果として出力
する(ステップS914)。
Finally, the similarity calculating section 11e determines in step S
The document similarity s obtained in 913 is output as a similarity calculation result to the external storage device 5 together with the document ID of the search target (step S914).

【0085】次に、ステップS13の出力編集処理につ
いて説明する。図26はこの出力編集処理の詳細を示す
フローチャートである。
Next, the output editing process in step S13 will be described. FIG. 26 is a flowchart showing details of the output editing process.

【0086】出力編集部11fは外部記憶装置5に格納
された、複数に分割された類似度算出結果を1つの出力
編集結果として出力する。ここで出力編集部11fの役
割を説明する。
The output editing unit 11f outputs a plurality of divided similarity calculation results stored in the external storage device 5 as one output editing result. Here, the role of the output editing unit 11f will be described.

【0087】本方式では図14(b)に示したように、
検索対象文書a1と各被検索対象文書b1〜bnとの類
似度算出結果はo11とo12の2ファイルとなる。このた
め複数に分割された類似度算出結果を1つの出力編集結
果として統合するための処理が必要となる。
In this method, as shown in FIG.
The similarity calculation results of the search target document a1 and the search target documents b1 to bn are two files o11 and o12. For this reason, a process for integrating the plurality of divided similarity calculation results into one output editing result is required.

【0088】まず、全ての類似度算出結果が外部記憶装
置5に格納されると、メイン処理部11aは出力編集部
11fへ制御を移す。出力編集部11fは分割された類
似度算出結果を外部記憶装置5から読み込んで類似度算
出結果格納バッファ11nへ書き込む(ステップS13
1)。
First, when all the similarity calculation results are stored in the external storage device 5, the main processing section 11a transfers control to the output editing section 11f. The output editing unit 11f reads the divided similarity calculation result from the external storage device 5 and writes it into the similarity calculation result storage buffer 11n (step S13).
1).

【0089】次に、出力編集部11fは各類似度算出結
果に付された分割番号(類似度算出結果を2ファイルに
分割した場合、最初の類似度算出結果の分割番号は1、
次の類似度算出結果の分割番号は2となる。)rのチェ
ックを行う。総分割数がdrであるとき、分割番号r<
drの間は制御をステップS131へ戻し、それ以外は
制御をS133へ進める(ステップS132)。図14
の例ではo11→o12の順番で類似度算出結果が読み込ま
れる。
Next, the output editing unit 11f determines the division number assigned to each similarity calculation result (when the similarity calculation result is divided into two files, the division number of the first similarity calculation result is 1,
The division number of the next similarity calculation result is 2. ) Check r. When the total number of divisions is dr, the division number r <
During dr, the control returns to step S131, and otherwise, the control proceeds to S133 (step S132). FIG.
In the example, the similarity calculation result is read in the order of o11 → o12.

【0090】分割された類似度算出結果が類似度算出結
果格納バッファ11nに全て格納されと、出力編集部1
1fは文書類似度をキーにソートを行い(ステップS1
33)、出力編集結果(図11)を出力編集結果格納バ
ッファ11oに書き込み後、外部出力装置5に出力する
(ステップS134)。
When all of the divided similarity calculation results are stored in the similarity calculation result storage buffer 11n, the output editing unit 1
1f performs sorting using the document similarity as a key (step S1).
33), the output editing result (FIG. 11) is written to the output editing result storage buffer 11o, and then output to the external output device 5 (step S134).

【0091】本実施形態では、図14(c)の類似度算
出結果o11に相当する類似度算出結果を図10の「a1
#1」、o12に相当する類似度算出結果を図10の「a
1#2」とするとき、図11に示すような出力編集結果
が得られる。すなわち、類似度が高い順に各情報が並び
換えられる。
In this embodiment, the similarity calculation result corresponding to the similarity calculation result o11 in FIG.
# 1 ”, the similarity calculation result corresponding to o12 is represented by“ a ”in FIG.
1 # 2 ", an output editing result as shown in FIG. 11 is obtained. That is, the pieces of information are rearranged in descending order of similarity.

【0092】さらに、出力編集部11fは外部出力装置
5内から、ステップS131、S132で読み込んだ類
似度算出結果を削除する(ステップS135)。最後
に、すべての類似度算出結果が出力編集処理されたかを
チェックし。出力編集処理が処理中のときは制御をステ
ップS131へ戻し、それ以外は制御をS14へ進める
(ステップS136)。
Further, the output editing unit 11f deletes the similarity calculation result read in steps S131 and S132 from the external output device 5 (step S135). Finally, check whether all the similarity calculation results have been output edited. If the output editing process is in progress, the control returns to step S131, otherwise the control proceeds to S14 (step S136).

【0093】このように本実施形態の類似文書検索装置
は、文書データ中の特定の単語(単語抽出表の単語)の
出現頻度を考慮した、従来よりも信頼性に優れた類似文
書検索が可能となるとともに、同時に複数の検索対象文
書と複数の被検索対象文書を対象とした類似文書検索を
高効率にかつ高精度に行うことが可能となる。
As described above, the similar document search apparatus of the present embodiment can perform a similar document search with higher reliability than the conventional one in consideration of the frequency of occurrence of a specific word (word in the word extraction table) in the document data. At the same time, a similar document search for a plurality of search target documents and a plurality of search target documents can be performed with high efficiency and high accuracy.

【0094】また、外部記憶装置5に記憶された各文書
データについて単語頻度表と文書ノルム表を予め作成し
ておき、検索対象および被検索対象の各文書が指定され
たところで各文書の単語頻度表および文書ノルム表を参
照して文書データ間の類似度計算を行うことで、連続し
て複数の検索対象文書と複数の被検索対象文書との類似
度を算出する場合、すなわち1つの検索対象文書と各被
検索対象文書との類似度計算を行った後、次の1つの検
索対象文書と各被検索対象文書との類似度計算を行う場
合に、単語頻度表の作成やノルムの計算を重複して行う
必要がなくなり、高速な処理が可能となる。
In addition, a word frequency table and a document norm table are created in advance for each document data stored in the external storage device 5, and the word frequency of each document is specified when each of the documents to be searched and searched is specified. When the similarity between document data is calculated by referring to the table and the document norm table, the similarity between a plurality of search target documents and a plurality of search target documents is continuously calculated, that is, one search target After calculating the similarity between a document and each document to be searched and then calculating the similarity between the following one document to be searched and each document to be searched, it is necessary to create a word frequency table and calculate the norm. There is no need to perform the processing repeatedly, and high-speed processing can be performed.

【0095】さらに、本実施形態においては、検索対象
文書と被検索対象文書との類似度算出において、各単語
頻度表のベクトルデータの内積計算に必要な、検索対象
文書の単語頻度表と被検索対象文書の単語頻度表との間
での共通単語についての出現頻度情報を単語対応表を参
照することによって一意に得られるので、より一層の処
理の高速化を図ることができる。
Further, in this embodiment, in calculating the similarity between the search target document and the search target document, the word frequency table of the search target document and the search target document required for the inner product of the vector data of each word frequency table are calculated. Since the appearance frequency information about the common word with the word frequency table of the target document can be uniquely obtained by referring to the word correspondence table, it is possible to further speed up the processing.

【0096】さらに、本実施形態においては、図14に
て説明したように、検索対象文書と被検索対象文書の各
単語頻度表を複数個のグループ単位で外部記憶装置5か
らメモリ上に呼び出して、可能な限りの組み合わせで検
索対象文書と被検索対象文書との類似度計算を行い、引
き続き次のグループの検索対象文書と被検索対象文書の
各単語頻度表をメモリ上に呼び出して(書き替えて)同
様に類似度計算を行うようにしたことで、外部記憶装置
5のアクセス回数を減らすことができる。
Further, in this embodiment, as described with reference to FIG. 14, each word frequency table of the search target document and the search target document is called from the external storage device 5 into the memory in units of a plurality of groups. , Calculate the similarity between the document to be searched and the document to be searched in as many combinations as possible, and successively call the word frequency tables of the documents to be searched and the document to be searched in the next group into the memory (rewrite T) Similarly, by performing the similarity calculation, the number of accesses to the external storage device 5 can be reduced.

【0097】例えば、検索対象文書の単語頻度表の数を
m、被検索対象文書の単語頻度表の数をn、分割数を
v、節を1としたとき、本方式では、単語頻度表読み込
み時にnv+m回,類似度算出結果の書き込み時にvm
回、また、出力編集時の類似度算出結果の読み込み時に
vm回、出力編集結果の書き出しにm回の、合計2m
(v+1)+nv回のアクセスが発生する。これは、計
算オーダとしてO(m+n)と表すことができる。
For example, if the number of word frequency tables in the document to be searched is m, the number of word frequency tables in the document to be searched is n, the number of divisions is v, and the clause is 1, this method reads the word frequency table. Sometimes nv + m times, when writing the similarity calculation result, vm
Times, and vm times when reading the similarity calculation result during output editing and m times when writing the output editing result, for a total of 2 m
(V + 1) + nv accesses occur. This can be represented as O (m + n) as a calculation order.

【0098】比較例として、図17に示すように、検索
対象文書の単語頻度表と被検索対象文書の単語頻度表を
各々1文書ずつメモリ上に呼び出して類似度計算を行う
方式を考える。この場合、外部記憶装置5のアクセス回
数は、単語頻度表の読み込み時にnm回、類似度算出結
果の書き出し時にm回の、合計m(n+1)回となる。
これは、計算オーダとしてO(mn)なり、本方式の外
部記憶装置5のアクセス回数が非常に少ないことが言え
る。
As a comparative example, as shown in FIG. 17, a method of calculating the similarity by calling the word frequency table of the search target document and the word frequency table of the search target document one by one in the memory will be considered. In this case, the number of accesses to the external storage device 5 is nm times when reading the word frequency table and m times when writing the similarity calculation result, that is, a total of m (n + 1) times.
This is O (mn) as the calculation order, and it can be said that the number of accesses to the external storage device 5 of this method is extremely small.

【0099】これを具体的な値で示すと、検索対象文書
の単語頻度表の数を100、被検索対象文書の単語頻度
表の数を100、分割数を2としたとき、本方式では8
00回、比較例の方式では10,100回のファイルア
クセスが発生する。
When this is expressed by specific values, when the number of word frequency tables of the document to be searched is 100, the number of word frequency tables of the document to be searched is 100, and the number of divisions is 2, 8
In the method of the comparative example, file access occurs 10,100 times.

【0100】またさらに、本実施形態においては、単語
頻度表を複数の節から構成する構造にしたことで、例え
ば、文書タイトル概要、本文といった節ごとに類似度を
求めることができ、より精度の高い類似度検索結果を得
られる。
Furthermore, in the present embodiment, the word frequency table is structured to include a plurality of sections, so that the similarity can be obtained for each section such as a document title outline and a body, and more accurate. High similarity search results can be obtained.

【0101】[0101]

【発明の効果】以上説明したように請求項1および請求
項3記載の発明によれば、文書データ中の検索条件単語
の出現頻度を考慮した類似文書検索が可能となり、ま
た、同時に複数の検索対象文書と複数の被検索対象文書
を対象とした類似文書検索を高効率にかつ高精度に行う
ことが可能となる。
As described above, according to the first and third aspects of the present invention, it is possible to perform a similar document search in consideration of the frequency of occurrence of a search condition word in document data. A similar document search for a target document and a plurality of search target documents can be performed with high efficiency and high accuracy.

【0102】また、請求項1および請求項3の発明で
は、格納手段に格納された各文書データについて単語頻
度表と文書ノルム表を予め作成しておき、検索対象およ
び被検索対象の文書データが指定されたところで、該当
する各文書データの単語頻度表および文書ノルム表から
文書データ間の類似度を求めることで、連続して複数の
検索対象文書と複数の被検索対象文書を対象とした類似
文書検索を行う場合でも単語頻度表の作成やノルムの計
算を重複して行う必要がなくなり、高速な処理が可能と
なる。
According to the first and third aspects of the present invention, a word frequency table and a document norm table are created in advance for each document data stored in the storage means, and the document data to be searched and to be searched are By specifying the similarity between the document data from the word frequency table and the document norm table of each applicable document data at the specified location, the similarity for multiple search target documents and multiple search target documents in succession Even when performing a document search, there is no need to duplicately create the word frequency table and calculate the norm, and high-speed processing can be performed.

【0103】さらに、請求項2および請求項4記載の発
明によれば、各文書データ間の類似度算出において、各
単語頻度表のベクトルデータの内積計算に必要な、検索
対象文書の単語頻度表と被検索対象文書の単語頻度表と
の間での共通単語についての出現頻度情報を単語対応表
を参照することによって一意に得られるので、より一層
の処理の高速化を図ることができる。
Further, according to the second and fourth aspects of the present invention, in calculating the similarity between document data, the word frequency table of the document to be searched, which is necessary for calculating the inner product of the vector data of each word frequency table Since the appearance frequency information about the common word between the search target document and the word frequency table of the search target document can be uniquely obtained by referring to the word correspondence table, the processing speed can be further increased.

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

【図1】本発明に係る一実施形態である類似文書検索装
置のハードウェア構成を示すブロック図
FIG. 1 is a block diagram showing a hardware configuration of a similar document search device according to an embodiment of the present invention.

【図2】図1のメモリの構成を示す図FIG. 2 is a diagram showing a configuration of a memory in FIG. 1;

【図3】図2のメモリ内のプログラム部およびバッファ
部の構成を示す図
FIG. 3 is a diagram showing a configuration of a program unit and a buffer unit in the memory of FIG. 2;

【図4】文書データの構造を示す図FIG. 4 is a diagram showing a structure of document data.

【図5】単語ID−単語表の構造を示す図FIG. 5 is a diagram showing a structure of a word ID-word table.

【図6】検索対象文書の単語頻度表を示す図FIG. 6 is a diagram showing a word frequency table of a search target document.

【図7】被検索対象文書の単語頻度表を示す図FIG. 7 is a diagram showing a word frequency table of a document to be searched;

【図8】文書ノルム表を示す図FIG. 8 shows a document norm table.

【図9】単語対応表を示す図FIG. 9 is a diagram showing a word correspondence table.

【図10】類似度算出結果を示す図FIG. 10 is a diagram showing a similarity calculation result;

【図11】類似度算出結果の出力編集結果を示す図FIG. 11 is a diagram showing an output editing result of a similarity calculation result;

【図12】外部記憶装置内における文書データおよび単
語頻度表の格納形式を示す図
FIG. 12 is a diagram showing a storage format of document data and a word frequency table in an external storage device.

【図13】単語抽出表を示す図FIG. 13 shows a word extraction table.

【図14】図16に示すメイン処理のステップS6から
S12までの処理を具体的に説明するための図
FIG. 14 is a diagram for specifically explaining the processing from steps S6 to S12 of the main processing shown in FIG. 16;

【図15】単語抽出処理の全体的な手順を示すフローチ
ャート
FIG. 15 is a flowchart showing the overall procedure of word extraction processing;

【図16】メイン処理の全体的な手順を示すフローチャ
ート
FIG. 16 is a flowchart showing the overall procedure of a main process.

【図17】図16に示すメイン処理のステップS6から
S12までの処理に対する比較例を示す図
FIG. 17 is a view showing a comparative example with respect to the processing from steps S6 to S12 of the main processing shown in FIG. 16;

【図18】類似文書検索結果である文書一覧画面を示す
FIG. 18 is a view showing a document list screen as a similar document search result.

【図19】類似文書検索結果である文書画面を示す図FIG. 19 is a diagram showing a document screen as a similar document search result.

【図20】単語抽出処理の詳細を示すフローチャートFIG. 20 is a flowchart showing details of a word extraction process;

【図21】初期化処理の詳細を示すフローチャートFIG. 21 is a flowchart showing details of initialization processing;

【図22】ノルム計算処理の詳細を示すフローチャートFIG. 22 is a flowchart showing details of a norm calculation process;

【図23】単語対応表作成処理の詳細を示すフローチャ
ート
FIG. 23 is a flowchart showing details of a word correspondence table creation process;

【図24】類似度算出処理の詳細を示すフローチャートFIG. 24 is a flowchart showing details of a similarity calculation process;

【図25】図24に続いて類似度算出処理の詳細を示す
フローチャート
FIG. 25 is a flowchart showing details of a similarity calculation process subsequent to FIG. 24;

【図26】出力編集処理の詳細を示すフローチャートFIG. 26 is a flowchart showing details of output editing processing;

【図27】従来の類似文書検索方式を説明するための図FIG. 27 is a view for explaining a conventional similar document search method.

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

1……入力装置 2……表示装置 3……制御装置 4……メモリ 5……外部記憶装置 10a……単語抽出部 10b……入力文書データ格納バッファ 10c……単語ID−単語表格納バッファ 10d……単語頻度表格納バッファ 10e……単語抽出表格納 11a……メイン処理部 11b……初期化部 11c……ノルム計算部 11d……単語対応表作成部 11e……類似度算出部 11f……出力編集部 11g……文書一覧表示部 11h……文書選択部 11i……文書内容表示部 11j……検索対象・単語頻度表格納バッファ 11k……被検索対象・単語頻度表格納バッファ 11l……文書ノルム表格納バッファ 11m……単語対応表格納バッファ 11n……類似度算出結果格納バッファ 11o……出力編集結果格納バッファ DESCRIPTION OF SYMBOLS 1 ... Input device 2 ... Display device 3 ... Control device 4 ... Memory 5 ... External storage device 10a ... Word extraction part 10b ... Input document data storage buffer 10c ... Word ID-word table storage buffer 10d ... Word frequency table storage buffer 10e... Word extraction table storage 11a... Main processing unit 11b... Initialization unit 11c... Norm calculation unit 11d. Output editing unit 11g Document list display unit 11h Document selection unit 11i Document content display unit 11j Search target / word frequency table storage buffer 11k Reference target / word frequency table storage buffer 11l Document Norm table storage buffer 11m... Word correspondence table storage buffer 11n... Similarity calculation result storage buffer 11o... Output editing result storage buffer

───────────────────────────────────────────────────── フロントページの続き (72)発明者 久保田 直秀 東京都青梅市新町1381番地1 東芝コンピ ュータエンジニアリング株式会社内 (72)発明者 中本 幸夫 東京都青梅市新町1381番地1 東芝コンピ ュータエンジニアリング株式会社内 (72)発明者 仁科 卓哉 東京都青梅市新町1381番地1 東芝コンピ ュータエンジニアリング株式会社内 ──────────────────────────────────────────────────続 き Continuing from the front page (72) Inventor Naohide Kubota 1381-1, Shinmachi, Omachi, Tokyo Toshiba Computer Engineering Co., Ltd. (72) Yukio Nakamoto 1381-1, Shinmachi, Ome, Tokyo Toshiba Computer Data Engineering Co., Ltd. (72) Inventor Takuya Nishina 1381 Shinmachi, Ome-shi, Tokyo Toshiba Computer Engineering Co., Ltd.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 複数の文書データを格納する格納手段
と、 前記格納手段に格納された文書データごとに、予め設定
された検索条件単語ごとの出現頻度を求めて単語頻度表
を作成する単語頻度表作成手段と、 前記格納手段に格納された文書データごとに、前記単語
頻度表作成手段により作成された単語頻度表中の検索条
件単語ごとの出現頻度を要素とする1次元ベクトルのノ
ルムを算出して文書ノルム表を作成する文書ノルム表作
成手段と、 前記格納手段に格納された文書データの中から検索対象
および被検索対象の各文書データを指定する指定手段
と、 前記指定手段により指定された各文書データ間の類似度
を、前記単語頻度表および前記文書ノルム表に基づき算
出する類似度算出手段とを有することを特徴とする類似
文書検索装置。
1. A storage unit for storing a plurality of document data, and a word frequency for generating a word frequency table by obtaining an appearance frequency for each preset search condition word for each document data stored in the storage unit A table creation unit, and for each document data stored in the storage unit, calculate a norm of a one-dimensional vector having an appearance frequency for each search condition word in the word frequency table created by the word frequency table creation unit as an element Document norm table creating means for creating a document norm table, and specifying means for specifying each document data of a search target and a search target from the document data stored in the storage means, A similarity calculating means for calculating a similarity between the respective document data based on the word frequency table and the document norm table.
【請求項2】 複数の文書データを格納する格納手段
と、 前記格納手段に格納された文書データごとに、予め設定
された検索条件単語ごとの出現頻度を求めて単語頻度表
を作成する単語頻度表作成手段と、 前記格納手段に格納された文書データごとに、前記単語
頻度表作成手段により作成された単語頻度表中の検索条
件単語ごとの出現頻度を要素とする1次元ベクトルのノ
ルムを算出して文書ノルム表を作成する文書ノルム表作
成手段と、 前記格納手段に格納された文書データの中から検索対象
および被検索対象の各文書データを指定する指定手段
と、 前記指定手段により指定された各文書データに対して前
記単語頻度表作成手段にて作成された各単語頻度表間の
共通単語の登録位置関係を示す単語対応表を作成する単
語対応表作成手段と、 前記指定手段により指定された各文書データ間の類似度
を、前記単語頻度表、前記文書ノルム表および前記単語
対応表に基づき算出する類似度算出手段とを有すること
を特徴とする類似文書検索装置。
2. A storage unit for storing a plurality of document data, and a word frequency for creating a word frequency table by obtaining an appearance frequency for each preset search condition word for each document data stored in the storage unit A table creation unit, and for each document data stored in the storage unit, calculate a norm of a one-dimensional vector having an appearance frequency for each search condition word in the word frequency table created by the word frequency table creation unit as an element Document norm table creating means for creating a document norm table, and specifying means for specifying each document data of a search target and a search target from the document data stored in the storage means, Word correspondence table creating means for creating a word correspondence table indicating the registered positional relationship of common words between the respective word frequency tables created by the word frequency table creating means for each document data A similar document search device comprising: a similarity calculating unit that calculates a similarity between respective document data specified by the specifying unit based on the word frequency table, the document norm table, and the word correspondence table. .
【請求項3】 文書データベースに格納された個々の文
書データごとに、予め設定された検索条件単語ごとの出
現頻度を求めて単語頻度表を作成する工程と、 文書データベースに格納された個々の文書データごと
に、前記作成された単語頻度表中の検索条件単語ごとの
出現頻度を要素とする1次元ベクトルのノルムを算出し
て文書ノルム表を作成する工程と、 前記文書データベースに格納された文書データの中から
検索対象および被検索対象の各文書データを指定する工
程と、 前記指定された各文書データ間の類似度を、前記単語頻
度表および前記文書ノルム表に基づき算出する工程とを
有することを特徴とする類似文書検索方法。
3. A step of obtaining a frequency of appearance for each preset search condition word for each individual document data stored in the document database to create a word frequency table, and an individual document stored in the document database. A step of calculating a norm of a one-dimensional vector having an appearance frequency for each search condition word in the created word frequency table as an element for each data to create a document norm table; and a document stored in the document database. A step of designating each document data of a search target and a search target from data; and a step of calculating a similarity between the designated document data based on the word frequency table and the document norm table. A similar document search method characterized in that:
【請求項4】 文書データベースに格納された個々の文
書データごとに、予め設定された検索条件単語ごとの出
現頻度を求めて単語頻度表を作成する工程と、 文書データベースに格納された個々の文書データごと
に、前記作成された単語頻度表中の検索条件単語ごとの
出現頻度を要素とする1次元ベクトルのノルムを算出し
て文書ノルム表を作成する工程と、 前記文書データベースに格納された文書データの中から
検索対象および被検索対象の各文書データを指定する工
程と、 前記指定された各文書データに対して作成された各単語
頻度表間の共通単語の登録位置関係を示す単語対応表を
作成する工程と、 前記指定された各文書データ間の類似度を、前記単語頻
度表、前記文書ノルム表および単語対応表に基づき算出
する工程とを有することを特徴とする類似文書検索方
法。
4. A step of generating a word frequency table by obtaining an appearance frequency for each preset search condition word for each document data stored in the document database, and each document stored in the document database. A step of calculating a norm of a one-dimensional vector having an appearance frequency for each search condition word in the created word frequency table as an element for each data to create a document norm table; and a document stored in the document database. A step of designating each of the document data to be searched and the object to be searched from the data; And calculating the similarity between the specified document data based on the word frequency table, the document norm table, and the word correspondence table. Similar document retrieval method according to claim.
JP9208039A 1997-08-01 1997-08-01 Device and method for retrieving similar document Withdrawn JPH1153381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9208039A JPH1153381A (en) 1997-08-01 1997-08-01 Device and method for retrieving similar document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9208039A JPH1153381A (en) 1997-08-01 1997-08-01 Device and method for retrieving similar document

Publications (1)

Publication Number Publication Date
JPH1153381A true JPH1153381A (en) 1999-02-26

Family

ID=16549643

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9208039A Withdrawn JPH1153381A (en) 1997-08-01 1997-08-01 Device and method for retrieving similar document

Country Status (1)

Country Link
JP (1) JPH1153381A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010152862A (en) * 2008-11-27 2010-07-08 I Business Center:Kk Device for specifying text body and program for causing computer to specify text body
US7941745B2 (en) 1999-11-18 2011-05-10 Sony Corporation Method and system for tagging electronic documents
JP2012022598A (en) * 2010-07-16 2012-02-02 Jvc Kenwood Corp User information processing device, user information processing method and user information processing program
JP2012058894A (en) * 2010-09-07 2012-03-22 Jvc Kenwood Corp Device, method and program for processing user information
JP2012058893A (en) * 2010-09-07 2012-03-22 Jvc Kenwood Corp Device, method and program for processing user information
JP2014052985A (en) * 2012-09-10 2014-03-20 Ricoh Co Ltd Report preparation system, natural language processor, report preparation device, and program
KR20160033563A (en) * 2014-09-18 2016-03-28 경북대학교 산학협력단 Method for constructing database, recording medium for performing the method
JP2018063596A (en) * 2016-10-13 2018-04-19 富士通株式会社 Document comparison program, document comparison method, and document comparison apparatus

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7941745B2 (en) 1999-11-18 2011-05-10 Sony Corporation Method and system for tagging electronic documents
JP2010152862A (en) * 2008-11-27 2010-07-08 I Business Center:Kk Device for specifying text body and program for causing computer to specify text body
JP2012022598A (en) * 2010-07-16 2012-02-02 Jvc Kenwood Corp User information processing device, user information processing method and user information processing program
JP2012058894A (en) * 2010-09-07 2012-03-22 Jvc Kenwood Corp Device, method and program for processing user information
JP2012058893A (en) * 2010-09-07 2012-03-22 Jvc Kenwood Corp Device, method and program for processing user information
JP2014052985A (en) * 2012-09-10 2014-03-20 Ricoh Co Ltd Report preparation system, natural language processor, report preparation device, and program
KR20160033563A (en) * 2014-09-18 2016-03-28 경북대학교 산학협력단 Method for constructing database, recording medium for performing the method
JP2018063596A (en) * 2016-10-13 2018-04-19 富士通株式会社 Document comparison program, document comparison method, and document comparison apparatus

Similar Documents

Publication Publication Date Title
US5355476A (en) File update apparatus for generating a matrix representing a subset of files and the update correspondence between directories and files
US6138114A (en) Sort system for merging database entries
JPH0765035A (en) Structured document retrieving device
CN100419746C (en) information retrieval method
JPH1153381A (en) Device and method for retrieving similar document
JP2000112968A (en) Information search support device and information search support program storage medium
JPH08314966A (en) Method for generating index of document retrieving device and document retrieving device
JPS617936A (en) Information retrieving system
JPH02108157A (en) Information retrieving method
JP2975529B2 (en) Electronic dictionary search device
JPH0778803B2 (en) Image database search method
JP2739589B2 (en) Information retrieval device
JPH07121549A (en) Document retrieving device
JPH07105223A (en) Data base retrieval device
JPH08235191A (en) Method and device for document retrieval
JPH04237377A (en) Image search method using keyword placement and color attributes
JPS60256853A (en) Method and device for file retrieval
JPH07121548A (en) Information management device
JP2601139B2 (en) String search device
JP2002099566A (en) Method and device for information retrieval
JPH02270068A (en) Document search control method
JPH01248233A (en) Data base retrieving device
JPS58169629A (en) information processing system
JPS6365572A (en) Image information storing and retrieving device
JPS61288238A (en) Data base processing method

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20041005