JP4046000B2 - Structured document extraction method, apparatus and program - Google Patents

Structured document extraction method, apparatus and program Download PDF

Info

Publication number
JP4046000B2
JP4046000B2 JP2003111701A JP2003111701A JP4046000B2 JP 4046000 B2 JP4046000 B2 JP 4046000B2 JP 2003111701 A JP2003111701 A JP 2003111701A JP 2003111701 A JP2003111701 A JP 2003111701A JP 4046000 B2 JP4046000 B2 JP 4046000B2
Authority
JP
Japan
Prior art keywords
structured document
node
display area
document
nodes
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 - Lifetime
Application number
JP2003111701A
Other languages
Japanese (ja)
Other versions
JP2004318505A (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 JP2003111701A priority Critical patent/JP4046000B2/en
Publication of JP2004318505A publication Critical patent/JP2004318505A/en
Application granted granted Critical
Publication of JP4046000B2 publication Critical patent/JP4046000B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、構造化文書の抽出方法及び装置及びプログラムに係り、特に、HTML等の構造化文書から、所望の部分を指定・抽出し、別の構造化文書上で再利用する、あるいは、含まれるテキスト等が変更された後の、当該文書から対応部分を抽出するための構造化文書の抽出方法及び装置及びプログラムに関する。
【0002】
【従来の技術】
日々更新されるHTML等の構造化文書から、ある特定の指定部分を抽出したいというニーズがある。例えば、ユーザが日常訪れるウェブサイトから注目している部分だけを集めて抽出することができれば、ページスクロール等を行うことなく、必要な情報だけを容易に一覧することができる。抽出にあたっては、この指定部分に含まれるテキスト等の変更があったとしても、変更された文書から当初の指定部分を特定した上で最新の情報を抽出することが求められる。
【0003】
これを実現する従来技術として二つを取り上げ、以下に説明する。
【0004】
一つは、WWW情報抽出システムである。HTML等の構造化文書の指定部分の手掛かりとするために、その開始箇所と終了箇所にあるテキストを保存しておく。文書からの指定部分の抽出は、保存されているテキストから開始箇所と終了箇所をHTML中に特定して両者に囲まれた部分を抽出するものである(例えば、特許文献1参照)。
【0005】
もう一つは、WebMethods社が提案する方法や、Iocchiが提案する方法のベースとなっている方法である(例えば、非特許文献1、非特許文献2参照)。
【0006】
HTML等の構造化文書の部分を指定するために、まず文書を図8に示すような構文木に変換し、指定部分を構文木内の位置として保存しておく。文書からの指定部分の抽出は、まず、文書を構文木に変換し、保存されている位置を構文木内に特定してこれに対応する部分を抽出するものである。
【0007】
【特許文献1】
特許第2867986号
【0008】
【非特許文献1】
http://www.w3.org/TR/NOTE-widl.html
【0009】
【非特許文献2】
Luca Iocchi, “The Web-OEM approach to Web information extraction,”Journal of Network and Computer Applications, Vol.22, pp259-269, 1999
【0010】
【発明が解決しようとする課題】
しかしながら、WWW情報抽出システムでは、開始、終了箇所にあるテキストを手掛かりとして、HTML等の構造化文書の部分を指定しているため、このテキスト自身に変更があり得る文書については、図9に示すように、適用できないという問題がある。
【0011】
また、この方法では、図10に示すように、指定される部分を構文木としてみたとき、一般には部分木を構成しないため、この部分を別の構造化文書中で再利用することは困難である。
【0012】
また、WebMethods社や、Iocchiが提案する構造化文書の構文木中の位置に基づく方法では、画面表示には影響がない程度であっても、この構文木自身にある種の変更(兄弟ノードの追加や削除等)がある場合には所期の指定部分を抽出することができないという問題がある。
【0013】
本発明は、上記の点に鑑みなされたもので、指定部分の開始、終了箇所に依存せず、上記のような構文木の変更がある場合でも確実に指定部分を抽出することが可能な構造化文書の抽出方法及び装置及びプログラムを提供することを目的とする。
【0014】
【課題を解決するための手段】
図1は、本発明の原理を説明するための図である。
【0015】
本発明(請求項1)は、HTML文書を含む、構文木が変更された構造化文書の部分を抽出する構造化文書の抽出方法において、
構造化文書が格納されている構造化文書記憶手段から構造化文書を読み込んで、表示手段に該構造化文書を表示し(ステップ1)、
表示された構造化文書からユーザによって指定された部分に対応するノードの表示領域の座標と、該ノードより上位の一連のノードの表示領域の座標情報を要素とする配列によって該部分を指定し(ステップ2)、指定された座標情報を位置情報記憶手段に蓄積(ステップ3)
更新された構造化文書を構造化文書記憶手段から読み込み、表示手段に表示し(ステップ4)、
位置情報記憶手段に蓄積されている一連のノードの表示領域の座標情報を読み込み(ステップ5)、
構造化文書の構文木において、ルートとなるノード及び該ノードより下位の一連のノードからなる複数のパスについて、各パスを構成する各ノードの表示領域の座標と、読み込まれた一連のノードの表示領域の座標の距離が最小のノードを選択する(ステップ6)処理を位置情報記憶手段に蓄積されている座標情報の数だけ繰り返し(ステップ7)、最終的に選択されたノードを抽出し(ステップ8)、出力する(ステップ9)。
【0018】
また、本発明(請求項2)は、構造化文書の構文木において、該構文木の隣接するノードにおいて、子ノードの表示領域を親ノードの表示領域の幅と高さで正規化した相対座標を該表示領域の座標情報とする。
【0019】
図2は、本発明の原理構成図である。
【0020】
本発明(請求項3)は、HTML文書を含む、構文木が変更された構造化文書の部分を抽出する構造化文書の抽出装置であって、
構造化文書が格納されている構造化文書記憶手段から構造化文書を読み込む文書読込手段110と、
読み込まれた構造化文書を表示する文書表示手段120と、
文書表示手段120に表示された構造化文書からユーザによって指定された部分に対応するノードの表示領域の座標と、該ノードより上位の一連のノードの表示領域の座標情報を要素とする配列によって該部分を指定する部分指定手段130と、
指定された座標情報を位置情報記憶手段300に保存する位置情報保存手段140と、
更新された構造化文書を構造化文書記憶手段から読み込む更新文書読込手段210と、
読み込まれた構造化文書を表示手段に表示する更新文書表示手段220と、
位置情報記憶手段300に蓄積されている一連のノードの表示領域の座標情報を読み込む位置情報読込手段240と、
表示された構造化文書の構文木において、ルートとなるノード及び該ノードより下位の一連のノードからなる複数のパスについて、各パスを構成する各ノードの表示領域の座標と、位置情報読込手段240で読み込まれた一連のノードの表示領域の座標の距離が最小のノードを選択する処理を位置情報記憶手段300に蓄積されている座標情報の数だけ繰り返し、最終的に選択されたノードを抽出する部分抽出手段230と、
部分抽出手段230で抽出されたノードを出力する部分情報出力手段250と、を有する。
【0023】
本発明(請求項4)は、部分抽出手段230において、
構造化文書の構文木において、該構文木の隣接するノードにおいて、子ノードの表示領域を親ノードの表示領域の幅と高さで正規化した相対座標を該表示領域の座標情報とする手段を含む。
【0024】
本発明(請求項5)は、請求項3乃至4のいずれか1項に記載の構造化文書の抽出装置を構成する各手段としてコンピュータを機能させる構造化文書の抽出プログラムである。
【0028】
上記のように、本発明は、HTML等の構造化文書の部分を指定し、抽出スルシステムにおいて、当該文書の構文木において、ユーザが指示する部分に対応するノードの表示領域の座標情報と、これより上位の一連のノードの表示領域の座標情報とを要素とする配列によって当該部分を指定し、また更新された構造化文書の構文木において、ルートとなるノード及びこれより下位の一連のノードからなる複数のパスについて、各パスを構成する各ノードの表示領域の座標情報と、前述の指定された一連のノードの表示領域の座標情報とを比較した時に最も一致するパスの最下位のノードを抽出するものであり、これにより、実際の表示領域の座標を手掛かりにして抽出部分を特定することを特徴としている。
【0029】
【発明の実施の形態】
以下、図面と共に本発明の実施の形態を説明する。
【0030】
図3は、本発明の一実施の形態における構造化文書の部分指定・抽出装置の構成を示す。同図に示す装置は、指定部100と抽出部200及び、位置情報蓄積部300から構成される。なお、本実施の形態では、部分指定・抽出装置として説明するが、部分指定装置及び抽出装置の2つの装置から構成されてもよい。
指定部100は、文書読込部110、文書表示部120、部分指定部130、及び位置情報保存部140から構成される。
【0031】
以下に、上記の構成における動作を説明する。
【0032】
図4は、本発明の一実施の形態における構造化文書の部分指定の動作のフローチャートであり、図5は、本発明の一実施の形態における部分指定の例を示す。
【0033】
ステップ101) 文書読込部110は、データーベース等の記憶手段に格納されている構造化文書を読み込み、文書表示部120に表示する。
【0034】
ステップ102) ユーザは、文書表示部120に表示されたブラウザ上で構造化文書から選択したい部分を指定する。
【0035】
ステップ103) 部分指定部130において、ユーザから指定された部分に対応するノードの表示領域を検出する。検出する方法としては、例えば、Java(登録商標)Script(『Java(登録商標) Script The Definitive Guide, Fourth Edition』David Flanagan O’reilly & Associates, Inc. USA, Dec. 15,2001)を用いるものとする。
【0036】
ステップ104) 次に、部分指定部130は、検出されたノードの表示位置を計算する。
【0037】
ステップ105) さらに、部分指定部130は、構文木に従って、検出されたノードの親ノードの表示領域(座標情報)を検出する。
【0038】
ステップ104,105の処理を最上位ノードまで繰り返す。なお、「Java(登録商標)Script」には、構文木に従ってノードを検索するための方法が用意されている。
【0039】
ステップ106) 次に、位置情報保存部140は、計算された全てのノードの表示位置を位置情報蓄積部300に蓄積する。
【0040】
なお、保存すべきノードの表示領域の座標を、ノードに対応するタグ名等によって予め指定しておくことにより、位置情報蓄積部300に保存される情報量と全体の計算量を削減することができる。
【0041】
また、位置情報蓄積部300に保存する座標情報は、親ノードの表示領域の座標で正規化された相対座標としてもよいし、例えば、構文木中、親ノードの表示領域をその左上、右下の座標を用いて(left0, top0, right0, bottom0)、子ノードの表示領域を同様に(left1, top1, right1, bottom1)とするとき、相対座標は
(left1/(right0-left0), top1/(bottom0-top0), right1/(right0-left0), bottom1/
(bottom0-top0))
などとすることができる。
【0042】
次に、構造化文書の部分指定・抽出装置の抽出部200について説明する。
【0043】
抽出部200は、文書読込部210、文書表示部220、部分抽出部230、位置情報読込部240、及び、部分情報出力部250から構成される。
【0044】
以下に、上記の構成における動作を説明する。
【0045】
図6は、本発明の一実施の形態における指定部分の抽出動作のフローチャートであり、図7は、本発明の一実施の形態における抽出の例を示す。
【0046】
ステップ201) 更新された処理対象とする構造化文書がデーターベース等の記憶手段から、文書読込部210によって読み込まれ、文書表示部220のブラウザ画面上に表示される。
【0047】
ステップ202) 部分抽出部230において、表示されている最上位ノードの表示領域を検出する。具体的には、図7に示す「htmlノード」が選択される。
【0048】
ステップ203) 部分抽出部230は、構文木に従って、当該ノードの子ノードの表示領域を検出する。
【0049】
ステップ204) 位置情報読込部240が、位置情報蓄積部300から位置情報を読み込み、部分抽出部230に渡す。これにより、部分抽出部230は、保存されていた位置情報の表示位置に最もよく一致する子ノードを選択する。
【0050】
なお、上記の子ノードや、直近にある指定されたタグ名を持つノードは、通常複数存在するが、これらの複数のノードから以下の手順によって位置情報蓄積部300に保存されている座標情報に最もよく一致するノードを選択する。
【0051】
ここで、保存されている座標情報を(left2, top2, right2, bottom2)、複数ノードのうち、i番目のものの表示領域の座標情報を、(left(i), top(i), right(i), bottom(i))とする。選択すべきノードを、この両者の距離
|left2-left(i)|+|top2-top(i)|+|right2-right(i)|+|bottom2-bottom(i)|を最小にするiに対応するノードとする。ここで用いる座標情報は、上記で定義される相対座標を用いることができる。さらに、領域に対応する矩形の重心の座標、及び、幅、高さの差
|(left2+right2)/2−(left(i)+right(i))/2|
+|(top2+bottom2)/2−(top(i)+bottom(i))/2|
+|(right2-left2)−(right(i)-left(i))|
+|(bottom2-top2)−(bottom(i)−top(i))|
として、両者の距離を比較すれば、文書の更新によって位置のズレが生じたとしても確実に所期の指定部分を抽出できる。
【0052】
ステップ205) 上記のようにして選択されたノードの子ノード(もしくは、直近にある指定されたタグ名を持つノード)について同じ操作を行う。以上の操作を位置情報蓄積部300に保存されている座標情報の数だけ繰り返す。最終的に選択されたノードを抽出し、部分情報出力部250より出力する。
【0053】
また、上記の構造化文書の部分指定部100、抽出部200の構成による処理をプログラムとして構築し、部分指定装置、抽出装置として利用されるコンピュータにインストールし、CPU等の制御手段により実行させることも可能である。また、構築されたプログラムをネットワークを介して流通させることも可能である。
【0054】
また、構築されたプログラムを部分指定装置、抽出装置として利用されるコンピュータに接続されるハードディスク装置や、フレキシブルディスク、CD−ROM等の可搬記憶媒体に格納しておき、実行時にコンピュータにインストールして実行させることも可能である。
【0055】
なお、本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。
【0056】
【発明の効果】
上述のように、本発明によれば、構造化文書について、実際の表示領域の座標情報を手掛かりにして抽出部分が特定されるため、指定部分の開始、終了箇所に依存せず、構文木の変更がある場合でも確実に指定部分を抽出できる。
【0057】
【図面の簡単な説明】
【図1】本発明の原理を説明するための図である。
【図2】本発明の原理構成図である。
【図3】 本発明の一実施の形態における構造化文書の部分指定・抽出装置の構成図である。
【図4】本発明の一実施の形態における部分指定の動作のフローチャートである。
【図5】本発明の一実施の形態におけるにおける部分指定の例である。
【図6】本発明の一実施の形態における指定部分の抽出動作のフローチャートである。
【図7】本発明の一実施の形態における抽出の例である。
【図8】HTMLのソースと対応する構文木の例である。
【図9】開始・終了箇所のテキストを手掛かりに部分指定、抽出した例である。
【図10】開始、終了を指示するテキストを手掛かりにしてHTMLの対応部分を抽出した例である。
【符号の説明】
100 定部
110 文書読込手段、文書読込部
120 文書表示手段、文書表示部
130 部分指定手段、部分指定部
140 位置情報保持手段、位置情報保持部
200 抽出装置、抽出部
210 更新文書読込手段、文書読込部
220 更新文書表示手段、文書表示部
230 部分抽出手段、部分抽出部
240 位置情報読込手段、位置情報読込部
250 部分情報出力手段、部分情報出力部
300 位置情報蓄積手段、位置情報蓄積部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to extracting method and apparatus and program of the structured document, in particular, from the structured document such as HTML, to specify and extracting a desired portion, reused in another structured on the document, or, after the text or the like is changed to include a method and apparatus and a program extraction of the structured document to extract the corresponding portion from the document.
[0002]
[Prior art]
There is a need to extract a specific designated portion from a structured document such as HTML that is updated daily. For example, if it is possible to collect and extract only the part of interest from a website that the user visits every day, it is possible to easily list only necessary information without scrolling the page. In the extraction, even if the text included in the designated portion is changed, it is required to extract the latest information after specifying the original designated portion from the changed document.
[0003]
Two conventional technologies for realizing this will be described below.
[0004]
One is a WWW information extraction system. In order to provide a clue to the designated part of a structured document such as HTML, the text at the start and end points is stored. Extraction of a designated portion from a document is performed by specifying a start portion and an end portion in HTML from a stored text and extracting a portion surrounded by both (see, for example, Patent Document 1).
[0005]
The other is a method that is the basis of the method proposed by WebMethods and the method proposed by Iocchi (for example, see Non-Patent Document 1 and Non-Patent Document 2).
[0006]
In order to designate a part of a structured document such as HTML, the document is first converted into a syntax tree as shown in FIG. 8, and the designated part is stored as a position in the syntax tree. Extraction of a designated portion from a document is performed by first converting the document into a syntax tree, specifying a saved position in the syntax tree, and extracting a corresponding portion.
[0007]
[Patent Document 1]
Japanese Patent No. 2867986
[Non-Patent Document 1]
http://www.w3.org/TR/NOTE-widl.html
[0009]
[Non-Patent Document 2]
Luca Iocchi, “The Web-OEM approach to Web information extraction,” Journal of Network and Computer Applications, Vol.22, pp259-269, 1999
[0010]
[Problems to be solved by the invention]
However, in the WWW information extraction system, a part of a structured document such as HTML is specified using the text at the start and end points as a clue, and the document that can change the text itself is shown in FIG. As such, there is a problem that it cannot be applied.
[0011]
In addition, in this method, as shown in FIG. 10, when a designated part is viewed as a syntax tree, it is generally difficult to reuse this part in another structured document because a partial tree is not constructed. is there.
[0012]
Also, in the method based on the position in the syntax tree of the structured document proposed by WebMethods or Iocchi, even if there is no effect on the screen display, there is some change in this syntax tree itself (the sibling node's When there is addition or deletion), there is a problem that an intended designated portion cannot be extracted.
[0013]
The present invention has been made in view of the above points, and does not depend on the start and end points of the specified part, and can reliably extract the specified part even when there is a change in the syntax tree as described above. and to provide an extraction method and apparatus and program of the document.
[0014]
[Means for Solving the Problems]
FIG. 1 is a diagram for explaining the principle of the present invention.
[0015]
The present invention (claim 1) includes an HTML document, the method of extracting the structured document syntax tree to extract part of the modified structured document,
The structured document is read from the structured document storage unit storing the structured document, and the structured document is displayed on the display unit (step 1).
Specifying the part by the sequence the coordinates of the display area of the node corresponding to the portion designated by the user from the displayed structured document, and coordinate information elements of the display area of the set of nodes higher than the node (step 2), the designated the coordinate information stored in the position information storage means (step 3),
The updated structured document is read from the structured document storage means and displayed on the display means (step 4).
Read coordinate information of a display area of a series of nodes accumulated in the position information storage means (step 5),
In the syntax tree of a structured document, for a plurality of paths consisting of a root node and a series of nodes lower than the root node, the coordinates of the display area of each node constituting each path and the display of the read series of nodes The node having the smallest coordinate distance in the region is selected (step 6). The process is repeated by the number of coordinate information stored in the position information storage means (step 7), and finally the selected node is extracted (step 8) Output (step 9).
[0018]
Further, according to the present invention (Claim 2) , in the syntax tree of the structured document, relative coordinates obtained by normalizing the display area of the child node with the width and height of the display area of the parent node in adjacent nodes of the syntax tree. Is the coordinate information of the display area.
[0019]
FIG. 2 is a principle configuration diagram of the present invention.
[0020]
The present invention (claim 3) includes an HTML document, an extraction device structured document syntax tree to extract part of the modified structured document,
A document reading unit 110 that reads a structured document from a structured document storage unit in which the structured document is stored;
Document display means 120 for displaying the read structured document;
By an array having the coordinates of the display area of the node corresponding to the part designated by the user from the structured document displayed on the document display means 120 and the coordinate information of the display area of a series of nodes higher than the node as elements. a part specifying unit 130 for specifying the portion Te,
Position information storage means 140 for storing designated coordinate information in the position information storage means 300;
An updated document reading unit 210 for reading the updated structured document from the structured document storage unit;
An updated document display means 220 for displaying the read structured document on the display means;
A position information reading means 240 for reading coordinate information of a display area of a series of nodes accumulated in the position information storage means 300;
In the syntax tree of the displayed structured document, for a plurality of paths consisting of a root node and a series of nodes lower than the node, the coordinates of the display area of each node constituting each path and the position information reading means 240 The process of selecting the node having the smallest coordinate distance in the display area of the series of nodes read in step S is repeated by the number of coordinate information stored in the position information storage means 300 to finally extract the selected node. Partial extraction means 230;
And a partial information output unit 250 that outputs the node extracted by the partial extraction unit 230 .
[0023]
According to the present invention (Claim 4) , in the partial extraction means 230 ,
In the syntax tree of the structured document, in adjacent nodes of the syntax tree, means for using the relative coordinates obtained by normalizing the display area of the child node by the width and height of the display area of the parent node as the coordinate information of the display area Including.
[0024]
The present invention (Claim 5) is a structured document extraction program that causes a computer to function as each means constituting the structured document extraction apparatus according to any one of Claims 3 to 4.
[0028]
As described above, the present invention specifies a part of a structured document such as HTML, and in the extraction system, in the syntax tree of the document, the coordinate information of the display area of the node corresponding to the part indicated by the user, The part is specified by an array having the coordinate information of the display area of a series of higher-order nodes as an element, and the root node and lower-order series of nodes in the syntax tree of the updated structured document For the plurality of paths consisting of, the lowest node of the path that most closely matches the coordinate information of the display area of each node that constitutes each path and the coordinate information of the display area of the specified series of nodes described above Thus, the extracted portion is specified by using the coordinates of the actual display area as a clue.
[0029]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0030]
FIG. 3 shows a configuration of the structured document partial designation / extraction apparatus according to the embodiment of the present invention. The apparatus shown in FIG. 1 includes a designation unit 100, an extraction unit 200, and a position information storage unit 300. In this embodiment, the partial designation / extraction device is described. However, the partial designation / extraction device may be used.
The designation unit 100 includes a document reading unit 110, a document display unit 120, a partial designation unit 130, and a position information storage unit 140.
[0031]
The operation in the above configuration will be described below.
[0032]
FIG. 4 is a flowchart of the operation for designating a part of a structured document according to an embodiment of the present invention. FIG. 5 shows an example of the part designation according to an embodiment of the present invention.
[0033]
Step 101) The document reading unit 110 reads a structured document stored in storage means such as a database and displays it on the document display unit 120.
[0034]
Step 102) The user designates a part to be selected from the structured document on the browser displayed on the document display unit 120.
[0035]
Step 103) The part designating unit 130 detects the display area of the node corresponding to the part designated by the user. As a detection method, for example, Java (registered trademark) Script ("Java (registered trademark) Script The Definitive Guide, Fourth Edition" David Flanagan O'reilly & Associates, Inc. USA, Dec. 15,2001) is used. And
[0036]
Step 104) Next, the part designating unit 130 calculates the display position of the detected node.
[0037]
Step 105) Furthermore, the part designation | designated part 130 detects the display area (coordinate information) of the parent node of the detected node according to a syntax tree.
[0038]
Steps 104 and 105 are repeated up to the highest node. Note that “Java (registered trademark) Script” provides a method for searching for nodes according to a syntax tree.
[0039]
Step 106) Next, the position information storage unit 140 stores the calculated display positions of all the nodes in the position information storage unit 300.
[0040]
Note that the amount of information stored in the position information storage unit 300 and the overall calculation amount can be reduced by specifying the coordinates of the display area of the node to be stored in advance by the tag name corresponding to the node. it can.
[0041]
The coordinate information stored in the position information storage unit 300 may be relative coordinates normalized by the coordinates of the display area of the parent node. For example, in the syntax tree, the display area of the parent node is the upper left and lower right. Using the coordinates of (left0, top0, right0, bottom0), if the display area of the child node is similarly (left1, top1, right1, bottom1), the relative coordinates are
(left1 / (right0-left0), top1 / (bottom0-top0), right1 / (right0-left0), bottom1 /
(bottom0-top0))
And so on.
[0042]
Next, the extraction unit 200 of the structured document partial designation / extraction apparatus will be described.
[0043]
The extraction unit 200 includes a document reading unit 210, a document display unit 220, a partial extraction unit 230, a position information reading unit 240, and a partial information output unit 250.
[0044]
The operation in the above configuration will be described below.
[0045]
FIG. 6 is a flowchart of the extraction operation of the designated portion in one embodiment of the present invention, and FIG. 7 shows an example of extraction in one embodiment of the present invention.
[0046]
Step 201) The updated structured document to be processed is read from the storage means such as a database by the document reading unit 210 and displayed on the browser screen of the document display unit 220.
[0047]
Step 202) The partial extraction unit 230 detects the display area of the highest node displayed. Specifically, the “html node” shown in FIG. 7 is selected.
[0048]
Step 203) The partial extraction unit 230 detects the display area of the child node of the node according to the syntax tree.
[0049]
Step 204) The position information reading unit 240 reads the position information from the position information storage unit 300 and passes it to the partial extraction unit 230. Thereby, the partial extraction unit 230 selects a child node that best matches the display position of the stored position information.
[0050]
Note that there are usually a plurality of the above child nodes and the most recently assigned nodes with the specified tag name. However, the coordinate information stored in the position information storage unit 300 from these nodes by the following procedure is used. Select the best matching node.
[0051]
Here, the stored coordinate information is (left2, top2, right2, bottom2), and the coordinate information of the display area of the i-th node among the plurality of nodes is (left (i), top (i), right (i ), bottom (i)). The node to be selected is i that minimizes the distance | left2-left (i) | + | top2-top (i) | + | right2-right (i) | + | bottom2-bottom (i) | The node corresponding to. As the coordinate information used here, the relative coordinates defined above can be used. Furthermore, the coordinates of the center of gravity of the rectangle corresponding to the area, and the difference in width and height | (left2 + right2) / 2− (left (i) + right (i)) / 2 |
+ | (Top2 + bottom2) / 2− (top (i) + bottom (i)) / 2 |
+ | (right2-left2) − (right (i) -left (i)) |
+ | (Bottom2-top2)-(bottom (i)-top (i)) |
If the distance between the two is compared, it is possible to surely extract the designated part even if the position is shifted due to the update of the document.
[0052]
Step 205) The same operation is performed on the child node of the node selected as described above (or the node having the specified tag name that is closest). The above operation is repeated as many times as the number of coordinate information stored in the position information storage unit 300. The finally selected node is extracted and output from the partial information output unit 250.
[0053]
Further, the processing by the configuration of the above-described structured document partial designation unit 100 and extraction unit 200 is constructed as a program, installed in a computer used as the partial designation device and extraction device, and executed by a control means such as a CPU. Is also possible. It is also possible to distribute the constructed program via a network.
[0054]
The constructed program is stored in a hard disk device connected to a computer used as a partial designation device or extraction device, a portable storage medium such as a flexible disk or CD-ROM, and installed in the computer at the time of execution. It is also possible to execute.
[0055]
The present invention is not limited to the above-described embodiment, and various modifications and applications can be made within the scope of the claims.
[0056]
【The invention's effect】
As described above, according to the present invention, the extracted portion of the structured document is specified by using the coordinate information of the actual display area as a clue. Therefore, the syntax tree does not depend on the start and end portions of the designated portion. Even if there is a change, the specified part can be extracted reliably.
[0057]
[Brief description of the drawings]
FIG. 1 is a diagram for explaining the principle of the present invention.
FIG. 2 is a principle configuration diagram of the present invention.
FIG. 3 is a configuration diagram of a structured document partial designation / extraction apparatus according to an embodiment of the present invention;
FIG. 4 is a flowchart of a partial designation operation according to an embodiment of the present invention.
FIG. 5 is an example of partial designation in one embodiment of the present invention.
FIG. 6 is a flowchart of an operation for extracting a designated portion according to the embodiment of the present invention.
FIG. 7 is an example of extraction in one embodiment of the present invention.
FIG. 8 is an example of a syntax tree corresponding to an HTML source.
FIG. 9 is an example in which the text at the start / end points is partially specified and extracted using a clue.
FIG. 10 is an example in which a corresponding part of HTML is extracted using a text instructing start and end as a clue.
[Explanation of symbols]
100 Finger tough 110 document reading unit, document reading unit 120 document display means, the document display unit 130 portion specifying unit, portion designation unit 140 position information holding means, the position information holding section 200 extractor, the extraction unit 210 updates the document reading unit, Document reading unit 220 Update document display unit, document display unit 230 Partial extraction unit, partial extraction unit 240 Position information reading unit, position information reading unit 250 Partial information output unit, partial information output unit 300 Position information storage unit, position information storage unit

Claims (5)

HTML文書を含む、構文木が変更された構造化文書の部分を抽出する構造化文書の抽出方法において、
構造化文書が格納されている構造化文書記憶手段から構造化文書を読み込んで、表示手段に該構造化文書を表示し、
表示された前記構造化文書からユーザによって指定された部分に対応するノードの表示領域の座標と、該ノードより上位の一連のノードの表示領域の座標情報を要素とする配列によって該部分を指定し、指定された座標情報を位置情報記憶手段に蓄積し、
更新された構造化文書を前記構造化文書記憶手段から読み込み、前記表示手段に表示し、
前記位置情報記憶手段に蓄積されている一連のノードの表示領域の座標情報を読み込み、
前記構造化文書の構文木において、ルートとなるノード及び該ノードより下位の一連のノードからなる複数のパスについて、各パスを構成する各ノードの表示領域の座標と、読み込まれた前記一連のノードの表示領域の座標の距離が最小のノードを選択する処理を前記位置情報記憶手段に蓄積されている座標情報の数だけ繰り返し、最終的に選択されたノードを抽出し、出力することを特徴とする構造化文書の抽出方法。
Including HTML documents, in the extraction method of the structured document syntax tree to extract part of the modified structured document,
Reading the structured document from the structured document storage means storing the structured document, and displaying the structured document on the display means;
The coordinates of the display area of the node corresponding to the portion designated by the user from the displayed the structured document, the portion by the sequence of coordinate information of the display area of the set of nodes of the upper and elements from the node specified, accumulates the designated the coordinate information in the position information storage means,
Read the updated structured document from the structured document storage means, display it on the display means,
Read coordinate information of a display area of a series of nodes accumulated in the position information storage means,
In the syntax tree of the structured document, for a plurality of paths including a root node and a series of nodes lower than the node, the coordinates of the display area of each node constituting each path and the read series of nodes The process of selecting the node with the smallest coordinate distance in the display area is repeated by the number of coordinate information stored in the position information storage means, and finally selected nodes are extracted and output. To extract structured documents.
前記構造化文書の構文木において、該構文木の隣接するノードにおいて、子ノードの表示領域を親ノードの表示領域の幅と高さで正規化した相対座標を該表示領域の座標情報とする請求項記載の構造化文書の抽出方法。In the syntax tree of the structured document, relative coordinates obtained by normalizing the display area of the child node with the width and height of the display area of the parent node in the adjacent nodes of the syntax tree are used as the coordinate information of the display area. Item 3. A method for extracting a structured document according to Item 1 . HTML文書を含む、構文木が変更された構造化文書の部分を抽出する構造化文書の抽出装置であって、
構造化文書が格納されている構造化文書記憶手段から構造化文書を読み込む文書読込手段と、
読み込まれた構造化文書を表示する表示手段と、
表示された前記構造化文書からユーザによって指定された部分に対応するノードの表示領域の座標と、該ノードより上位の一連のノードの表示領域の座標情報を要素とする配列によって該部分を指定する部分指定手段と、
指定された座標情報を位置情報記憶手段に保存する位置情報保存手段と、
更新された構造化文書を前記構造化文書記憶手段から読み込む更新文書読込手段と、
読み込まれた前記構造化文書を表示手段に表示する更新文書表示手段と、
前記位置情報記憶手段に蓄積されている一連のノードの表示領域の座標情報を読み込む位置情報読込手段と、
表示された前記構造化文書の構文木において、ルートとなるノード及び該ノードより下位の一連のノードからなる複数のパスについて、各パスを構成する各ノードの表示領域の座標と、前記位置情報読込手段で読み込まれた前記一連のノードの表示領域の座標の距離が最小のノードを選択する処理を前記位置情報記憶手段に蓄積されている座標情報の数だけ繰り返し、最終的に選択されたノードを抽出する部分抽出手段と、
前記部分抽出手段で抽出されたノードを出力する部分情報出力手段と、
を有することを特徴とする構造化文書の抽出装置。
Including HTML documents, an extraction device structured document syntax tree to extract part of the modified structured document,
A document reading means for reading the structured document from the structured document storage means in which the structured document is stored;
Display means for displaying the read structured document;
The coordinates of the display area of the node corresponding to the portion designated by the user from the displayed the structured document, the portion by the sequence of coordinate information of the display area of the set of nodes of the upper and elements from the node A part designation means to designate;
Position information storage means for storing designated coordinate information in the position information storage means;
An updated document reading means for reading an updated structured document from the structured document storage means;
Updated document display means for displaying the read structured document on a display means;
Position information reading means for reading coordinate information of a display area of a series of nodes accumulated in the position information storage means;
In the syntax tree of the displayed structured document, for the plurality of paths including a root node and a series of nodes lower than the node, the coordinates of the display area of each node constituting each path and the position information reading The process of selecting the node with the smallest coordinate distance in the display area of the series of nodes read by the means is repeated as many times as the number of coordinate information stored in the position information storage means, and finally the selected node is Partial extracting means for extracting;
Partial information output means for outputting the node extracted by the partial extraction means;
An apparatus for extracting a structured document, comprising:
前記部分抽出手段は、
前記構造化文書の構文木において、該構文木の隣接するノードにおいて、子ノードの表示領域を親ノードの表示領域の幅と高さで正規化した相対座標を該表示領域の座標情報とする手段を含む請求項記載の構造化文書の抽出装置。
The partial extraction means includes
In the structured document syntax tree, in adjacent nodes of the syntax tree, relative coordinates obtained by normalizing the display area of the child node with the width and height of the display area of the parent node are used as coordinate information of the display area. The structured document extracting apparatus according to claim 3 , comprising:
請求項3乃至4のいずれか1項に記載の構造化文書の抽出装置を構成する各手段としてAs each means which comprises the extraction apparatus of the structured document of any one of Claim 3 thru | or 4 コンピュータを機能させる構造化文書の抽出プログラム。A structured document extraction program that allows a computer to function.
JP2003111701A 2003-04-16 2003-04-16 Structured document extraction method, apparatus and program Expired - Lifetime JP4046000B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003111701A JP4046000B2 (en) 2003-04-16 2003-04-16 Structured document extraction method, apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003111701A JP4046000B2 (en) 2003-04-16 2003-04-16 Structured document extraction method, apparatus and program

Publications (2)

Publication Number Publication Date
JP2004318505A JP2004318505A (en) 2004-11-11
JP4046000B2 true JP4046000B2 (en) 2008-02-13

Family

ID=33472180

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003111701A Expired - Lifetime JP4046000B2 (en) 2003-04-16 2003-04-16 Structured document extraction method, apparatus and program

Country Status (1)

Country Link
JP (1) JP4046000B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916255A (en) * 2010-07-02 2010-12-15 互动在线(北京)科技有限公司 HTML (Hypertext Markup Language) content contrast device and method

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7509588B2 (en) 2005-12-30 2009-03-24 Apple Inc. Portable electronic device with interface reconfiguration mode
US7956849B2 (en) 2006-09-06 2011-06-07 Apple Inc. Video manager for portable multifunction device
US8842074B2 (en) 2006-09-06 2014-09-23 Apple Inc. Portable electronic device performing similar operations for different gestures
US7864163B2 (en) 2006-09-06 2011-01-04 Apple Inc. Portable electronic device, method, and graphical user interface for displaying structured electronic documents
US10313505B2 (en) 2006-09-06 2019-06-04 Apple Inc. Portable multifunction device, method, and graphical user interface for configuring and displaying widgets
US8214768B2 (en) 2007-01-05 2012-07-03 Apple Inc. Method, system, and graphical user interface for viewing multiple application windows
US8519964B2 (en) 2007-01-07 2013-08-27 Apple Inc. Portable multifunction device, method, and graphical user interface supporting user navigations of graphical objects on a touch screen display
US9772751B2 (en) 2007-06-29 2017-09-26 Apple Inc. Using gestures to slide between user interfaces
US9619143B2 (en) 2008-01-06 2017-04-11 Apple Inc. Device, method, and graphical user interface for viewing application launch icons
US8619038B2 (en) 2007-09-04 2013-12-31 Apple Inc. Editing interface
US11126321B2 (en) 2007-09-04 2021-09-21 Apple Inc. Application menu user interface
US8438504B2 (en) 2010-01-06 2013-05-07 Apple Inc. Device, method, and graphical user interface for navigating through multiple viewing areas
JP2012059212A (en) * 2010-09-13 2012-03-22 Nippon Telegr & Teleph Corp <Ntt> Extraction apparatus, extraction method and extraction program
JP2013218627A (en) * 2012-04-12 2013-10-24 Nippon Telegr & Teleph Corp <Ntt> Method and device for extracting information from structured document and program
JP5701830B2 (en) * 2012-09-04 2015-04-15 日本電信電話株式会社 Document structure analysis apparatus and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916255A (en) * 2010-07-02 2010-12-15 互动在线(北京)科技有限公司 HTML (Hypertext Markup Language) content contrast device and method
CN101916255B (en) * 2010-07-02 2012-02-15 互动在线(北京)科技有限公司 HTML (Hypertext Markup Language) content contrast device and method

Also Published As

Publication number Publication date
JP2004318505A (en) 2004-11-11

Similar Documents

Publication Publication Date Title
JP4046000B2 (en) Structured document extraction method, apparatus and program
US7730104B2 (en) Extraction of information from structured documents
US7913163B1 (en) Determining semantically distinct regions of a document
US8321396B2 (en) Automatically extracting by-line information
JP2012529688A (en) Update notification method and system
US20070130176A1 (en) Document processing method, recording medium, and document processing system
KR102033416B1 (en) Method for generating data extracted from document and apparatus thereof
US7496571B2 (en) Method for performing information-preserving DTD schema embeddings
JP3832693B2 (en) Structured document search and display method and apparatus
JP2010198058A (en) Document processing system and method
JP2007052737A (en) Information processor and computer program
JP4977096B2 (en) Highlighting addition method, display control program, and server
JP2004164104A (en) Structured data retrieval method, structured data retrieval device and program
JP2012059212A (en) Extraction apparatus, extraction method and extraction program
JP5379627B2 (en) Search control apparatus, search control method, and program
JP2007133763A (en) Device and program for comparing element information
JP2004529427A5 (en)
JP4119413B2 (en) Knowledge information collection system, knowledge search system, and knowledge information collection method
JP5068356B2 (en) Blog body identification device and blog body identification method
JP3937944B2 (en) Information extraction method and apparatus from structured document, information extraction program, and computer-readable recording medium
JP5535270B2 (en) Document component analysis apparatus and program
JP2013161182A (en) Test item generation device and test item generation method
JP2008287311A (en) Content part retrieving method and device
JP5380130B2 (en) File search apparatus, file search method, and program
JP2010079857A (en) Program and device for retrieval of structured data

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070724

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070921

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071112

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101130

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4046000

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101130

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111130

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111130

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121130

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121130

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131130

Year of fee payment: 6

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term