JP5701830B2 - Document structure analysis apparatus and program - Google Patents

Document structure analysis apparatus and program Download PDF

Info

Publication number
JP5701830B2
JP5701830B2 JP2012194305A JP2012194305A JP5701830B2 JP 5701830 B2 JP5701830 B2 JP 5701830B2 JP 2012194305 A JP2012194305 A JP 2012194305A JP 2012194305 A JP2012194305 A JP 2012194305A JP 5701830 B2 JP5701830 B2 JP 5701830B2
Authority
JP
Japan
Prior art keywords
similarity
elements
cluster
structured document
document
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012194305A
Other languages
Japanese (ja)
Other versions
JP2014049088A (en
Inventor
精一 紺谷
精一 紺谷
明通 田中
明通 田中
内山 匡
匡 内山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2012194305A priority Critical patent/JP5701830B2/en
Publication of JP2014049088A publication Critical patent/JP2014049088A/en
Application granted granted Critical
Publication of JP5701830B2 publication Critical patent/JP5701830B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、文書構造解析装置及びプログラムに係り、特に、構造化文書の要素の階層構造を解析する文書構造解析装置及びプログラムに関する。   The present invention relates to a document structure analysis apparatus and program, and more particularly to a document structure analysis apparatus and program for analyzing a hierarchical structure of elements of a structured document.

非特許文献1では、ウェブラッパーと呼ばれる、HTML文書と抽出したい部分の組を学習例として与えると機械学習の手法を用いて文書構造抽出プログラムを自動生成する手法が提案されている。   Non-Patent Document 1 proposes a method called a web wrapper that automatically generates a document structure extraction program using a machine learning method when a combination of an HTML document and a portion to be extracted is given as a learning example.

I. Muslea, S. Minton, and C. Knoblock, ”A Hierarchical Approach to Wrapper Induc-tion,” pp.190-197, AGENTS '99, 1999.I. Muslea, S. Minton, and C. Knoblock, “A Hierarchical Approach to Wrapper Induc-tion,” pp.190-197, AGENTS '99, 1999.

しかしながら、上述した非特許文献1の手法では、同様の情報を含むページであっても、webページはサイト毎にHTML構造が異なるため、様々なサイトから包括的に情報を取得するためには、HTML文書と抽出したい部分の組からなる大量の学習例が必要となり、人手による作業が大きい。また、ECサイトのリニューアルなどでテンプレートが更新されると、商品ページのHTML構造が変わり、学習したルールが適用できなくなるため、HTML文書と抽出したい部分の組からなる学習例を作り直して再学習する必要がある。   However, in the method of Non-Patent Document 1 described above, even if the page includes similar information, the web page has a different HTML structure for each site, so in order to comprehensively acquire information from various sites, A large amount of learning examples consisting of a set of HTML documents and parts to be extracted are required, and the work by manpower is large. In addition, if the template is updated, such as when the EC site is renewed, the HTML structure of the product page changes, and the learned rules can no longer be applied. There is a need.

本発明は、上記の事情を鑑みてなされたもので、構造化文書における複数の要素をクラスタリングすることにより、構造化文書の要素を精度良くクラスタリングでき、抽出したい部分を得ることができる文書構造解析装置及びプログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and by documenting a plurality of elements in a structured document, it is possible to cluster the elements of the structured document with high accuracy and obtain a portion to be extracted. An object is to provide an apparatus and a program.

上記の目的を達成するために本発明に係る文書構造解析装置は、解析対象となる少なくとも1つの構造化文書の各々について、前記構造化文書の要素の階層構造を解析する階層構造解析手段と、前記階層構造解析手段によって解析された構造化文書を表示したときの前記構造化文書の各要素の表示位置を解析する位置情報解析手段と、前記階層構造解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの第1要素と第2要素との間の各々について、前記第1要素及び前記第1要素の子孫の要素と、前記第2要素及び前記第2要素の子孫の要素とを比較して、要素の構造に関する構造類似度を算出する構造類似度計算手段と、前記位置情報解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの2つの要素間の各々について、要素の表示位置に関する位置類似度を算出する位置類似度計算手段と、前記構造類似度計算手段によって算出された構造類似度と、前記位置類似度計算手段によって算出された位置類似度とに基づいて、前記少なくとも1つの構造化文書における複数の要素をクラスタリングするクラスタリング手段とを含んで構成されている。   In order to achieve the above object, a document structure analyzing apparatus according to the present invention comprises a hierarchical structure analyzing means for analyzing a hierarchical structure of elements of the structured document for each of at least one structured document to be analyzed, Based on the analysis result analyzed by the hierarchical structure analyzing means, the positional information analyzing means for analyzing the display position of each element of the structured document when displaying the structured document analyzed by the hierarchical structure analyzing means , For each of a plurality of elements in the at least one structured document between a first element and a second element, the first element and a descendant element of the first element; the second element; Based on the structural similarity calculation means for calculating the structural similarity regarding the structure of the element by comparing with the descendant elements of the second element, and the analysis result analyzed by the positional information analysis means The position similarity calculation means for calculating the position similarity regarding the display position of each element between two elements of the at least one structured document, and the structure similarity calculation means. And clustering means for clustering a plurality of elements in the at least one structured document based on the structural similarity and the positional similarity calculated by the positional similarity calculation means.

本発明によれば、階層構造解析手段によって、解析対象となる少なくとも1つの構造化文書の各々について、構造化文書の要素の階層構造を解析する。位置情報解析手段によって、階層構造解析手段によって解析された構造化文書を表示したときの構造化文書の各要素の表示位置を解析する。   According to the present invention, the hierarchical structure of the elements of the structured document is analyzed for each of at least one structured document to be analyzed by the hierarchical structure analyzing means. The position information analyzing unit analyzes the display position of each element of the structured document when the structured document analyzed by the hierarchical structure analyzing unit is displayed.

そして、構造類似度計算手段によって、階層構造解析手段によって解析された解析結果に基づいて、少なくとも1つの構造化文書における複数の要素のうちの第1要素と第2要素との間の各々について、第1要素及び第1要素の子孫の要素と、第2要素及び第2要素の子孫の要素とを比較して、要素の構造に関する構造類似度を算出する。   And based on the analysis result analyzed by the hierarchical structure analysis means by the structure similarity calculation means, for each between the first element and the second element of the plurality of elements in at least one structured document, The first element and the descendant element of the first element are compared with the second element and the descendant element of the second element, and the structural similarity related to the structure of the element is calculated.

そして、位置類似度計算手段によって、位置情報解析手段によって解析された解析結果に基づいて、少なくとも1つの構造化文書における複数の要素のうちの2つの要素間の各々について、要素の表示位置に関する位置類似度を算出する。   Then, based on the analysis result analyzed by the position information analysis means by the position similarity calculation means, the position regarding the display position of the element for each of the two elements of the plurality of elements in at least one structured document Calculate similarity.

そして、クラスタリング手段によって、構造類似度計算手段によって算出された構造類似度と、位置類似度計算手段によって算出された位置類似度とに基づいて、少なくとも1つの構造化文書における複数の要素をクラスタリングする。   Then, the clustering unit clusters a plurality of elements in at least one structured document based on the structural similarity calculated by the structural similarity calculation unit and the position similarity calculated by the position similarity calculation unit. .

これにより、構造化文書の要素の階層構造を解析し、解析された構造化文書を表示したときの構造化文書の各要素の表示位置を解析し、構造化文書における複数の要素のうちの2つの要素間の各々について、要素の構造に関する構造類似度及び要素の表示位置に関する位置類似度を算出し、構造類似度と、位置類似度とに基づいて、構造化文書における複数の要素をクラスタリングすることにより、構造化文書の要素を精度良くクラスタリングでき、抽出したい部分を得ることができる。   As a result, the hierarchical structure of the elements of the structured document is analyzed, the display position of each element of the structured document when the analyzed structured document is displayed, and two of the plurality of elements in the structured document are analyzed. For each of the two elements, the structural similarity regarding the structure of the element and the positional similarity regarding the display position of the element are calculated, and a plurality of elements in the structured document are clustered based on the structural similarity and the positional similarity. As a result, the elements of the structured document can be clustered with high accuracy, and the portion to be extracted can be obtained.

また、前記構造類似度計算手段は、前記階層構造解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における各要素について、該要素及び該要素の子孫の要素の属性名のヒストグラムを算出し、前記第1要素と第2要素との間の各々について、前記第1要素のヒストグラムと前記第2要素のヒストグラムとの類似度を前記構造類似度として算出することができる。   Further, the structural similarity calculation means, for each element in the at least one structured document, based on the analysis result analyzed by the hierarchical structure analysis means, the attribute name of the element and the descendant element of the element A histogram can be calculated, and the similarity between the histogram of the first element and the histogram of the second element can be calculated as the structural similarity for each between the first element and the second element.

また、前記位置類似度計算手段は、前記位置情報解析手段によって解析された解析結果に基づいて、前記2つの要素間の各々について、前記構造化文書を表示したときの前記2つの要素の表示位置及び大きさに基づく類似度を、前記位置類似度として算出することができる。   In addition, the position similarity calculation unit is configured to display a display position of the two elements when the structured document is displayed for each of the two elements based on the analysis result analyzed by the position information analysis unit. The similarity based on the size can be calculated as the position similarity.

また、前記クラスタリング手段によってクラスタリングされたクラスタの各々について、前記クラスタに属する各要素に含まれる単語と予め定められたキーワードとに基づいて、前記クラスタの優先度を算出する優先度計算手段を更に含むことができる。   Further, for each of the clusters clustered by the clustering means, further includes a priority calculation means for calculating the priority of the cluster based on a word included in each element belonging to the cluster and a predetermined keyword. be able to.

また、前記構造類似度計算手段によって算出された構造類似度に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの同一のクラスタにクラスタリングされる2つの要素を含む複数のクラスタ候補を探索する候補探索手段を更に含み、前記クラスタリング手段は、前記候補探索手段によって探索された各クラスタ候補に含まれる要素間の前記構造類似度及び前記位置類似度に基づいて、前記少なくとも1つの構造化文書における複数の要素をクラスタリングすることができる。   Further, a plurality of cluster candidates including two elements clustered in the same cluster among a plurality of elements in the at least one structured document based on the structure similarity calculated by the structure similarity calculation means. Candidate searching means for searching, further comprising: the clustering means based on the structural similarity and the position similarity between elements included in each cluster candidate searched by the candidate searching means. Multiple elements in a document can be clustered.

また、前記候補探索手段は、前記少なくとも1つの構造化文書における複数の要素の各々について、該要素とクラスタ候補に含まれる要素を、親子関係にある要素のうち前記構造類似度が最大となる要素とすることができる。   In addition, the candidate search means, with respect to each of the plurality of elements in the at least one structured document, the element included in the cluster candidate and the element having the maximum structural similarity among the elements having a parent-child relationship It can be.

また、前記候補探索手段は、前記構造化文書を表示したときの表示位置の距離が所定値以下であって、かつ同一のクラスタにクラスタリングされる2つの要素を含む前記複数のクラスタ候補を探索することができる。   Further, the candidate search means searches for the plurality of cluster candidates including two elements whose display position distance when the structured document is displayed is equal to or smaller than a predetermined value and clustered into the same cluster. be able to.

本発明に係るプログラムは、コンピュータを、上記の文書構造解析装置の各手段として機能させるためのプログラムである。   The program according to the present invention is a program for causing a computer to function as each unit of the document structure analysis apparatus.

以上説明したように、本発明の文書構造解析装置及びプログラムによれば、構造化文書の要素の階層構造を解析し、解析された構造化文書を表示したときの構造化文書の各要素の表示位置を解析し、構造化文書における複数の要素のうちの2つの要素間の各々について、要素の構造に関する構造類似度及び要素の表示位置に関する位置類似度を算出し、構造類似度と、位置類似度とに基づいて、構造化文書における複数の要素をクラスタリングすることにより、構造化文書の要素を精度良くクラスタリングでき、抽出したい部分を得ることができる、という効果が得られる。   As described above, according to the document structure analysis apparatus and program of the present invention, the hierarchical structure of the elements of the structured document is analyzed, and each element of the structured document is displayed when the analyzed structured document is displayed. Analyzing the position and calculating the structural similarity related to the structure of the element and the positional similarity related to the display position of the element for each of the two elements of the plurality of elements in the structured document. By clustering a plurality of elements in the structured document based on the degree, it is possible to cluster the elements of the structured document with high accuracy and to obtain a portion to be extracted.

本発明の実施の形態に係る文書構造解析装置の構成を示す概略図である。It is the schematic which shows the structure of the document structure analysis apparatus which concerns on embodiment of this invention. 本発明の実施の形態で用いるキーワードリストKW^の概略図である。It is the schematic of the keyword list KW ^ used by embodiment of this invention. 本発明の実施の形態で用いる階層構造情報テーブルK^の概略図である。It is the schematic of the hierarchical structure information table K ^ used by embodiment of this invention. 本発明の実施の形態で用いる位置情報テーブルP^の概略図である。It is the schematic of the positional information table P ^ used by embodiment of this invention. 本発明の実施の形態で用いるクラスタテーブルC^の概略図である。It is the schematic of the cluster table C ^ used by embodiment of this invention. 本発明の実施の形態で用いる構造類似度テーブルLstr^の概略図である。It is the schematic of the structure similarity table Lstr ^ used by embodiment of this invention. 本発明の実施の形態で用いる位置類似度テーブルLpos^の概略図である。It is the schematic of the position similarity table Lpos ^ used by embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1のwebページを示す図である。It is a figure which shows the web page of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1のwebページのHTMLタグ構造を示す図である。It is a figure which shows the HTML tag structure of the web page of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1のDOMツリー構造を示す図である。It is a figure which shows the DOM tree structure of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1の階層構造情報テーブルを示す図である。It is a figure which shows the hierarchical structure information table of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態に係る文書構造解析装置における構造化文書情報抽出処理ルーチンの内容を示すフローチャートである。It is a flowchart which shows the content of the structured document information extraction process routine in the document structure analysis apparatus which concerns on embodiment of this invention. 構造化文書情報抽出処理ルーチン内で呼び出される候補探索処理ルーチンの前半部分の内容を示すフローチャートである。It is a flowchart which shows the content of the first half part of the candidate search process routine called within a structured document information extraction process routine. 構造化文書情報抽出処理ルーチン内で呼び出される候補探索処理ルーチンの後半部分の内容を示すフローチャートである。It is a flowchart which shows the content of the second half part of the candidate search process routine called within a structured document information extraction process routine. 構造化文書情報抽出処理ルーチン内で呼び出される候補探索処理ルーチンの前半部分を示すアルゴリズムである。It is an algorithm which shows the first half part of the candidate search process routine called within the structured document information extraction process routine. 構造化文書情報抽出処理ルーチン内で呼び出される候補探索処理ルーチンの後半部分を示すアルゴリズムである。It is an algorithm which shows the latter half part of the candidate search process routine called within a structured document information extraction process routine. 候補探索処理ルーチン内で呼び出されるfirstChildルーチンの内容を示すアルゴリズムである。It is an algorithm showing the contents of the firstChild routine called in the candidate search processing routine. 候補探索処理ルーチン内で呼び出されるnextSiblingルーチンの内容を示すアルゴリズムである。This is an algorithm showing the contents of the nextSibling routine called in the candidate search processing routine. 候補探索処理ルーチン内で呼び出されるnextNodeルーチンの内容を示すアルゴリズムである。This is an algorithm showing the contents of the nextNode routine called in the candidate search processing routine. 構造化文書情報抽出処理ルーチン内で呼び出されるクラスタリング処理ルーチンの内容を示すフローチャートである。It is a flowchart which shows the content of the clustering process routine called within a structured document information extraction process routine. 構造化文書情報抽出処理ルーチン内で呼び出されるクラスタリング処理ルーチンのアルゴリズムである。This is an algorithm of a clustering processing routine called in the structured document information extraction processing routine. 構造化文書情報抽出処理ルーチン内で呼び出される優先度計算処理ルーチンの内容を示すアルゴリズムである。It is an algorithm which shows the content of the priority calculation process routine called within a structured document information extraction process routine. 本発明の実施の形態の説明で用いた動作例1のキーワードリストKW^を示す図である。It is a figure which shows the keyword list KW ^ of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1の位置情報テーブルP^を示す図である。It is a figure which shows the positional information table P ^ of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1の構造類似度テーブルLstr^を示す図である。It is a figure which shows the structure similarity table Lstr ^ of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1の位置類似度テーブルLpos^を示す図である。It is a figure which shows the position similarity table Lpos ^ of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1のクラスタテーブルC^を示す図である。It is a figure which shows the cluster table C ^ of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1のクラスタリング結果を示す図である。It is a figure which shows the clustering result of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例1の出力結果を示す図である。It is a figure which shows the output result of the operation example 1 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例2のwebページを示す図である。It is a figure which shows the web page of the operation example 2 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例2のwebページのHTMLタグ構造を示す図である。It is a figure which shows the HTML tag structure of the web page of the operation example 2 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例2のキーワードリストKW^を示す図である。It is a figure which shows the keyword list KW ^ of the operation example 2 used by description of embodiment of this invention. 本発明の実施の形態の説明で用いた動作例2の出力結果を示す図である。It is a figure which shows the output result of the operation example 2 used by description of embodiment of this invention. 構造化文書情報抽出処理ルーチン内で呼び出される優先度計算処理ルーチンの他の構成例1を示すアルゴリズムである。It is an algorithm which shows the other structural example 1 of the priority calculation process routine called within a structured document information extraction process routine. 構造化文書情報抽出処理ルーチン内で呼び出される優先度計算処理ルーチンの他の構成例2を示すアルゴリズムである。It is an algorithm which shows the other structural example 2 of the priority calculation processing routine called within a structured document information extraction processing routine. 構造化文書情報抽出処理ルーチン内で呼び出される優先度計算処理ルーチンの他の構成例3を示すアルゴリズムである。It is an algorithm which shows the other structural example 3 of the priority calculation process routine called within a structured document information extraction process routine.

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

<システム構成> <System configuration>

本実施の形態に係る文書構造解析装置は、CPUと、RAMと、後述する構造化文書情報抽出装置処理ルーチンを実行するためのプログラムを記憶したROMとを備えたコンピュータで構成され、機能的には次に示すように構成されている。   The document structure analysis apparatus according to the present embodiment is configured by a computer including a CPU, a RAM, and a ROM that stores a program for executing a structured document information extraction apparatus processing routine described later. Is configured as follows.

本実施の形態に係る文書構造解析装置は、図1に示すように、入力部1と、記憶部2と、演算部3と、出力部4とを備えている。また、演算部3は、階層構造解析部10と、位置情報解析部12と、構造類似度計算部14と、位置類似度計算部16と、候補探索部18と、クラスタリング部20と、優先度計算部22とを備えている。   As shown in FIG. 1, the document structure analysis apparatus according to the present embodiment includes an input unit 1, a storage unit 2, a calculation unit 3, and an output unit 4. In addition, the calculation unit 3 includes a hierarchical structure analysis unit 10, a position information analysis unit 12, a structure similarity calculation unit 14, a position similarity calculation unit 16, a candidate search unit 18, a clustering unit 20, and a priority level. And a calculation unit 22.

なお、記憶部2は、外部に設けられ、文書構造解析装置とネットワークで接続されていてもよい。   Note that the storage unit 2 may be provided outside and connected to the document structure analysis apparatus via a network.

入力部1は、外部からの入力を受け付ける。入力部1は、例えば、ネットワーク、又はファイルなどを経由して、webページ群、後述するパラメータ(構造類似度閾値θstr、位置類似度閾値θpos、探索範囲閾値γ、γ)、及び後述するキーワードリストKW^の入力を受け付ける。 The input unit 1 receives an input from the outside. For example, the input unit 1 receives a web page group, parameters described later (structure similarity threshold θ str , position similarity threshold θ pos , search range thresholds γ 0 , γ 1 ), An input of a keyword list KW ^ to be described later is accepted.

記憶部2は、入力部1により入力された各種データを記憶する。具体的には、入力部1により入力されたwebページ群、パラメータ(構造類似度閾値θstr、位置類似度閾値θpos、探索範囲閾値γ、γ)、及び図2に示すキーワードリストKW^を記憶する。また記憶部2は、後述する各処理での結果等を記憶し、具体的には、図3に示す階層構造情報テーブルK^、図4に示す位置情報テーブルP^、図5に示すクラスタテーブルC^、図6に示す構造類似度テーブルLstr^、及び図7に示す位置類似度テーブルLpos^などを記憶する。なお、記号に付された「^」は、当該記号が行列または多次元配列またはベクトルであることを表わしている。また記憶部2は、後述するその他の各処理での結果等を記憶する。 The storage unit 2 stores various data input from the input unit 1. Specifically, a web page group input by the input unit 1, parameters (structure similarity threshold θ str , position similarity threshold θ pos , search range thresholds γ 0 , γ 1 ), and a keyword list KW shown in FIG. Remember ^. Further, the storage unit 2 stores the results of each processing described later, specifically, the hierarchical structure information table K ^ shown in FIG. 3, the position information table P ^ shown in FIG. 4, and the cluster table shown in FIG. C, the structural similarity table L str ^ shown in FIG. 6, the position similarity table L pos ^ shown in FIG. 7, and the like are stored. Note that “^” attached to a symbol indicates that the symbol is a matrix, a multidimensional array, or a vector. The storage unit 2 also stores the results of other processes described later.

階層構造解析部10は、入力部1により入力され、記憶部2に記憶されているwebページの各々について、HTMLタグが示す要素の階層構造を解析する。具体的には、webページからHTMLタグが示す各要素に対応する各ノードを含むDOM(Document Object Model)ツリーを生成すると共に、DOMツリー中の各ノードについて、自ノードと子孫の各ノードのノード名(属性名)でヒストグラムを作成し、上記図3に示す階層構造情報テーブルK^を作成する。
例えば、図8に示す、後述する動作例1のwebページが入力された場合には、図9に示すようなHTMLタグが示す要素の階層構造を解析し、図10に示すツリーを生成する。そして、DOMツリー中の各ノードについて、図11に示すようなヒストグラムを作成する。
The hierarchical structure analysis unit 10 analyzes the hierarchical structure of the element indicated by the HTML tag for each of the web pages input from the input unit 1 and stored in the storage unit 2. Specifically, a DOM (Document Object Model) tree including each node corresponding to each element indicated by the HTML tag is generated from the web page, and for each node in the DOM tree, the node of the own node and each of the descendant nodes. A histogram is created by name (attribute name), and the hierarchical structure information table K ^ shown in FIG. 3 is created.
For example, when the web page of operation example 1 shown in FIG. 8 is input, the hierarchical structure of the element indicated by the HTML tag as shown in FIG. 9 is analyzed, and the tree shown in FIG. 10 is generated. Then, a histogram as shown in FIG. 11 is created for each node in the DOM tree.

位置情報解析部12は、入力部1により入力され、記憶部2に記憶されているwebページの各々について、HTMLタグが示す要素の、webブラウザ上での表示位置及び表示領域の幅と高さを計算し、上記図4に示す位置情報テーブルP^を作成する。なお、要素の表示領域の幅と高さは、要素を表示したときの大きさの一例である。   The position information analysis unit 12 receives the display position on the web browser and the width and height of the display area of the element indicated by the HTML tag for each of the web pages input from the input unit 1 and stored in the storage unit 2. And the position information table P ^ shown in FIG. 4 is created. The width and height of the element display area are examples of the size when the element is displayed.

構造類似度計算部14は、階層構造解析部10で算出される各ノードのヒストグラムに基づいて、2つのノードのペア各々について2つの要素間の階層構造に関する類似度を計算する。例えば、ノードAとノードBが与えられた場合に、それらの構造類似度Sstr(A、B)を以下の(1)式に従って計算する。 Based on the histogram of each node calculated by the hierarchical structure analysis unit 10, the structural similarity calculation unit 14 calculates the similarity related to the hierarchical structure between two elements for each pair of two nodes. For example, when node A and node B are given, their structural similarity S str (A, B) is calculated according to the following equation (1).

ここで、hist、histは階層構造解析部10で算出されるノードA、Bのヒストグラムである。 Here, hist A and hist B are histograms of the nodes A and B calculated by the hierarchical structure analysis unit 10.

位置類似度計算部16は、位置情報解析部12で算出される位置情報に基づいて、2つのノードのペア各々について2つの要素間の位置関係の類似度を計算する。例えば、ノードAとノードBが与えられた場合に、ノードA、Bの位置類似度Spos^(A、B)を以下の(2)式に従って計算する。 The position similarity calculation unit 16 calculates the similarity of the positional relationship between two elements for each pair of two nodes based on the position information calculated by the position information analysis unit 12. For example, when node A and node B are given, the position similarity S pos ^ (A, B) of the nodes A and B is calculated according to the following equation (2).

ここで、(x,y,w,h)、(x,y,w,h)は、位置情報解析部12で算出されるノードA、Bの位置情報である。また、(W,H)、(W,H)は、webブラウザ上での、A、Bを含むwebページの表示領域(スクロール分を含む)の幅および高さである。 Here, (x A , y A , w A , h A ) and (x B , y B , w B , h B ) are the position information of the nodes A and B calculated by the position information analysis unit 12. . In addition, (W A , H A ) and (W B , H B ) are the width and height of the display area (including scrolling) of the web page including A and B on the web browser.

候補探索部18は、入力部1により入力されたパラメータ(構造類似度閾値θstr、探索範囲閾値γ、γ)、構造類似度計算部14で算出された構造類似度、及び位置情報解析部12で算出されたノードの位置情報に基づいて、階層構造解析部10で生成されたDOMツリーの各ノードからクラスタ候補となるノードの組を探索する。そして、候補探索の結果として、上記(1)式で算出される構造類似度Sstr(A、B)をクラスタ候補のノードの組(i,j)の各々について格納した、上記図6に示す構造類似度テーブルLstr^を作成する。また、上記(2)式で算出される位置類似度Spos(A、B)をクラスタ候補のノードの組(i,j)の各々について格納した、上記図7に示す位置類似度テーブルLpos^を作成する。そして、上記図5に示す、少なくとも1つのクラスタ候補に属する各ノードを各クラスタとするクラスタテーブルC^を作成する。
具体的には、DOMツリーのノードを辿って、構造類似度計算部14で算出された構造類似度が閾値以上で、位置情報解析部12で算出されたノードの表示位置が、探索範囲内の2つのノードのペアを検出する。そして、検出されたノードのペアの一方のノードに対して、他方のノードとなるノード群内で親子関係がないように、親子関係があるノードのうちの、当該一方のノードとの間の構造類似度が最大となるノードを当該他方のノードとして選択し、クラスタ候補とする。そして、各クラスタ候補の構造類似度、及び位置類似度を格納して、構造類似度テーブルLstr^、位置類似度テーブルLpos^を作成し、記憶部2へ格納する。
The candidate search unit 18 receives the parameters (structure similarity threshold θ str , search range thresholds γ 0 , γ 1 ) input by the input unit 1, the structure similarity calculated by the structure similarity calculation unit 14, and position information analysis Based on the node position information calculated by the unit 12, a set of nodes serving as cluster candidates is searched from each node of the DOM tree generated by the hierarchical structure analysis unit 10. Then, as a result of the candidate search, the structural similarity S str (A, B) calculated by the above equation (1) is stored for each cluster candidate node set (i, j), as shown in FIG. A structural similarity table L str ^ is created. Further, the position similarity table L pos shown in FIG. 7 in which the position similarity S pos (A, B) calculated by the above equation (2) is stored for each cluster candidate node set (i, j). Create ^. Then, the cluster table C ^ shown in FIG. 5 is created in which each node belonging to at least one cluster candidate is each cluster.
Specifically, the nodes of the DOM tree are traced, the structure similarity calculated by the structure similarity calculation unit 14 is equal to or greater than a threshold value, and the display position of the node calculated by the position information analysis unit 12 is within the search range. Detect a pair of two nodes. And a structure between the detected node pair and the one of the nodes having a parent-child relationship so that there is no parent-child relationship in the node group that is the other node. The node having the maximum similarity is selected as the other node and is set as a cluster candidate. Then, the structure similarity and position similarity of each cluster candidate are stored, and a structure similarity table L str ^ and a position similarity table L pos ^ are created and stored in the storage unit 2.

クラスタリング部20は、候補探索部18で作成された構造類似度テーブルLstr^、位置類似度テーブルLpos^、及びクラスタテーブルC^に基づいて、クラスタテーブルC^のクラスタを統合して、クラスタテーブルC^を更新することを繰り返して、ノードをクラスタリングする。ここで、位置類似度計算部16で算出された位置類似度および構造類似度計算部14で算出された構造類似度が指定した閾値以上のクラスタ候補のうち、構造類似度が最大のクラスタ候補のノードペアに対応する2つのクラスタを統合してクラスタテーブルC^を更新することを繰り返す。 The clustering unit 20 integrates the clusters of the cluster table C ^ based on the structure similarity table L str ^, the position similarity table L pos ^, and the cluster table C ^ created by the candidate search module 18 to obtain a cluster. The nodes are clustered by repeatedly updating the table C ^. Here, among the cluster candidates whose positional similarity calculated by the positional similarity calculation unit 16 and the structural similarity calculated by the structural similarity calculation unit 14 are equal to or greater than the specified threshold, the cluster candidate having the maximum structural similarity is selected. It is repeated that the two clusters corresponding to the node pair are integrated to update the cluster table C ^.

優先度計算部22は、クラスタリング部20で生成されたクラスタの優先度を計算する。具体的には、入力部1により入力されたキーワードリストKW^、階層構造解析部10により作成された階層構造情報テーブルK^、及びクラスタリング部20で得られたクラスタテーブルC^に基づいて、各クラスタについて、当該クラスタに属する各ノード毎に、当該ノードが含むキーワードの重みの和を算出し、その最大値を当該クラスタの優先度として計算する。   The priority calculation unit 22 calculates the priority of the cluster generated by the clustering unit 20. Specifically, based on the keyword list KW ^ input by the input unit 1, the hierarchical structure information table K ^ created by the hierarchical structure analysis unit 10, and the cluster table C ^ obtained by the clustering unit 20, For each node belonging to the cluster, a sum of keyword weights included in the node is calculated, and the maximum value is calculated as the priority of the cluster.

出力部4は、優先度計算部22で算出した各クラスタの優先度に基づいて、クラスタリング部20で生成されたクラスタリング結果を優先度順に出力する。   The output unit 4 outputs the clustering results generated by the clustering unit 20 in order of priority based on the priority of each cluster calculated by the priority calculation unit 22.

<作用>
次に、本実施の形態に係る文書構造解析装置の作用について説明する。まず、webページ群、パラメータ(構造類似度閾値θstr、位置類似度閾値θpos、探索範囲閾値γ、γ)、及びキーワードリストKW^が文書構造解析装置に入力され、記憶部2に格納される。そして、文書構造解析装置において、図12に示す構造化文書情報抽出装置処理ルーチンが実行される。
<Action>
Next, the operation of the document structure analysis apparatus according to this embodiment will be described. First, a web page group, parameters (structure similarity threshold θ str , position similarity threshold θ pos , search range thresholds γ 0 , γ 1 ) and a keyword list KW ^ are input to the document structure analysis apparatus and stored in the storage unit 2. Stored. Then, the structured document information extracting device processing routine shown in FIG. 12 is executed in the document structure analyzing device.

まず、ステップS100において、記憶部2から、入力部1により入力されたwebページ群、パラメータ(構造類似度閾値θstr、位置類似度閾値θpos、探索範囲閾値γ、γ)、及びキーワードリストKW^を読み込む。 First, in step S100, a web page group, parameters (structure similarity threshold θ str , position similarity threshold θ pos , search range thresholds γ 0 , γ 1 ) and keywords input from the storage unit 2 by the input unit 1 and keywords. Read the list KW ^.

次に、ステップS102において、webページに対して階層構造の解析を行う。具体的には、記憶部2から、入力部1により入力されたwebページを1つ読み出し、HTMLタグが示す各要素に対応する各ノードを含むDOM(Document Object Model)ツリーを生成すると共に、DOMツリー中の各ノードについて、自ノードと子孫の各ノードのノード名(属性名)でヒストグラムを作成し、上記図3に示す階層構造情報テーブルK^を作成し、記憶部2に格納する。   Next, in step S102, the hierarchical structure is analyzed for the web page. Specifically, one web page input from the input unit 1 is read from the storage unit 2, and a DOM (Document Object Model) tree including each node corresponding to each element indicated by the HTML tag is generated. For each node in the tree, a histogram is created with the node name (attribute name) of each of its own node and descendant nodes, and the hierarchical structure information table K ^ shown in FIG. 3 is created and stored in the storage unit 2.

次に、ステップS104において、webページに対して、位置情報の解析を行う。具体的には、記憶部2から、入力部1により入力されたwebページを1つ読み出し、HTMLタグが示す各要素の、webブラウザ上での表示位置を各々計算し、上記図4に示す位置情報テーブルP^を作成し、記憶部2に格納する。   Next, in step S104, position information is analyzed for the web page. Specifically, one web page input from the input unit 1 is read from the storage unit 2, the display positions of each element indicated by the HTML tag on the web browser are calculated, and the positions shown in FIG. An information table P ^ is created and stored in the storage unit 2.

ステップS106では、記憶部2に記憶されているwebページ群の全てについて、上記ステップS102の構造情報解析、及び上記ステップS104の位置情報解析が終了したか否かを判定する。webページ群の全てについて解析が終了していない場合には、ステップS102へ移行する。webページ群の全てについて解析が終了している場合には、ステップS108へ移行する。   In step S106, it is determined whether or not the structural information analysis in step S102 and the positional information analysis in step S104 have been completed for all the web page groups stored in the storage unit 2. If the analysis has not been completed for all of the web page groups, the process proceeds to step S102. If the analysis has been completed for all of the web page groups, the process proceeds to step S108.

ステップS108では、各ノードから、クラスタ候補となるノードの組を探索するため、図13及び図14に示す候補探索処理ルーチンが実行される。また、上記図13及び上記図14に示す候補探索処理ルーチンに対応するアルゴリズムを図15及び図16に示す。   In step S108, candidate search processing routines shown in FIGS. 13 and 14 are executed in order to search for a set of nodes that are cluster candidates from each node. FIGS. 15 and 16 show algorithms corresponding to the candidate search processing routines shown in FIG. 13 and FIG.

<候補探索処理ルーチン>
候補探索処理ルーチンでは、各ノードからクラスタ候補となるノードの組を探索する処理が実行される。また、候補探索処理ルーチンは、webページ群から得られるwebページのペアの各々について実行される。また、同じwebページからなる各ペアについて、候補探索処理ルーチンが実行される。
<Candidate search processing routine>
In the candidate search processing routine, a process of searching for a set of nodes that are cluster candidates from each node is executed. The candidate search processing routine is executed for each pair of web pages obtained from the web page group. In addition, a candidate search processing routine is executed for each pair of the same web page.

はじめに、ステップS200において、処理対象となるwebページのペア(pageA,pageB)、パラメータ(構造類似度の閾値θstr、探索範囲を指定するパラメータγ、γ)及び上記ステップS104において作成された位置情報テーブルP^が再度読み込まれる。 First, in step S200, a web page pair (pageA, pageB) to be processed, parameters (threshold value θ str of structure similarity, parameters γ 0 , γ 1 specifying a search range), and the above-described step S104 are created. The position information table P ^ is read again.

次に、ステップS202において、pageAとpageBが同一であるか否かが判定される。そして、pageAとpageBが同一である場合には、ステップS204へ移行する。pageAとpageBが同一でない場合には、ステップS206へ移行する。   Next, in step S202, it is determined whether or not pageA and pageB are the same. If pageA and pageB are the same, the process proceeds to step S204. If pageA and pageB are not the same, the process proceeds to step S206.

ステップS204では、探索範囲を指定する閾値γにγの値が入力される。ステップS206では、γにγの値が入力される。ここで、γ、γは各々、同一ページ・異なるページでの探索範囲を指定するパラメータである。 In step S204, a value of γ 0 is input to the threshold value γ that specifies the search range. In step S206, the value of γ 1 is input to γ. Here, γ 0 and γ 1 are parameters for designating search ranges on the same page and different pages, respectively.

次に、ステップS208では、図17に示すfirstChildルーチンが呼び出され、firstChildルーチンにpageAが入力される。そして、firstChildルーチンの返す値が、クラスタ候補となりうるノードの組の一方のノードを示すノード番号n1に代入される。なお、firstChildルーチンは、pageAが子ノードを有している場合には、pageAの最初の子ノードのノード番号を返す。pageAが子ノードを有していない場合には、φ(空)を返す。   Next, in step S208, the firstChild routine shown in FIG. 17 is called and pageA is input to the firstChild routine. Then, the value returned by the firstChild routine is assigned to the node number n1 indicating one node of the set of nodes that can be cluster candidates. The firstChild routine returns the node number of the first child node of pageA when pageA has a child node. If pageA has no child nodes, it returns φ (empty).

次に、ステップS210では、上記ステップS208で算出されたn1の値がφ(空)であるか否かが判定される。n1の値がφ(空)でない場合には、ステップS212へ移行する。n1の値がφ(空)である場合には、ステップS306へ移行する。   Next, in step S210, it is determined whether or not the value of n1 calculated in step S208 is φ (empty). If the value of n1 is not φ (empty), the process proceeds to step S212. When the value of n1 is φ (empty), the process proceeds to step S306.

次に、ステップS212では、クラスタ候補の他方のノードの候補となるノードを示すノード番号bnodeにφ(空)が代入され、scoreに−1が代入される。   Next, in step S212, φ (empty) is substituted for the node number bnode indicating the candidate node of the other cluster candidate, and −1 is substituted for score.

次に、ステップS214では、pageAについての位置情報テーブルP^のn1番目のノード番号に対応する位置情報が、(x,y,w,h)に代入される。 Next, in step S214, the position information corresponding to the n1st node number of the position information table P A ^ for pageA is substituted into (x 1 , y 1 , w 1 , h 1 ).

ステップS216では、pageAとpageBが同一であるか否かが判定される。そして、pageAとpageBが同一である場合には、ステップS218へ移行する。pageAとpageBが同一でない場合には、ステップS220へ移行する。   In step S216, it is determined whether pageA and pageB are the same. If pageA and pageB are the same, the process proceeds to step S218. If pageA and pageB are not the same, the process proceeds to step S220.

ステップS218では、図18に示すnextSiblingルーチンが呼び出され、nextSiblingルーチンにn1が入力される。そして、nextSiblingルーチンの返す値がクラスタ候補となりうるノードの組の他方のノードを示すノード番号n2に代入される。なお、nextSiblingルーチンは、入力されたノード番号n1に対応するノードが、兄弟ノードを有している場合には、ノード番号n1に対応するノードの最初の兄弟ノードのノード番号を返す。ノード番号n1に対応するノードが、兄弟ノードを有していない場合には、φ(空)を返す。   In step S218, the nextSibling routine shown in FIG. 18 is called and n1 is input to the nextSibling routine. Then, the value returned by the nextSibling routine is substituted into the node number n2 indicating the other node of the set of nodes that can be cluster candidates. The nextSibling routine returns the node number of the first sibling node of the node corresponding to the node number n1, when the node corresponding to the input node number n1 has a sibling node. If the node corresponding to the node number n1 does not have a sibling node, φ (empty) is returned.

ステップS220では、上記図17に示すfirstChildルーチンが呼び出され、firstChildルーチンにpageBが入力される。そして、firstChildルーチンの返す値がn2に代入される。   In step S220, the firstChild routine shown in FIG. 17 is called, and pageB is input to the firstChild routine. The value returned by the firstChild routine is assigned to n2.

次に、ステップS222では、上記ステップS218若しくは上記ステップS220で算出されたn2の値、又は後述するステップS240で前回算出されたn2の値がφ(空)であるか否かが判定される。n2の値がφ(空)でない場合には、ステップS224へ移行する。n1の値がφ(空)である場合には、ステップS300へ移行する。   Next, in step S222, it is determined whether or not the value of n2 calculated in step S218 or step S220 or the value of n2 previously calculated in step S240 described later is φ (empty). If the value of n2 is not φ (empty), the process proceeds to step S224. When the value of n1 is φ (empty), the process proceeds to step S300.

次に、ステップS224では、上記ステップS208又は後述するステップS304で前回算出されたn1と、上記ステップS218若しくは上記ステップS220又は後述するステップS240で前回算出されたn2に基づいて、構造類似度Sstr(n1,n2)を算出し、構造類似度Sstr(n1,n2)を比較用の構造類似度値simへ代入する。 Next, in step S224, the structural similarity S str is based on n1 previously calculated in step S208 or step S304 described later and n2 previously calculated in step S218 or step S220 or step S240 described later. (N1, n2) is calculated, and the structural similarity S str (n1, n2) is substituted into the structural similarity value sim for comparison.

次に、ステップS226では、上記ステップS224で算出されたsimが、上記ステップS200で入力されたパラメータ(構造類似度の閾値θstr)以上であるか否かを判定する。そして、simが構造類似度の閾値θstr以上であればステップS228へ移行する。simが構造類似度の閾値θstr未満であればステップS240へ移行する。 Next, in step S226, it is determined whether or not sim calculated in step S224 is equal to or greater than the parameter (structural similarity threshold θ str ) input in step S200. If sim is equal to or greater than the structural similarity threshold θ str , the process proceeds to step S228. If sim is less than the structural similarity threshold θ str , the process proceeds to step S240.

次に、ステップS228では、pageBについての位置情報テーブルP^のn2番目のノード番号に対応する位置情報が、(x,y,w,h)に代入される。 Next, in step S228, the position information corresponding to the n2nd node number of the position information table P B ^ for pageB is substituted into (x 2 , y 2 , w 2 , h 2 ).

次に、ステップS230では、上記ステップS204又はステップS206で入力されたγの値、上記ステップS214で代入された(x,y,w,h)、及び上記ステップS228で代入された(x,y,w,h)に基づいて、判定が行われる。具体的には、x−x≦γwであって、かつx−x≦γwであって、かつy−y≦γhであって、かつy−y≦γhと判定される場合には、ステップS232へ移行する。それ以外の場合には、ステップS240へ移行する。 Next, in step S230, the value of γ input in step S204 or step S206, (x 1 , y 1 , w 1 , h 1 ) substituted in step S214, and substituted in step S228 above. A determination is made based on (x 2 , y 2 , w 2 , h 2 ). Specifically, x 2 −x 1 ≦ γw 1 , x 1 −x 2 ≦ γw 2 , y 2 −y 1 ≦ γh 1 , and y 1 −y 2 ≦ If it is determined that γh 2 , the process proceeds to step S232. Otherwise, the process proceeds to step S240.

次に、ステップS232では、上記ステップS212で値が代入されたbnode又は後述するステップS234若しくはステップS238で前回値が代入されたbnode、及び上記ステップS218若しくはステップS220で値が代入されたn2又は後述するステップS240で前回値が代入されたn2に基づいて、判定が行われる。具体的には、bnode≠φ(空)であって、かつn2がbnodeと親子関係にないと判定される場合には、ステップS234へ移行する。それ以外の場合には、ステップS236へ移行する。   Next, in step S232, the bnode in which the value is substituted in step S212, the bnode in which the previous value is substituted in step S234 or step S238 described later, and n2 in which the value is substituted in step S218 or step S220 described later In step S240, determination is performed based on n2 to which the previous value is substituted. Specifically, when it is determined that bnode ≠ φ (empty) and n2 is not in a parent-child relationship with bnode, the process proceeds to step S234. Otherwise, the process proceeds to step S236.

ステップS234では、構造度類似度テーブルLstr^のLstr({n1,bnode})に、前回本ステップS234で算出された親子関係にあるbnodeにおける構造類似度の最大値scoreの値、又は後述するステップS238で前回算出されたscoreの値を代入する。そして、位置類似度テーブルLpos^のLpos({n1,bnode})に、位置類似度Spos(n1,bnode)の値を代入する。また、クラスタテーブルC^のC(n1)に、上記ステップS208で値が代入されたn1、又は後述するステップS304で前回算出されたn1の値を代入する。そして、クラスタテーブルC^のC(bnode)に、前回本ステップS234で算出されたbnodeの値、又は後述するステップS238で前回算出されたbnodeの値を代入する。また、bnodeに、上記ステップS218若しくはステップS220で算出されたn2の値、又は後述するステップS240で前回算出されたn2の値を代入する。そして、scoreに上記ステップS224で算出されたsimの値を代入する。 In step S234, the maximum structural score value of the structural similarity in the bnode having the parent-child relationship calculated in the previous step S234 is stored in L str ({n1, bnode}) of the structural degree similarity table L str ^ or described later. In step S238, the previously calculated score value is substituted. Then, the value of the position similarity S pos (n1, bnode) is substituted into L pos ({n1, bnode}) of the position similarity table L pos ^. Further, n1 into which the value is substituted in step S208 or the value of n1 previously calculated in step S304 described later is substituted into C (n1) of the cluster table C ^. Then, the value of bnode previously calculated in step S234 or the value of bnode previously calculated in step S238 described later is substituted into C (bnode) of the cluster table C ^. Further, the value of n2 calculated in step S218 or step S220 or the value of n2 calculated last time in step S240 described later is substituted into bnode. Then, the value of sim calculated in step S224 is substituted for score.

ステップS236では、上記ステップ212で算出されたscoreの値、又はステップS234で前回算出されたscoreの値若しくは後述するステップS238で前回算出されたscoreの値と、上記ステップS224で算出されたsimの値に基づいて、判定が行われる。具体的には、scoreの値がsimの値よりも小さいと判定された場合には、ステップS238へ移行する。scoreの値がsimの値以上であると判定された場合には、ステップS240へ移行する。   In step S236, the score value calculated in step 212 above, the score value previously calculated in step S234, or the score value previously calculated in step S238 described later, and the sim value calculated in step S224 above. A determination is made based on the value. Specifically, if it is determined that the score value is smaller than the sim value, the process proceeds to step S238. When it is determined that the score value is equal to or greater than the sim value, the process proceeds to step S240.

次にステップS238では、bnodeに、上記ステップS218若しくはステップS220で算出されたn2の値、又は後述するステップS240で前回算出されたn2の値が代入される。そして、親子関係にあるbnodeにおける構造類似度の最大値scoreに上記ステップS224で算出されたsimの値を代入する。   Next, in step S238, the value of n2 calculated in step S218 or step S220 or the value of n2 calculated in the previous step in step S240 described later is substituted for bnode. Then, the value of sim calculated in step S224 is substituted for the maximum value score of the structural similarity in the bnode having the parent-child relationship.

次にステップS240では、図19に示すnextNodeルーチンが呼び出され、nextNodeルーチンにpageBと、n2が入力される。そして、nextNodeルーチンの返す値がn2に代入される。なお、nextNodeルーチンは、入力されたpageB内のノードn2が、子ノードを有している場合には、ノードn2の最初の子ノードのノードを示すノード番号を返す。ノードn2が、子ノードを有していない場合には、ノードn2の最初の兄弟ノードを示すノード番号を返す。ノードn2が、兄弟ノードを有していない場合には、ノードn2の親ノードの次の兄弟ノードを示すノード番号を返す。それ以外の場合には、φ(空)を返す。   Next, in step S240, the nextNode routine shown in FIG. 19 is called, and pageB and n2 are input to the nextNode routine. The value returned by the nextNode routine is assigned to n2. The nextNode routine returns a node number indicating the node of the first child node of the node n2 when the node n2 in the input pageB has a child node. When the node n2 has no child node, a node number indicating the first sibling node of the node n2 is returned. If the node n2 has no sibling node, a node number indicating the next sibling node of the parent node of the node n2 is returned. Otherwise, returns φ (empty).

ステップS300では、上記ステップS212で算出されたbnodeの値、又は上記ステップS234若しくはステップS238で算出されたbnodeの値がφ(空)であるか否かを判定する。bnodeの値がφ(空)でない場合には、ステップS302へ移行する。bnodeの値がφ(空)である場合には、ステップS304へ移行する。   In step S300, it is determined whether or not the bnode value calculated in step S212 or the bnode value calculated in step S234 or S238 is φ (empty). If the value of bnode is not φ (empty), the process proceeds to step S302. When the value of bnode is φ (empty), the process proceeds to step S304.

ステップS302では、構造度類似度テーブルLstr^のLstr({n1,bnode})に、上記ステップS234で算出されたscoreの値又は上記ステップS238で算出されたscoreの値を代入する。そして、位置類似度テーブルLpos^のLpos({n1,bnode})に、位置類似度Spos(n1,bnode)の値を代入する。また、クラスタテーブルC^のC(n1)に、上記ステップS208で算出されたn1の値又は後述するステップS304で前回算出されたn1の値を代入する。そして、クラスタテーブルC^のC(bnode)に、上記ステップS234又は上記ステップS238で算出されたbnodeの値を代入する。 In step S302, the score value calculated in step S234 or the score value calculated in step S238 is substituted into L str ({n1, bnode}) of the structural degree similarity table L str ^. Then, the value of the position similarity S pos (n1, bnode) is substituted into L pos ({n1, bnode}) of the position similarity table L pos ^. Further, the value of n1 calculated in step S208 or the value of n1 calculated last time in step S304 described later is substituted into C (n1) of the cluster table C ^. Then, the value of bnode calculated in step S234 or step S238 is substituted into C (bnode) of the cluster table C ^.

次に、ステップS304では、上記図19に示すnextNodeルーチンが呼び出され、nextNodeルーチンにpageAと、n1が入力される。そして、nextNodeルーチンの返す値がn1に代入される。   Next, in step S304, the nextNode routine shown in FIG. 19 is called, and pageA and n1 are input to the nextNode routine. Then, the value returned by the nextNode routine is substituted for n1.

ステップS306では、候補探索処理ルーチンの処理結果として、クラスタテーブルC^、構造類似度テーブルLstr^、位置類似度テーブルLpos^が結果として出力され、記憶部2へ格納される。 In step S306, the cluster table C ^, the structure similarity table Lstr ^, and the position similarity table Lpos ^ are output as results and stored in the storage unit 2 as processing results of the candidate search processing routine.

<クラスタリング処理ルーチン>
候補探索処理ルーチンの処理が終了した後には、上記図12に示す構造化文書情報抽出処理ルーチンのステップS110に戻る。ステップS110では、上記ステップS108の候補探索処理ルーチンで作成されたクラスタテーブルC^、構造類似度テーブルLstr^、位置類似度テーブルLpos^に基づいて、クラスタテーブルC^のクラスタを統合することを繰り返し行う。ステップS110では、図20に示すクラスタリング処理ルーチンが実行される。また、上記図20に示すクラスタリング処理ルーチンに対応するアルゴリズムを図21に示す。
<Clustering processing routine>
After the candidate search process routine is completed, the process returns to step S110 of the structured document information extraction process routine shown in FIG. In step S110, the clusters of the cluster table C ^ are integrated based on the cluster table C ^, the structural similarity table Lstr ^, and the position similarity table Lpos ^ created by the candidate search processing routine in step S108. Repeat. In step S110, the clustering processing routine shown in FIG. 20 is executed. FIG. 21 shows an algorithm corresponding to the clustering processing routine shown in FIG.

ステップS400では、上記ステップS108で算出されたクラスタテーブルC^、構造度類似度テーブルLstr^、位置類似度テーブルLpos^、及びパラメータ(構造類似度閾値θstr、位置類似度閾値θpos)が記憶部2から読み出される。 In step S400, the cluster table C ^, structure similarity table Lstr ^, position similarity table Lpos ^ calculated in step S108, and parameters (structure similarity threshold θstr , position similarity threshold θpos ) are calculated. Is read from the storage unit 2.

次にステップS402では、統合される候補となるクラスタを示すクラスタ番号p、q、統合される候補となるクラスタのペアにおける構造類似度の最大値maxSstrに初期値として−1が代入される。 Next, in step S402, −1 is assigned as an initial value to the cluster numbers p and q indicating candidate clusters to be integrated, and the maximum value maxS str of the structural similarity in a pair of candidate clusters to be integrated.

ステップS403では、構造類似度テーブルLstr^に基づいて、処理対象となるクラスタのペア({i,j}, Sstr)を設定する。 In step S403, a cluster pair ({i, j}, S str ) to be processed is set based on the structure similarity table L str ^.

次にステップS404では、maxSstrと構造類似度Sstrを比較する。そして、maxSstrがSstr未満であれば、ステップS406へ移行する。maxSstrがSstrより大きいならば、ステップS412へ移行する。 Next, in step S404, maxS str is compared with the structural similarity S str . If maxS str is less than S str , the process proceeds to step S406. If maxS str is greater than S str, the process proceeds to step S412.

ステップS406では、位置類似度Spos^に、上記ステップS400で読み出された位置類似度テーブルLpos^の値Lpos({i,j})が代入される。ここで、位置類似度Spos^=(Sxpos,Sypos,Swpos,Shpos)である。 In step S406, the value L pos ({i, j}) of the position similarity table L pos ^ read in step S400 is substituted for the position similarity S pos ^. Here, the position similarity S pos ^ = (Sx pos , Sy pos , Sw pos , Sh pos ).

次にステップS408では、上記ステップS406で代入された位置類似度Spos^=(Sxpos,Sypos,Swpos,Shpos)と、位置類似度閾値θposを比較する。そして、Sxpos≧θposであって、かつSwpos≧θposであるか、又はSypos≧θpoであって、かつShpos≧θposである場合には、ステップS410へ移行する。それ以外の場合には、ステップS412へ移行する。 In step S408, the position similarity S pos ^ = (Sx pos , Sy pos , Sw pos , Sh pos ) substituted in step S406 is compared with the position similarity threshold θ pos . Then, a Sx pos θ pos, and whether it is Sw pos θ pos, or a Sy posθ po, and in the case of Sh pos ≧ θ pos, the process proceeds to step S410. Otherwise, the process proceeds to step S412.

ステップS410では、上記ステップS402で初期値が代入されたp、q、maxSstrに(i,j,Sstr)の値が代入される。 In step S410, the values of (i, j, S str ) are substituted for p, q, and maxS str for which the initial values are substituted in step S402.

次に、ステップS412では、構造類似度テーブルLstr^に含まれる全てのデータ({i,j}、Sstr)について、ステップS404〜ステップS410の処理が終了しているか否かを判定する。終了している場合には、ステップS414へ移行する。終了していない場合には、ステップS403へ移行する。 Then determines, in step S412, all the data contained in the structural similarity table L str ^ ({i, j }, S str) for, whether the process of steps S404~ step S410 has ended. If completed, the process proceeds to step S414. If not completed, the process proceeds to step S403.

次に、ステップS414では、上記ステップS410で値が更新されたmaxSstrと、構造類似度閾値θstrとを比較する。maxSstrがθstr未満である場合には、ステップS434へ移行する。maxSstrがθstr以上である場合には、ステップS416へ移行する。 Next, in step S414, maxS str whose value is updated in step S410 is compared with the structural similarity threshold θ str . If maxS str is less than θ str , the process proceeds to step S434. If maxS str is greater than or equal to θ str, the process proceeds to step S416.

ステップS416では、クラスタテーブルC^に格納されたクラスタC^(p)に、クラスタC^(q)を統合して、記憶部2に記憶されたクラスタC^(p)を更新する。   In step S416, the cluster C ^ (q) stored in the cluster table C ^ is integrated with the cluster C ^ (q), and the cluster C ^ (p) stored in the storage unit 2 is updated.

次にステップS418では、クラスタテーブルC^のC(q)にφ(空)を格納する。   In step S418, φ (empty) is stored in C (q) of the cluster table C ^.

次にステップS420では、統合されたクラスタのペアp、qについての、記憶部2に記憶されている構造度類似度テーブルLstr^のLstr({p, q})にφ(空)を格納する。 Next, in step S420, φ (empty) is set in L str ({p, q}) of the structural degree similarity table L str ^ stored in the storage unit 2 for the integrated cluster pair p, q. Store.

次にステップS422では、統合されたクラスタのペアp、qについての、記憶部2に記憶されている位置類似度テーブルLpos^のLpos({p, q})にφ(空)を格納する。 In step S422, φ (empty) is stored in L pos ({p, q}) of the position similarity table L pos ^ stored in the storage unit 2 for the integrated cluster pair p, q. To do.

ステップS423では、クラスタテーブルC^に基づいて、処理対象となるクラスタCを設定する。 In step S423, the cluster C i to be processed is set based on the cluster table C ^.

次にステップS424では、構造類似度テーブルLstr^の値Lstr({p, i})及びLstr({q, i})のうち大きい値の方を、記憶部2に記憶された構造類似度テーブルLstr^のLstr({p, i})に格納する。 Next, in step S424, the larger value of the values L str ({p, i}) and L str ({q, i}) of the structure similarity table L str ^ is stored in the storage unit 2. Stored in L str ({p, i}) of the similarity table L str ^.

次にステップS426では、記憶部2に記憶されている構造類似度テーブルLstr^のLstr{q, i})にφ(空)を格納する。 In step S426, φ (empty) is stored in L str {q, i}) of the structural similarity table L str ^ stored in the storage unit 2.

次にステップS428では、位置類似度テーブルLpos^の値Lpos({p, i})及びLpos({q, i})のうち大きい値の方を、記憶部2に記憶された構造類似度テーブルLpos^のLpos({p, i})に格納する。 Next, in step S428, the larger value of the values L pos ({p, i}) and L pos ({q, i}) of the position similarity table L pos ^ is stored in the storage unit 2. Stored in L pos ({p, i}) of the similarity table L pos ^.

次にステップS430では、記憶部2に記憶されている位置類似度テーブルLstr^のLstr({q, i})にφ(空)を格納する。 In step S430, φ (empty) is stored in L str ({q, i}) of the position similarity table L str ^ stored in the storage unit 2.

次にステップS432では、空でない全てのクラスタCについてステップS424〜ステップS430の処理が終了しているか判定する。終了している場合には、ステップS402へ移行する。終了していない場合には、ステップS423へ移行する。 In step S432, it determines whether the processing of steps S424~ step S430 for all the clusters C i is not empty is completed. If completed, the process proceeds to step S402. If not completed, the process proceeds to step S423.

ステップS434では、クラスタリング処理ルーチンの処理結果として、記憶部2に記憶されているクラスタテーブルC^が結果として出力される。   In step S434, the cluster table C ^ stored in the storage unit 2 is output as a result as the processing result of the clustering processing routine.

クラスタリング処理ルーチンの処理が終了した後には、上記図12に示す構造化文書情報抽出処理ルーチンのステップS112に戻る。ステップS112では、上記ステップS100で入力されたキーワードリストKW^、上記ステップS102で得られた階層構造情報テーブルK^、及び上記ステップS110のクラスタリング処理ルーチンで得られたクラスタテーブルC^に基づいて、クラスタの優先度を算出する。図22にステップS112で実行される優先度計算のアルゴリズムを示す。   After the clustering processing routine is completed, the process returns to step S112 of the structured document information extraction processing routine shown in FIG. In step S112, based on the keyword list KW ^ input in step S100, the hierarchical structure information table K ^ obtained in step S102, and the cluster table C ^ obtained in the clustering processing routine in step S110, Calculate cluster priority. FIG. 22 shows a priority calculation algorithm executed in step S112.

ステップS112では、上記ステップS100で入力されたキーワードリストKW^、上記ステップS102で得られた階層構造情報テーブルK^、及び上記ステップS110で作成されたクラスタテーブルC^に基づいて、各クラスタについて、当該クラスタに属する各ノード毎に、当該ノードが含むキーワードの重みの和を算出し、その最大値を当該クラスタの優先度として計算する。   In step S112, for each cluster, based on the keyword list KW ^ input in step S100, the hierarchical structure information table K ^ obtained in step S102, and the cluster table C ^ created in step S110, For each node belonging to the cluster, the sum of keyword weights included in the node is calculated, and the maximum value is calculated as the priority of the cluster.

次にステップS114では、上記ステップS112で算出された優先度順に、上記ステップS110で算出したクラスタリング結果を出力部4により出力する。   Next, in step S114, the output unit 4 outputs the clustering results calculated in step S110 in the priority order calculated in step S112.

次に、本実施の形態に係る文書構造解析装置の実際の動作例を以下で説明する。   Next, an actual operation example of the document structure analysis apparatus according to the present embodiment will be described below.

<動作例1>
動作例1では、同一ページ内の繰り返し部分の抽出例について説明する。動作例1では、上記図8に示すwebページが文書構造解析装置に入力される。また、上記図8に示すwebページのbody以下のHTMLタグ構造を上記図9に示す。また、入力部1には、図23に示すキーワードリストが入力される。また、入力部1に入力されるパラメータとして、構造類似度閾値θstr=0.7、位置類似度閾値θpos=0.8、探索範囲閾値γ=1.5のデータが入力部1に入力される。
<Operation example 1>
In the operation example 1, an example of extracting repeated portions in the same page will be described. In the first operation example, the web page shown in FIG. 8 is input to the document structure analysis apparatus. Also, FIG. 9 shows the HTML tag structure below the body of the web page shown in FIG. The keyword list shown in FIG. 23 is input to the input unit 1. As parameters input to the input unit 1, data of the structural similarity threshold θ str = 0.7, the position similarity threshold θ pos = 0.8, and the search range threshold γ 0 = 1.5 are input to the input unit 1. Entered.

ステップS102では、上記図10に示すDOM(Document Object Model)ツリーが生成され、上記図11に示す階層構造情報テーブルK^が作成される。   In step S102, the DOM (Document Object Model) tree shown in FIG. 10 is generated, and the hierarchical structure information table K ^ shown in FIG. 11 is created.

ステップS104では、図24に示す位置情報テーブルP^が作成される。   In step S104, the position information table P ^ shown in FIG. 24 is created.

次にステップS108において、上記図13及び上記図14に示す候補探索処理ルーチンが実行される。   Next, in step S108, the candidate search processing routine shown in FIG. 13 and FIG. 14 is executed.

最初のステップS208では、n1←1が代入される。   In the first step S208, n1 ← 1 is substituted.

次に、ステップS216で、入力されたwebページのペアが同一であるか否かを判定する。動作例1では、ペアとなるwebページが同一であり、ステップS218へ移行する。   Next, in step S216, it is determined whether or not the input web page pair is the same. In the operation example 1, the paired web pages are the same, and the process proceeds to step S218.

次のステップS218で、n1のsibling(兄弟ノード)はいないので、n2←φ(空)が代入される。   In the next step S218, since there is no sibling (sibling node) of n1, n2 ← φ (empty) is substituted.

そして、ステップS304では、n1←2が代入される。   In step S304, n1 ← 2 is substituted.

そして、2回目のステップS218では、n2←14が代入される。   In the second step S218, n2 ← 14 is substituted.

そして、ステップS224において、構造類似度計算部16が呼び出される。構造類似度計算部16では、ステップS102において階層構造解析部10により算出された上記図11に示す階層構造情報テーブルK^から、K^(2)=(0,10,2),K^(14)=(0,9,2)が読み込まれる。そして、階層構造情報テーブルK^から読み込まれた値を上記(1)式に代入して計算すると、以下のように構造類似度が算出される。   In step S224, the structural similarity calculation unit 16 is called. In the structural similarity calculation unit 16, from the hierarchical structure information table K ^ shown in FIG. 11 calculated by the hierarchical structure analysis unit 10 in step S102, K ^ (2) = (0, 10, 2), K ^ ( 14) = (0, 9, 2) is read. When the value read from the hierarchical structure information table K ^ is substituted into the above equation (1) and calculated, the structural similarity is calculated as follows.

上記(3)式で算出された構造類似度Sstrは、simへ代入される。 The structural similarity S str calculated by the above equation (3) is substituted into sim.

そして次のステップS226において、上記(3)式で算出された構造類似度Sstrが構造類似度閾値θstr以上であるか否かが判定される。上記(3)式で算出された構造類似度Sstr(2,14)≒0.92で、構造類似度閾値θstr=0.7であるため、構造類似度Sstr(2,14)の値が代入されたsimとθstrの関係は、sim≧とθstrとなる。従って、ステップS228へ移行する判定がされる。 Then, in the next step S226, it is determined whether or not the structural similarity Sstr calculated by the above equation (3) is equal to or larger than the structural similarity threshold θstr . Since the structural similarity S str (2,14) ≈0.92 calculated by the above equation (3) and the structural similarity threshold θ str = 0.7, the structural similarity S str (2,14) The relationship between sim and θ str into which the value is substituted is sim ≧ and θ str . Accordingly, it is determined to proceed to step S228.

次に、ステップS228では、上記ステップS218でn2←14が代入されているため、位置情報テーブルP^の14番のノード番号に対応する位置情報が(x,y,w,h)に代入される。 Next, in step S228, since n2 ← 14 is substituted in step S218, the position information corresponding to the 14th node number of the position information table P B ^ is (x 2 , y 2 , w 2 , h 2 ).

次に、ステップS230では、上記図24に示す動作例1の位置情報テーブルP^から、(x,y,w,h)=(0.56,0.37,12,8.5)、(x,y,w,h)=(0.56,9.25,4,0.7)であり、又上記ステップS204で、γ=1.5が代入されているので、ステップS230の判定式に照らすと、範囲内であると判定される。 Next, in step S230, (x 1 , y 1 , w 1 , h 1 ) = (0.56, 0.37, 12, 8,. 5), (x 2 , y 2 , w 2 , h 2 ) = (0.56, 9.25, 4, 0.7), and γ = 1.5 is substituted in step S204. Therefore, according to the determination formula of step S230, it is determined that the value is within the range.

そして、候補bnode←φ(空)が代入されているので、ステップS238で、候補bnode←14が代入され、score←0.92の値が代入され、候補が更新される。   Since the candidate bnode ← φ (empty) is substituted, the candidate bnode ← 14 is substituted, the value of score ← 0.92 is substituted in step S238, and the candidate is updated.

次にステップS240では、n2←15が代入される。   Next, in step S240, n2 ← 15 is substituted.

次に2回目のステップS224では、n1(=2)とn2(=15)について、上記の処理が行われる。ここで、n1(=2)とn2(=15)の構造類似度Sstr(2,15)≒0.41であり、構造類似度閾値θstr=0.7未満であるので、何もせずに次のノードを調べる。ノード24までは、構造類似度Sstrが構造類似度閾値θstr=0.7未満であるので、何もしない。 Next, in the second step S224, the above processing is performed for n1 (= 2) and n2 (= 15). Here, since the structural similarity S str (2,15) ≈0.41 between n1 (= 2) and n2 (= 15) and less than the structural similarity threshold θ str = 0.7, nothing is done. Check the next node. Up to the node 24, the structure similarity S str is less than the structure similarity threshold θ str = 0.7, so nothing is done.

そして、n2がノード25になったときに、n1=2とn2=25の構造類似度Sstr(2,25)≒0.92で、かつ上記ステップS230で判定される表示位置も範囲内なので、ステップS232へ移行する。 When n2 becomes node 25, the structural similarity S str (2,25) ≈0.92 between n1 = 2 and n2 = 25, and the display position determined in step S230 is within the range. The process proceeds to step S232.

そして、ステップS232では、現在の候補bnode(=14)と、ノード25を比較する。ノード25はノード14と親子関係にないので、ステップS234へ移行する。   In step S232, the current candidate bnode (= 14) is compared with the node 25. Since the node 25 is not in a parent-child relationship with the node 14, the process proceeds to step S234.

そして、ステップS234では、ノード2とノード14の組の構造類似度の値が代入されているscoreの値を構造類似度テーブルLstr^に格納する。さらに、ノード2とノード14の組の位置類似度を計算し、位置類似度テーブルLstr^に格納する。そして現在の候補bnode←25として、更新する。 In step S234, the value of the score into which the value of the structural similarity of the pair of the node 2 and the node 14 is substituted is stored in the structural similarity table L str ^. Further, the position similarity of the set of the node 2 and the node 14 is calculated and stored in the position similarity table L str ^. The current candidate bnode ← 25 is updated.

同様に、上記の処理を進めると、n1=5とn2=8に進んだときに、ステップS226の構造類似度の条件と、ステップS230の表示位置の条件が満たされるので、ステップS238において候補bnodeを更新する。   Similarly, when the above process is advanced, when the process proceeds to n1 = 5 and n2 = 8, the condition of the structural similarity in step S226 and the condition of the display position in step S230 are satisfied. Update.

次に、n1=5とn2=10のときに、再度、ステップS226の構造類似度の条件とステップS230の表示位置の条件が満たされるが、ノード8と10は親子関係にありノード10の方が構造類似度が高いので、ステップ236へ移行し、ノード5とノード8の組は保存されないことになる。   Next, when n1 = 5 and n2 = 10, the structural similarity condition in step S226 and the display position condition in step S230 are satisfied again, but nodes 8 and 10 are in a parent-child relationship, and the node 10 Since the structural similarity is high, the process proceeds to step 236, and the pair of the node 5 and the node 8 is not saved.

以上のように処理がされた結果、上記図12に示すステップS108の候補探索処理ルーチンの実行結果として、図25に示すような構造類似度テーブルLstr^、図26に示すような位置類似度テーブルLpos^、及び図27に示すようなクラスタテーブルC^が作成される。 As a result of the processing as described above, as the execution result of the candidate search processing routine in step S108 shown in FIG. 12, the structure similarity table L str ^ as shown in FIG. 25 and the position similarity as shown in FIG. A table L pos ^ and a cluster table C ^ as shown in Fig. 27 are created.

次に、上記図12に示すステップS110において、上記図20に示すクラスタリング処理ルーチンが実行される。   Next, in step S110 shown in FIG. 12, the clustering processing routine shown in FIG. 20 is executed.

例えば、ノード2と25については、上記図25に示すように構造類似度Sstr(2,25)≒0.92であって、閾値(θstr=0.7)以上であるが、上記図26に示すように、位置類似度Spos(2,25)≒(0.36,1,0.67,0.67)であって、上記図20に示すクラスタリング処理ルーチンのステップS408の条件を満たさないので統合されない。 For example, for the nodes 2 and 25, as shown in FIG. 25, the structural similarity S str (2,25) ≈0.92, which is equal to or greater than the threshold (θ str = 0.7), As shown in FIG. 26, the position similarity S pos (2,25) ≈ (0.36, 1,0.67,0.67), and the condition of step S408 of the clustering processing routine shown in FIG. Since it does not satisfy, it is not integrated.

以上のような処理の結果、クラスタリング結果は図28に示すような結果となる。   As a result of the above processing, the clustering result is as shown in FIG.

クラスタリング処理ルーチンの処理が終了した後には、上記図12に示す構造化文書情報抽出処理ルーチンのステップS112に戻る。ステップS112では、上記ステップS110のクラスタリング処理ルーチンで作成されたクラスタテーブルC^に基づいて、クラスタの優先度を算出する。   After the clustering processing routine is completed, the process returns to step S112 of the structured document information extraction processing routine shown in FIG. In step S112, the cluster priority is calculated based on the cluster table C ^ created by the clustering processing routine in step S110.

従って、ステップS112では、上記図28に示す各クラスタについて、上記図22に示すアルゴリズムの処理を繰り返す。例えば、上記図28に示すクラスタ2は{2,14}のノードを含んでおり、上記図11に示すように、ノード2は上記図23に示すキーワード”タイトル”,および,”著者”を共に含んでいるので、優先度は2となる。同様に、ノード14も優先度は2となる。クラスタの優先度は各ノードの優先度の最大値なので、クラスタ2の優先度は2となる。また、クラスタ6は、ノード6が”タイトル”を、ノード7が”著者”を含んでいるので、それらの最大値がクラスタの優先度となるので、優先度は1となる。   Accordingly, in step S112, the algorithm processing shown in FIG. 22 is repeated for each cluster shown in FIG. For example, the cluster 2 shown in FIG. 28 includes {2, 14} nodes. As shown in FIG. 11, the node 2 has the keywords “title” and “author” shown in FIG. The priority is 2. Similarly, the priority of the node 14 is 2. Since the priority of the cluster is the maximum value of the priority of each node, the priority of cluster 2 is 2. Further, since the node 6 includes the “title” and the node 7 includes the “author”, the maximum value thereof is the cluster priority, so the priority is 1.

次のステップS114では、上記ステップS112で算出された優先度順に、上記ステップS110で算出したクラスタリング結果を出力する。
従って、ステップS112では、図29に示すように、優先度順にクラスタが出力される。
In the next step S114, the clustering results calculated in step S110 are output in the order of priority calculated in step S112.
Therefore, in step S112, clusters are output in order of priority as shown in FIG.

図8及び上記図29を参照すると、階層構造のある繰り返しが正しく抽出されていることがわかる。   Referring to FIG. 8 and FIG. 29 above, it can be seen that a certain repetition having a hierarchical structure is correctly extracted.

<動作例2>
動作例2では、異なるページの繰り返し部分の抽出例について説明する。動作例2では、図30に示すpageA,pageBが、webページとして文書構造解析装置に入力される。また、上記図30に示すwebページのbody以下のHTMLタグ構造を図31に示す。また、入力部1には、図32に示すキーワードリストが入力される。また、入力部1に入力されるパラメータとして、構造類似度閾値θstr=0.7、位置類似度閾値θpos=0.8、探索範囲閾値γ=0.5のデータが入力部1に入力される。
<Operation example 2>
In the operation example 2, an example of extracting repeated portions of different pages will be described. In the operation example 2, pageA and pageB shown in FIG. 30 are input to the document structure analysis apparatus as web pages. FIG. 31 shows an HTML tag structure below the body of the web page shown in FIG. In addition, the keyword list shown in FIG. As parameters input to the input unit 1, data of the structural similarity threshold θ str = 0.7, the position similarity threshold θ pos = 0.8, and the search range threshold γ 1 = 0.5 are input to the input unit 1. Entered.

動作例2における各データが入力されると、上記図12に示す構造化文書情報抽出処理ルーチンが実行され、図33に示す結果が出力される。   When each data in the operation example 2 is input, the structured document information extraction processing routine shown in FIG. 12 is executed, and the result shown in FIG. 33 is output.

上記図30及び上記図33を参照すると、ページ間の要素の対応が正しく抽出されていることがわかる。   Referring to FIG. 30 and FIG. 33, it can be seen that the correspondence of elements between pages is correctly extracted.

以上説明したように、本実施の形態に係る文書構造解析装置によれば、構造化文書の要素の階層構造を解析し、解析された構造化文書を表示したときの構造化文書の各要素の表示位置を解析し、構造化文書における複数の要素のうちの2つの要素間の各々について、要素の構造に関する構造類似度及び要素の表示位置に関する位置類似度を算出し、構造類似度と、位置類似度とに基づいて、構造化文書における複数の要素をクラスタリングすることにより、構造化文書の要素を精度良くクラスタリングできる。   As described above, according to the document structure analysis apparatus according to the present embodiment, the hierarchical structure of the elements of the structured document is analyzed, and each element of the structured document when the analyzed structured document is displayed is analyzed. Analyzing the display position and calculating the structural similarity regarding the structure of the element and the positional similarity regarding the display position of the element for each of the two elements of the plurality of elements in the structured document. By clustering a plurality of elements in the structured document based on the similarity, the elements of the structured document can be clustered with high accuracy.

また、本実施の形態に係る文書構造解析装置によれば、人間にとって意味がありそうな(すなわち,表やリスト等の様に隣接して配置される)繰り返し構造を抽出することができる。   Further, according to the document structure analysis apparatus according to the present embodiment, it is possible to extract a repetitive structure that is likely to be meaningful to humans (that is, arranged adjacently like a table or a list).

また、本実施の形態によれば、候補探索部がクラスタの候補を親子関係にないものに制限できるため、階層的な繰り返し構造がある場合でも効率的に抽出できる。   Also, according to the present embodiment, the candidate search unit can limit the cluster candidates to those that do not have a parent-child relationship, so that even if there is a hierarchical repetitive structure, it can be extracted efficiently.

また、繰り返し構造に優先度が付けられるので、多数のクラスタが生成された場合でも効率的に提示できる。   In addition, since the priority is given to the repetitive structure, it can be efficiently presented even when a large number of clusters are generated.

また、構造類似度計算にノード名のヒストグラムを使うことで、子ノードの数に依らず、常に一定の計算量(タグ名の数) で高速に構造の比較を行うことができる。   In addition, by using a histogram of node names in the structure similarity calculation, it is possible to compare structures at a high speed with a constant calculation amount (number of tag names) regardless of the number of child nodes.

また、HTML文書と抽出したい部分の組からなる学習データをゼロから作成する際には、想定されるデータとしてキーワードを変更して、クラスタリング結果の提示順序を変えることもできる。   In addition, when learning data consisting of a combination of an HTML document and a portion to be extracted is created from scratch, a keyword can be changed as assumed data to change the order of presentation of clustering results.

また、サイトの更新による再学習においては、既に抽出されたデータをキーワードに設定することで、クラスタリング結果から効率よく学習データとなる要素を取得することができる。   Further, in the relearning by updating the site, elements already serving as learning data can be efficiently acquired from the clustering result by setting the already extracted data as keywords.

なお、本発明は、上述した実施形態に限定されるものではなく、この発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。   Note that the present invention is not limited to the above-described embodiment, and various modifications and applications are possible without departing from the gist of the present invention.

本実施の形態では、構造類似度計算部14は、階層構造解析部10で算出されるノードのヒストグラムに基づいて、2つのノードのペア各々について2つの要素間の階層構造に関する類似度を計算したが、他の構成としても良い。   In the present embodiment, the structural similarity calculation unit 14 calculates the similarity related to the hierarchical structure between two elements for each pair of two nodes based on the node histogram calculated by the hierarchical structure analysis unit 10. However, other configurations may be used.

例えば、構造類似度計算部14について、ノードAとノードBが与えられた場合に、それらのノードをルートとする部分木のHTML開始タグ、終了タグを一つの文字とし、2つの文字列間のnormalized edit distance(ND)を計算し、構造類似度として1−NDを返す構成としても良い。normalized edit distanceについては例えば、B. Liu, "Web Data Mining," pp.384-386, Springer, 2007に記述がある.   For example, when the node A and the node B are given to the structural similarity calculation unit 14, the HTML start tag and end tag of the subtree having these nodes as roots are set as one character, and two character strings are It is good also as a structure which calculates normalized edit distance (ND) and returns 1-ND as structural similarity. For example, normalized edit distance is described in B. Liu, "Web Data Mining," pp.384-386, Springer, 2007.

また、本実施の形態では、優先度計算部22は、キーワードリストKW^に基づいて、1つのクラスタに含まれるノードについて、各ノードの優先度を各ノードが含むキーワードの重みの和とし、その最大値を優先度として算出したが、他の構成としても良い。   Further, in the present embodiment, the priority calculation unit 22 sets the priority of each node as the sum of the weights of the keywords included in each node for the nodes included in one cluster based on the keyword list KW ^. Although the maximum value is calculated as the priority, other configurations may be used.

例えば、優先度計算部22は、キーワードのリスト、およびクラスタが指定され、クラスタの構成要素(ノード)について、いずれか一つのノードにすべてのキーワードが含まれていれば1、そうでなければ0を返すようにすることができる。このアルゴリズム例を図34に示す。   For example, the priority calculation unit 22 specifies 1 if a keyword list and a cluster are specified, and all keywords are included in any one of the constituent elements (nodes) of the cluster, and 0 otherwise. Can be returned. An example of this algorithm is shown in FIG.

また、優先度計算部22は、クラスタが指定され、クラスタの構成要素(ノード)の数を優先度として返すようにすることができる。このアルゴリズム例を図35に示す。   Further, the priority calculation unit 22 can specify a cluster and return the number of components (nodes) of the cluster as a priority. An example of this algorithm is shown in FIG.

また、優先度計算部22は、クラスタが指定され、クラスタに含まれる各ノードについて、webページのリーフノードの数をN、クラスタに含まれるノードをルートとする部分木が含むリーフノードの数をn、各ノードの優先度を   Further, the priority calculation unit 22 designates a cluster, and for each node included in the cluster, the number of leaf nodes on the web page is N, and the number of leaf nodes included in the subtree having the node included in the cluster as a root is included. n, the priority of each node

として、その平均値をクラスタの優先度として返すようにすることができる。このアルゴリズム例を図36に示す。 The average value can be returned as the cluster priority. An example of this algorithm is shown in FIG.

また、上述の文書構造解析装置は、内部にコンピュータシステムを有しているが、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。   In addition, the document structure analysis apparatus described above has a computer system inside, but the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used. .

また、本願明細書中において、プログラムが予めインストールされている実施形態として説明したが、当該プログラムを、コンピュータ読み取り可能な記録媒体に格納して提供することも可能である。   In the present specification, the embodiment has been described in which the program is installed in advance. However, the program can be provided by being stored in a computer-readable recording medium.

10 階層構造解析部
12 位置情報解析部
14 構造類似度計算部
16 位置類似度計算部
16 構造類似度計算部
18 候補探索部
20 クラスタリング部
22 優先度計算部
DESCRIPTION OF SYMBOLS 10 Hierarchical structure analysis part 12 Position information analysis part 14 Structure similarity calculation part 16 Position similarity calculation part 16 Structure similarity calculation part 18 Candidate search part 20 Clustering part 22 Priority calculation part

Claims (8)

解析対象となる少なくとも1つの構造化文書の各々について、前記構造化文書の要素の階層構造を解析する階層構造解析手段と、
前記階層構造解析手段によって解析された構造化文書を表示したときの前記構造化文書の各要素の表示位置を解析する位置情報解析手段と、
前記階層構造解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの第1要素と第2要素との間の各々について、前記第1要素及び前記第1要素の子孫の要素と、前記第2要素及び前記第2要素の子孫の要素とを比較して、要素の構造に関する構造類似度を算出する構造類似度計算手段と、
前記位置情報解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの2つの要素間の各々について、要素の表示位置に関する位置類似度を算出する位置類似度計算手段と、
前記構造類似度計算手段によって算出された構造類似度と、前記位置類似度計算手段によって算出された位置類似度とに基づいて、前記少なくとも1つの構造化文書における複数の要素をクラスタリングするクラスタリング手段と
を含む文書構造解析装置。
Hierarchical structure analyzing means for analyzing a hierarchical structure of elements of the structured document for each of at least one structured document to be analyzed;
Position information analyzing means for analyzing the display position of each element of the structured document when the structured document analyzed by the hierarchical structure analyzing means is displayed;
Based on the analysis result analyzed by the hierarchical structure analyzing means, the first element and the second element for each of the first element and the second element among the plurality of elements in the at least one structured document. A structural similarity calculation means for comparing the second element and the descendant element of the second element with each other and calculating a structural similarity related to the structure of the element;
Based on the analysis result analyzed by the position information analysis means, the position similarity for calculating the position similarity regarding the display position of the element for each of two elements among the plurality of elements in the at least one structured document Degree calculation means,
Clustering means for clustering a plurality of elements in the at least one structured document based on the structure similarity calculated by the structure similarity calculation means and the position similarity calculated by the position similarity calculation means; Document structure analysis device including
前記構造類似度計算手段は、前記階層構造解析手段によって解析された解析結果に基づいて、前記少なくとも1つの構造化文書における各要素について、該要素及び該要素の子孫の要素の属性名のヒストグラムを算出し、前記第1要素と第2要素との間の各々について、前記第1要素のヒストグラムと前記第2要素のヒストグラムとの類似度を前記構造類似度として算出する請求項1記載の文書構造解析装置。   The structural similarity calculation means, based on the analysis result analyzed by the hierarchical structure analysis means, for each element in the at least one structured document, a histogram of attribute names of the element and descendant elements of the element 2. The document structure according to claim 1, wherein the document structure is calculated and a similarity between the histogram of the first element and the histogram of the second element is calculated as the structure similarity for each of the first element and the second element. Analysis device. 前記位置類似度計算手段は、前記位置情報解析手段によって解析された解析結果に基づいて、前記2つの要素間の各々について、前記構造化文書を表示したときの前記2つの要素の表示位置及び大きさに基づく類似度を、前記位置類似度として算出する請求項1又は2記載の文書構造解析装置。   The position similarity calculation unit is configured to display a display position and a size of the two elements when the structured document is displayed for each of the two elements based on the analysis result analyzed by the position information analysis unit. The document structure analysis apparatus according to claim 1, wherein a similarity based on the height is calculated as the position similarity. 前記クラスタリング手段によってクラスタリングされたクラスタの各々について、前記クラスタに属する各要素に含まれる単語と予め定められたキーワードとに基づいて、前記クラスタの優先度を算出する優先度計算手段を更に含む請求項1〜請求項3の何れか1項記載の文書構造解析装置。   The system further includes priority calculation means for calculating a priority of the cluster based on a word included in each element belonging to the cluster and a predetermined keyword for each cluster clustered by the clustering means. The document structure analysis apparatus according to any one of claims 1 to 3. 前記構造類似度計算手段によって算出された構造類似度に基づいて、前記少なくとも1つの構造化文書における複数の要素のうちの同一のクラスタにクラスタリングされる2つの要素を含む複数のクラスタ候補を探索する候補探索手段を更に含み、
前記クラスタリング手段は、前記候補探索手段によって探索された各クラスタ候補に含まれる要素間の前記構造類似度及び前記位置類似度に基づいて、前記少なくとも1つの構造化文書における複数の要素をクラスタリングする請求項1〜請求項4の何れか1項記載の文書構造解析装置。
Based on the structural similarity calculated by the structural similarity calculation means, a plurality of cluster candidates including two elements clustered in the same cluster among the plurality of elements in the at least one structured document are searched. Further including candidate searching means,
The clustering unit clusters a plurality of elements in the at least one structured document based on the structural similarity and the position similarity between elements included in each cluster candidate searched by the candidate searching unit. The document structure analysis apparatus according to any one of claims 1 to 4.
前記候補探索手段は、前記少なくとも1つの構造化文書における複数の要素の各々について、該要素とクラスタ候補に含まれる要素を、親子関係にある要素のうち前記構造類似度が最大となる要素とする請求項5記載の文書構造解析装置。   The candidate search means sets, for each of a plurality of elements in the at least one structured document, an element included in the cluster candidate as an element having the maximum structural similarity among elements having a parent-child relationship. The document structure analyzing apparatus according to claim 5. 前記候補探索手段は、前記構造化文書を表示したときの表示位置の距離が所定値以下であって、かつ同一のクラスタにクラスタリングされる2つの要素を含む前記複数のクラスタ候補を探索する請求項5又は6記載の文書構造解析装置。   The candidate search means searches for the plurality of cluster candidates including two elements whose display position distance when the structured document is displayed is not more than a predetermined value and clustered into the same cluster. 5. The document structure analysis apparatus according to 5 or 6. コンピュータを、請求項1〜請求項7の何れか1項記載の文書構造解析装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the document structure analysis apparatus of any one of Claims 1-7.
JP2012194305A 2012-09-04 2012-09-04 Document structure analysis apparatus and program Expired - Fee Related JP5701830B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012194305A JP5701830B2 (en) 2012-09-04 2012-09-04 Document structure analysis apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012194305A JP5701830B2 (en) 2012-09-04 2012-09-04 Document structure analysis apparatus and program

Publications (2)

Publication Number Publication Date
JP2014049088A JP2014049088A (en) 2014-03-17
JP5701830B2 true JP5701830B2 (en) 2015-04-15

Family

ID=50608642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012194305A Expired - Fee Related JP5701830B2 (en) 2012-09-04 2012-09-04 Document structure analysis apparatus and program

Country Status (1)

Country Link
JP (1) JP5701830B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6285341B2 (en) * 2014-11-19 2018-02-28 日本電信電話株式会社 Snippet generation device, snippet generation method, and snippet generation program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3842577B2 (en) * 2001-03-30 2006-11-08 株式会社東芝 Structured document search method, structured document search apparatus and program
JP4046000B2 (en) * 2003-04-16 2008-02-13 日本電信電話株式会社 Structured document extraction method, apparatus and program
US7403951B2 (en) * 2005-10-07 2008-07-22 Nokia Corporation System and method for measuring SVG document similarity
JP2008084192A (en) * 2006-09-28 2008-04-10 Toshiba Corp Structured document retrieval device, structured document retrieval method and structured document retrieval program

Also Published As

Publication number Publication date
JP2014049088A (en) 2014-03-17

Similar Documents

Publication Publication Date Title
US8667015B2 (en) Data extraction method, computer program product and system
US8555157B1 (en) Document update generation
WO2019041521A1 (en) Apparatus and method for extracting user keyword, and computer-readable storage medium
EP1736901A2 (en) Method for classifying sub-trees in semi-structured documents
JP2010501096A (en) Cooperative optimization of wrapper generation and template detection
CN107220307B (en) Webpage searching method and device
US8914378B2 (en) Specification document check method, program, and system
Uzun et al. An effective and efficient Web content extractor for optimizing the crawling process
US7496571B2 (en) Method for performing information-preserving DTD schema embeddings
JP4873739B2 (en) Text multiple topic extraction apparatus, text multiple topic extraction method, program, and recording medium
JP4873738B2 (en) Text segmentation device, text segmentation method, program, and recording medium
Bu et al. An FAR-SW based approach for webpage information extraction
CN110390037B (en) Information classification method, device and equipment based on DOM tree and storage medium
JP5701830B2 (en) Document structure analysis apparatus and program
JP5317638B2 (en) Web document main content extraction apparatus and program
JP5533272B2 (en) Data output device, data output method, and data output program
Annam et al. Entropy based informative content density approach for efficient web content extraction
US10606875B2 (en) Search support apparatus and method
JP2010272006A (en) Relation extraction apparatus, relation extraction method and program
CN109388665B (en) Method and system for on-line mining of author relationship
JP4959032B1 (en) Web page analysis apparatus and web page analysis program
CN108897736B (en) Document sorting method and device based on Paper Rank algorithm
JP5903372B2 (en) Keyword relevance score calculation device, keyword relevance score calculation method, and program
CN116401375B (en) Knowledge graph construction method and system
CN115982390B (en) Industrial chain construction and iterative expansion development method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140624

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141209

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: 20150120

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150218

R150 Certificate of patent or registration of utility model

Ref document number: 5701830

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees