JP5559104B2 - Information extraction method, information extraction apparatus, and information extraction program - Google Patents

Information extraction method, information extraction apparatus, and information extraction program Download PDF

Info

Publication number
JP5559104B2
JP5559104B2 JP2011166460A JP2011166460A JP5559104B2 JP 5559104 B2 JP5559104 B2 JP 5559104B2 JP 2011166460 A JP2011166460 A JP 2011166460A JP 2011166460 A JP2011166460 A JP 2011166460A JP 5559104 B2 JP5559104 B2 JP 5559104B2
Authority
JP
Japan
Prior art keywords
link
text
structured document
extracted
information extraction
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
JP2011166460A
Other languages
Japanese (ja)
Other versions
JP2013030041A (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 JP2011166460A priority Critical patent/JP5559104B2/en
Publication of JP2013030041A publication Critical patent/JP2013030041A/en
Application granted granted Critical
Publication of JP5559104B2 publication Critical patent/JP5559104B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、Webページなどの構造化文書から本文を抽出する技術に関する。   The present invention relates to a technique for extracting a text from a structured document such as a Web page.

近年、インターネットなどのコンピュータネットワークを通じて、大量の電子化された文書の利用や不特定多数人を対象とした情報発信などが可能になっている。コンピュータネットワーク上で表現された電子文書は、その特徴を生かした表現が利用され、WWW(World Wide Web)上のWebページではマークアップ言語(markup language)で記述された構造化文書が多く利用されている。   In recent years, it has become possible to use a large amount of digitized documents and send information to unspecified large numbers of people through a computer network such as the Internet. An electronic document expressed on a computer network uses an expression that makes use of its characteristics, and a Web page on the WWW (World Wide Web) often uses a structured document described in a markup language. ing.

例えばHTML(HyperText Markup Language)と呼ばれる文書は、何らかの情報を記述するだけではなく、他のコンピュータ上に存在する他の人が記述した文書を参照するための「ハイパーリンク(Hyperlink)」の機能を有している。これは他の文書を信頼して自身の記している情報を補完したり、同様の内容の文書を参照するときなどに利用されている。   For example, a document called HTML (HyperText Markup Language) has a function of “hyperlink” for referring to a document described by another person existing on another computer as well as describing some information. Have. This is used when, for example, trusting another document to supplement the information described by itself or referring to a document having the same content.

その一方でHTMLファイルの情報は、「広告」部分や「メニュー」部分といった本来表現したい情報とは無関係の情報が記述されている場合もある。そこで、検索サービスやHTMLファイルへのアクセスログの解析などでは、HTMLファイルが本来表現したかった情報を適切に抽出する必要が生じる。ここで抽出される部分を「本文」と呼び、「本文」を抽出することを「本文抽出」と呼ぶこととする。   On the other hand, the information of the HTML file may describe information unrelated to the information to be originally expressed, such as an “advertisement” portion or a “menu” portion. Therefore, in search services and analysis of access logs to HTML files, it is necessary to appropriately extract information that the HTML file originally intended to express. The part extracted here is called “text”, and the extraction of “text” is called “text extraction”.

HTMLファイル内に記述されたHTMLタグ情報を利用して本文を抽出する既存技術としては、「Webスクレイピング(単にスクレイピングと表現される場合もある。)」が存在する。このスクレイピングを行うには、HTML(XML)ファイルのどの部分を抽出すべきかを、XSLT(XML Stylesheet Language Transformations)、即ちXMLにより記述された文書を他のXML文書に変換するための簡易言語で指定する方法が知られている。この方法が非特許文献1に示されている。   As an existing technique for extracting a text by using HTML tag information described in an HTML file, there is “Web scraping (sometimes expressed simply as scraping)”. To do this scraping, specify which part of the HTML (XML) file should be extracted by XSLT (XML Style Language Transformations), that is, a simple language for converting a document written in XML into another XML document How to do is known. This method is shown in Non-Patent Document 1.

著者:Erik T.Ray、訳者:山本和彦 中原晃司 梶浦正規 豊田公児、”入門XML”、株式会社オーム社、2001年9月28日、p.203−241Author: Erik T. Ray, Translated by: Kazuhiko Yamamoto, Junji Nakahara, Masaru Kajiura, “Introductory XML”, Ohm Co., Ltd., September 28, 2001, p. 203-241 ”要素の親子関係/HTML基礎講座”、「online」、初版公開日2002年5月18日 最新更新日2004年3月7日、[2011年年7月13日検索]、インターネット<URL:http://www,scollabo.com/banban/lectur/ht6.html>"Element-parent relationship / HTML basic course", "online", first edition release date May 18, 2002 Latest update date March 7, 2004 [Search July 13, 2011], Internet <URL: http : //www,scollabo.com/banban/lectur/ht6.html> ”ブロックレベル要素とインライン要素”、「online」、2001年4月5日更新、[2011年7月13日検索]、インターネット<URL:http://www.kanzaki.com/docs/html/element-level.html>"Block level elements and inline elements", "online", updated April 5, 2001, [searched July 13, 2011], Internet <URL: http://www.kanzaki.com/docs/html/element -level.html>

しかしながら、非特許文献1の方法は、本文抽出するHTMLファイルが小数であれば、それに応じたXSLTにて表記された「ルール」を用意することで可能であるものの、インターネット上のあらゆるHTMLを収集するなど大量のHTMLファイルが存在する場合には、各々のHTMLファイルに対して本文抽出を行うためのルールを予め用意しなければならず、非常に困難であった。   However, the method of Non-Patent Document 1 can collect all HTML on the Internet, although it is possible to prepare “rules” written in XSLT according to the HTML file to be extracted if it is a decimal number. When there are a large number of HTML files such as, a rule for performing text extraction for each HTML file must be prepared in advance, which is very difficult.

また、一度用意した本文抽出のルールは未来永劫に使い続けられる保証はなく、HTMLファイルの記述内容が変更された場合には本文が抽出できなくなるおそれもある。   Also, once prepared text extraction rules are not guaranteed to continue to be used forever, and there is a possibility that the text cannot be extracted if the description content of the HTML file is changed.

本発明は、上述のような従来技術の問題点を解決するためになされたものであり、本文抽出のルールに依存することなく、構造化文書から本文抽出を行うことを解決課題としている。   The present invention has been made in order to solve the above-described problems of the prior art, and it is an object of the present invention to perform text extraction from a structured document without depending on text extraction rules.

そこで、本発明は、構造化文書の参照関係を利用し、参照元の構造化文書に存在する情報部分を参照先の構造化文書内から抽出する。すなわち、参照元(リンク元)の構造化文書に存在する情報を有する部分を参照先(リンク先)の構造化文書から抽出することで、広告部分やメニュー部分などの不要な部分の情報を排除し、本文のみを抽出する。   Therefore, the present invention extracts the information portion existing in the reference source structured document from the reference destination structured document using the reference relationship of the structured document. In other words, by extracting the part having information existing in the structured document of the reference source (link source) from the structured document of the reference destination (link destination), information on unnecessary parts such as the advertisement part and the menu part is eliminated. And only the text is extracted.

本発明の情報抽出方法は、収集された構造化文書群に対して、それぞれの構造化文書内に存在するリンクと、該リンク周辺テキスト情報とを抽出するリンク元情報抽出ステップと、リンク元情報抽出ステップで抽出されたリンクに基づきリンク先の構造化文書を特定し、該ステップで抽出されたリンク周辺テキスト情報を含むリンク先の構造化文書における代表的な部分を本文として抽出する本文抽出ステップと、を有する。   The information extraction method according to the present invention includes a link source information extraction step for extracting a link existing in each structured document and the link peripheral text information for the collected structured document group, and link source information A text extraction step for identifying a linked structured document based on the link extracted in the extracting step, and extracting a representative part of the linked structured document including link peripheral text information extracted in the step as a text And having.

また、本発明の情報抽出装置は、収集された構造化文書群に対して、それぞれの構造化文書内に存在するリンクと、該リンク周辺テキスト情報とを抽出するリンク元情報抽出部と、リンク元情報抽出部で抽出されたリンクに基づきリンク先の構造化文書を特定し、該情報抽出部で抽出されたリンク周辺テキスト情報を含むリンク先の構造化文書における代表的な部分を本文として抽出する本文抽出部と、を備える。   In addition, the information extraction apparatus of the present invention includes a link source information extraction unit that extracts a link existing in each structured document and the link peripheral text information with respect to the collected structured document group, and a link Based on the link extracted by the original information extraction unit, the structured document of the link destination is specified, and a representative part in the structured document of the link destination including the link peripheral text information extracted by the information extraction unit is extracted as the text. A text extraction unit.

なお、本発明は、前記装置としてコンピュータを機能させるプログラムとすることもできる。このプログラムは、ネットワークや記録媒体などを通じて提供することができる。   The present invention may be a program that causes a computer to function as the device. This program can be provided through a network or a recording medium.

本発明によれば、本文抽出のルールに依存することなく、構造化文書から本文抽出を行うことができる。   According to the present invention, text extraction can be performed from a structured document without depending on text extraction rules.

本発明の実施形態に係る情報抽出装置のブロック図。The block diagram of the information extraction device which concerns on embodiment of this invention. 同 リンク元情報抽出部の処理を示すフローチャート。The flowchart which shows the process of the link source information extraction part. ハイパーリンクによる参照情報を含む文書例。Example document containing reference information by hyperlink. (a)は図3の文書AのHTMLファイル(ソース)例、(b)は図3の文書BのHTMLファイル(ソース)例。(A) is an example of an HTML file (source) of document A in FIG. 3, and (b) is an example of an HTML file (source) of document B in FIG. 本文抽出部の処理を示すフローチャート。The flowchart which shows the process of a text extraction part.

以下、本発明の実施形態に係る情報抽出装置を説明する。この情報抽出装置は、マークアップ言語で記述された構造化文書、主にWWW上のWebページなどを処理対象とし、参照表現を利用して本文抽出を行う。   Hereinafter, an information extraction apparatus according to an embodiment of the present invention will be described. This information extraction apparatus processes structured documents described in a markup language, mainly Web pages on the WWW, and performs text extraction using reference expressions.

ここではHTMLドキュメント(HTML文書)のハイパーリンクによる参照表現に基づく処理例を説明する。すなわち、リンク元のHTMLファイルとリンク先のHTMLファイルとを用いて、リンク先のHTMLファイルから本文を抽出する。このときリンク元のHTMLファイル中に記述された情報を抽出し、抽出された情報がリンク先のHTMLファイル内に存在する場合、それに応じたタグ(例えばリンク元ファイルからの抽出情報をすべて含むようなタグ)をピックアップする。   Here, a processing example based on a reference expression by a hyperlink of an HTML document (HTML document) will be described. That is, the text is extracted from the linked HTML file by using the linked HTML file and the linked HTML file. At this time, when the information described in the link source HTML file is extracted and the extracted information exists in the link destination HTML file, the corresponding tag (for example, all the extracted information from the link source file is included). Pick up the tag).

≪構成例≫
図1に基づき前記情報抽出装置の構成例を説明する。この情報抽出装置1は、コンピュータにより構成され、通常のコンピュータのハードウェアリソース、例えばCPU.メモリ(RAM)やハードディスクドライブ装置などの記憶装置など備える。
≪Configuration example≫
A configuration example of the information extraction apparatus will be described with reference to FIG. This information extraction apparatus 1 is configured by a computer, and is a normal computer hardware resource such as a CPU. A storage device such as a memory (RAM) or a hard disk drive device is provided.

このハードウェアリソースとソフトウェアリソース(OS.アプリケーションなど)との協働の結果、情報抽出装置1は、文書集合記録部2.文書集合DB3.リンク元情報抽出部4.本文抽出部5.出力部6を実装する。この記録部2は、図示省略の入力部を通じて入力された処理対象の文書の情報、例えばHTMLファイルを前記DB3に記録する。このHTMLファイルは、検索エンジンのクローリングなどで収集されたものでもよい。なお、前記DB3は前記記憶装置に構築されているものとする。   As a result of the cooperation between the hardware resource and the software resource (OS. Application, etc.), the information extraction apparatus 1 has the document set recording unit 2. Document set DB3. 3. Link source information extraction unit 4. Text extraction unit The output unit 6 is mounted. The recording unit 2 records information on a document to be processed input through an input unit (not shown), such as an HTML file, in the DB 3. This HTML file may be collected by search engine crawling or the like. Note that the DB 3 is constructed in the storage device.

前記情報抽出部4は、前記DB3に記録された文書のHTMLファイル内に存在する参照関係を実現するハイパーリンクと、該リンクの周辺テキスト(以下リンク周辺テキストという。)とを抽出する。ここではハイパーリンクに囲まれた文字列を抽出してもよく、あるいはHTMLにおける要素(タグ)の階層構造(親子関係)に基づきリンク先文書のURL含む上位n番目(n=正の整数)のブロック要素内に存在する文字列を抽出してもよい。   The information extraction unit 4 extracts a hyperlink that realizes a reference relationship existing in the HTML file of the document recorded in the DB 3 and a peripheral text of the link (hereinafter referred to as a link peripheral text). Here, a character string surrounded by hyperlinks may be extracted, or based on the hierarchical structure (parent-child relationship) of elements (tags) in HTML, the upper nth (n = positive integer) including the URL of the linked document You may extract the character string which exists in a block element.

本文抽出部5は、前記DB3に記録された文書についてHTMLファイルを参照するハイパーリンクが前記情報抽出部4で抽出されていれば、該文書をリンク先文書として特定する。ここで特定されたリンク先文書のHTMLファイル内に存在するテキスト情報の文字列と前記情報抽出部4の抽出したリンク周辺テキストの文字列とを比較し、リンク先文書内の代表的な部分を本文として抽出する。ここでは前記情報抽出部4で抽出された文字列をすべて含む上位N番目(N=正の整数)の要素(親タグ)の配下に存在する文字列を抽出する。   If the hyperlink that refers to the HTML file for the document recorded in the DB 3 is extracted by the information extracting unit 4, the body extracting unit 5 identifies the document as a linked document. The character string of the text information existing in the HTML file of the link destination document specified here is compared with the character string of the link peripheral text extracted by the information extraction unit 4, and a representative portion in the link destination document is determined. Extract as text. Here, the character string existing under the top N-th (N = positive integer) element (parent tag) including all the character strings extracted by the information extraction unit 4 is extracted.

したがって、広告部分やメニュー部分などの不要部分の情報を排除し、本文に該当する部分のみが抽出される。抽出された本文は出力部6を通じて、例えば検索エンジンにおける検索用の索引(インデックス)を作成するためのHTMLを代表する部分として出力される。以下、情報抽出装置1の処理の詳細を、前記情報抽出部4と本文抽出部5とに大別して説明する。   Therefore, information on unnecessary parts such as an advertisement part and a menu part is excluded, and only a part corresponding to the text is extracted. The extracted text is output through the output unit 6 as, for example, a part representing HTML for creating a search index (index) in a search engine. Hereinafter, the details of the processing of the information extraction device 1 will be described by roughly dividing the information extraction unit 4 and the text extraction unit 5.

≪前記情報抽出部4の処理例≫
まず、図2に基づき前記情報抽出部4の処理例を説明する。ここでは図3の文書A〜Dを処理対象とする。この文書A〜Dは、商品購入サービスを行っているインターネット上のサイトにて提供されるHTMLファイルであって、文書Aは商品を羅列する文書を関し、文書B〜Dは商品1〜3の詳細を説明する文書に関する。
<< Processing Example of Information Extraction Unit 4 >>
First, a processing example of the information extraction unit 4 will be described with reference to FIG. Here, the documents A to D in FIG. The documents A to D are HTML files provided on a site on the Internet where a product purchase service is performed. The document A relates to a document listing the products, and the documents B to D are products 1 to 3. It relates to a document explaining the details.

図3中、文書Aの商品名1〜3の下線(アンダーライン)は文書B.Cの参照を実現するハイパーリンクを示し、商品名1のハイパーリンクは文書Bを参照し、商品名2のハイパーリンクは文書Cを参照し、商品名3のハイパーリンクは文書Dを参照している。なお、文書A〜DのHTMLファイルは、前記DB2に記録されているものとする。   In FIG. 3, the underline (underline) of the product names 1 to 3 of the document A is the document B. A hyperlink that realizes reference to C is shown, the hyperlink of product name 1 refers to document B, the hyperlink of product name 2 refers to document C, and the hyperlink of product name 3 refers to document D Yes. It is assumed that the HTML files of the documents A to D are recorded in the DB2.

まず、前記情報抽出部4は、処理が開始さると処理対象のHTMLファイルを前記DB3から取得する(S01)。ここでは一例として文書AのHTMLファイルを取得するものとする。その後にS01で取得したHTMLファイル内にハイパーリンクが存在するか否かを確認する(S02)。確認の結果、ハイパーリンクが存在しなければ前記情報抽出部4の処理を終了する。一方、ハイパーリンクが存在すれば該ハイパーリンクとリンク周辺テキストとを抽出し(S03)、処理を終了する。この抽出情報は次の(1)(2)のいずれかで定義されるものとする。
(1)ハイパーリンク(HTMLタグのANCHORタグ)に囲まれた文字列(URLを含む文字列)
(2)ハイパーリンク先文書のURLを含み、かつ上位n番目(n=正の整数)に出現するブロック要素内に存在する文字列
この定義(1)(2)の選択あるいは「nの値」に依存して抽出情報の範囲を変更することができる。例えば定義(1)を選択すれば最小範囲、即ち「ハイパーリンク(HTMLタグのANCHORタグに囲まれた文字列」が抽出される。また、定義(2)を選択して「n=最大値(HTML要素の階層数)」すれば最大範囲、即ち「本文全文(HTMLタグのBODYタグの中身すべて)」が抽出される。このとき抽出される文字列にHTMLタグ「<>」を含むか否かの条件を与えることもできる。
First, when the process starts, the information extraction unit 4 acquires an HTML file to be processed from the DB 3 (S01). Here, as an example, an HTML file of document A is acquired. Thereafter, it is confirmed whether or not a hyperlink exists in the HTML file acquired in S01 (S02). If there is no hyperlink as a result of the confirmation, the processing of the information extraction unit 4 is terminated. On the other hand, if a hyperlink exists, the hyperlink and link peripheral text are extracted (S03), and the process ends. This extraction information is defined by either (1) or (2) below.
(1) Character string (character string including URL) enclosed by hyperlink (an HTML tag ANCHOR tag)
(2) Character string existing in the block element that includes the URL of the hyperlink destination document and appears in the top nth (n = positive integer) This definition (1) Selection of (2) or “value of n” The range of extraction information can be changed depending on For example, if the definition (1) is selected, the minimum range, that is, “hyperlink (a character string surrounded by the HTML tag of the HTML tag)” is extracted. Also, the definition (2) is selected and “n = maximum value ( The maximum range, that is, “the full text (the entire contents of the BODY tag of the HTML tag)” is extracted. Whether the HTML tag “<>” is included in the extracted character string It is possible to give these conditions.

ここでHTMLの要素(タグ)は、非特許文献2に示すように、ある要素がある要素を含み、さらにその要素が別の要素を含む、というように階層構造で表される。この階層構造は、一般的に親要素、子要素、孫要素などと親子関係にたとえて表現され、要素ごとに親子関係を有しており、定義(2)の上位n番目は要素の親子関係を示している。   Here, as shown in Non-Patent Document 2, HTML elements (tags) are expressed in a hierarchical structure such that a certain element includes an element and the element includes another element. This hierarchical structure is generally expressed as a parent-child relationship with parent elements, child elements, grandchild elements, etc., and each element has a parent-child relationship. The top nth of definition (2) is the parent-child relationship of the elements Is shown.

また、要素の種類としては、非特許文献3に示すように、表示上のブロック(見出し・段落など)を構成するブロック要素と、表示上はブロック要素と連続しているように見えるインライン要素とが存在する。これを図4(a)に基づき説明すれば、文書AのHTMLファイル中、DIVはブロック要素に該当し、SPANとA(ANCHOR)はインライン要素に該当する。   As the types of elements, as shown in Non-Patent Document 3, a block element that constitutes a block (heading, paragraph, etc.) on the display, and an inline element that appears to be continuous with the block element on the display, Exists. This will be described with reference to FIG. 4A. In the HTML file of document A, DIV corresponds to a block element, and SPAN and A (ANCHOR) correspond to inline elements.

このときA(ANCHOR)タグからみれば、「id=TR」のDIVタグは上位1番目に出現するブロック要素に該当し、「id=TABLE」のDIVタグは上位第2番目に出現するブロック要素に該当する。なお、A(ANCHOR)タグのhref属性はリンク先のURLを指定しているものとする。   At this time, from the viewpoint of the A (ANCHOR) tag, the DIV tag with “id = TR” corresponds to the block element that appears first, and the DIV tag with “id = TABLE” appears as the block element that appears second. It corresponds to. It is assumed that the href attribute of the A (ANCHOR) tag specifies a link destination URL.

ここで文書AのHTMLファイル中からの抽出例を説明する。図4(a)に示すように、文書AのHTMLファイルには3個のA(ANCHOR)タグが存在するため、3個のハイパーリンクが埋まっていることがS02で確認される。この各A(ANCHOR)タグはhref属性に示すように、文書B〜Dを参照している。ここでは一例としてS03のリンク元文書からの抽出範囲が定義(2)に設定され、「n=1」に設定されているものとする。また、「タグを含まず人が可読なテキストのみ」という条件も与えられているものとする。   Here, an example of extracting the document A from the HTML file will be described. As shown in FIG. 4A, since there are three A (ANCHOR) tags in the HTML file of document A, it is confirmed in S02 that three hyperlinks are buried. Each A (ANCHOR) tag refers to the documents B to D as indicated by the href attribute. Here, as an example, it is assumed that the extraction range from the link source document in S03 is set in the definition (2) and “n = 1” is set. It is also assumed that a condition “only human-readable text not including tags” is given.

このとき各A(ANCHORタグ)からみれば、「id=TR」の各DIVタグは上位1番目に出現するブロック要素に該当するから、その配下の各SPANタグに囲まれた文字列がそれぞれ抽出される。したがって、文書Bについては上段の「DIV id=TR」配下、即ちhref属性に示す文書BのURLと、「商品名1」「値段:100円」「色:赤」のリンク周辺テキストとが抽出される。   At this time, from the viewpoint of each A (ANCHOR tag), each DIV tag of “id = TR” corresponds to the block element that appears first in the top, so that the character strings surrounded by the subordinate SPAN tags are respectively extracted. Is done. Therefore, for the document B, the URL of the document B shown in the upper “DIV id = TR”, that is, the href attribute, and the link peripheral text of “product name 1” “price: 100 yen” “color: red” are extracted. Is done.

また、文書Cについては中段の「DIV id=TR」配下、即ちhref属性に示す文書CのURLと、「商品名2」「値段:300円」「色:青」のリンク周辺テキストとが抽出される。   For document C, the URL of document C shown in the middle “DIV id = TR”, that is, the href attribute, and the link peripheral text of “product name 2”, “price: 300 yen”, and “color: blue” are extracted. Is done.

さらに、文書Dについては下段の「DIV id=TR」配下、即ちhref属性に示す文書DのURLと、「商品名3」「値段:300円」「色:黄」のリンク周辺テキストとが抽出される。抽出されたリンク先文書のURLとリンク周辺テキストとは前記記憶装置に記憶されるものとする。   Further, for document D, the lower part of “DIV id = TR”, that is, the URL of document D shown in the href attribute and the link peripheral text of “product name 3”, “price: 300 yen”, and “color: yellow” are extracted. Is done. It is assumed that the URL of the extracted link destination document and link peripheral text are stored in the storage device.

≪本文抽出部5の処理内容≫
つぎに図5に基づき本文抽出部5の処理例を説明する。本文抽出部5は、処理が開始されると処理対象のHTMLファイルを前記DB2から取得する(S11)。ここでは一例として文書B〜DのHTMLファイルを取得するものとする。
≪Processing content of text extraction unit 5≫
Next, a processing example of the text extracting unit 5 will be described with reference to FIG. When the process is started, the text extracting unit 5 acquires an HTML file to be processed from the DB 2 (S11). Here, as an example, it is assumed that HTML files of documents B to D are acquired.

この取得したHTMLファイルを参照するハイパーリンクがS03で抽出されているか否かを確認する(S12)。この確認は前記記憶装置に記憶されたリンク先文書のURLを用いればよい。この結果、ハイパーリンクの存在が確認されていなければ処理を終了し、S11に戻って次のHTMLファイルを取得する。   It is confirmed whether or not a hyperlink referring to the acquired HTML file is extracted in S03 (S12). For this confirmation, the URL of the link destination document stored in the storage device may be used. As a result, if the presence of the hyperlink is not confirmed, the process is terminated, and the process returns to S11 to acquire the next HTML file.

一方、ハイパーリンクの存在が確認されていれば、取得したHTMLファイルをリンク先文書と特定し、S03で抽出されたリンク周辺テキストを前記記憶装置から取得し、リンク周辺テキストを含むリンク先文書の代表部分を本文として抽出する(S13)。このときリンク先文書のどこまでを代表的部分、即ち本文とするのかの条件が必要である。基本的にはS03で抽出されたリンク周辺テキストの文字列を含む部分であればよいが、リンク先のHTMLファイルの「すべての文字列」とするのでは無用な情報によるデータ容量の増加を招くおそれがある。   On the other hand, if the existence of the hyperlink is confirmed, the acquired HTML file is identified as the link destination document, the link peripheral text extracted in S03 is acquired from the storage device, and the link destination document including the link peripheral text is acquired. The representative part is extracted as the text (S13). At this time, it is necessary to have a condition as to how much of the linked document is a representative part, that is, a text. Basically, it may be a part including the character string of the link peripheral text extracted in S03, but if “all character strings” of the link destination HTML file is used, the data capacity increases due to unnecessary information. There is a fear.

そこで、本文抽出される代表的部分の範囲指定としては、S03で抽出されたリンク周辺テキストの文字列をすべて含み、かつ上位N番目(N=正の整数)に出現する親要素(タグ)を探索し、その配下に存在する文字列を本文とする。この本文抽出の条件、即ちNの値を変更することでHTMLファイル内から抽出される本文抽出の文字列を変更することもできる。このとき本文にHTMLタグを含むか否かの条件も与えることができるものとする。   Therefore, as the range designation of the representative part extracted from the body, the parent element (tag) that includes all the character strings of the link peripheral text extracted in S03 and appears in the top Nth (N = positive integer) is used. Search and use the character string under the search as the text. The text extraction character string extracted from the HTML file can be changed by changing the text extraction condition, that is, the value of N. At this time, it is also possible to give a condition as to whether or not an HTML tag is included in the text.

以下、文書BのHTMLファイルに対する処理例を説明する。ここでは本文抽出条件は「N=1」に設定され、上位1番目に出現する親要素を探索するものとする。また、文書Bは、S12でS03のハイパーリンク抽出が確認され、前記記憶装置にはS03で抽出した「商品名1」「値段:100円」「色:赤」のリンク周辺テキストが記憶されているものとする。   A processing example for the HTML file of document B will be described below. Here, the text extraction condition is set to “N = 1”, and the parent element that appears first is searched. In addition, the hyperlink extraction of S03 is confirmed in document B in S12, and the link peripheral text “product name 1” “price: 100 yen” “color: red” extracted in S03 is stored in the storage device. It shall be.

このとき文書BのHTML中では、図4(b)に示すように、「商品名1」は「id=name」のSPANタグに挟まれ、「値段:100円」は「id=price」のSPANタグに挟まれ、「色:赤」は「id=color」のSPANタグに挟まれており、これらを「すべて含む上位1番目の親タグ」の探索結果として「DIV」タグが取得される。   At this time, in the HTML of document B, as shown in FIG. 4B, “product name 1” is sandwiched between SPAN tags of “id = name”, and “price: 100 yen” is “id = price”. “Color: Red” is sandwiched between SPAN tags of “id = color”, and a “DIV” tag is acquired as a search result of “the first top parent tag including all”. .

したがって、「その配下に存在する文字列」は「DIVタグの配下に存在する文字列」が該当する。ここでは「タグを含まず人が可読なテキストのみ」という条件が与えられているものとする。その結果、「商品名1,写真,型番:123456,値段:100円,色:赤,概略:売れてます」の文字列が文書Bの代表的部分、即ち本文として抽出される。このときHTMLタグを含んで抽出する条件が与えられていれば、タグ付の文字列が抽出される。抽出された本文は出力部6に出力され(S14)、処理を終了する。ここで出力部6に出力された本文は、検索エンジンなどに提供され、検索用の索引(インデックス)作成にあたってHTMLファイルの本来表現したかった情報の把握に役立てられる。   Therefore, the “character string existing under the subordinate” corresponds to the “character string existing under the DIV tag”. Here, it is assumed that the condition “only human-readable text including no tags” is given. As a result, the character string “product name 1, photo, model number: 123456, price: 100 yen, color: red, outline: sold” is extracted as a representative part of the document B, that is, the text. At this time, if a condition for extraction including an HTML tag is given, a character string with a tag is extracted. The extracted text is output to the output unit 6 (S14), and the process ends. The text output to the output unit 6 is provided to a search engine or the like, and is used for grasping information originally intended to be expressed in the HTML file when creating a search index.

このように情報抽出装置1によれば、従来のような本文抽出のためのルールに依存することなく、広告部分やメニュー部分などの不要部分の情報を排除して本文を抽出でき、前記ルールの保守コストが軽減される。特に、インターネット上で他者によって生成されたHTMLファイルに対しても、その更新に合わせて本文抽出を臨機応変に実現できる点でも有用である。   As described above, according to the information extracting apparatus 1, the text can be extracted by eliminating the information of the unnecessary part such as the advertisement part and the menu part without depending on the conventional rule for extracting the text. Maintenance costs are reduced. In particular, it is also useful in that text extraction can be realized flexibly according to the update of HTML files generated by others on the Internet.

なお、本発明は上記実施形態に限定されるものではなく、各請求項に記載された範囲内で変形して実施することができる。例えばS03における定義(1)(2)や「nの値」、S13の本文抽出条件「Nの値」はリンク元のHTMLファイル毎に異なってもよく、リンク先のHTMLファイル毎に異なっていてもよい。すなわち、処理対象の文書にすべてに同一としてもよく、あるいはインターネットサイト毎に個別的に選択・設定してもよい。   In addition, this invention is not limited to the said embodiment, It can deform | transform and implement within the range described in each claim. For example, the definitions (1) and (2) in S03, the “n value”, and the text extraction condition “N value” in S13 may be different for each link source HTML file, and may be different for each link destination HTML file. Also good. That is, it may be the same for all documents to be processed, or may be individually selected and set for each Internet site.

もっとも、本文として抽出する情報の統一化のためには、すべてのリンク元HTMLファイルで定義(1)(2)の選択や「nの値」の設定は同一であることが好ましい。同様にすべてのリンク先HTMLファイルで本文抽出条件「Nの値」の設定は同一であることが好ましい。   However, in order to unify the information extracted as the text, it is preferable that the definitions (1) and (2) are selected and the “n value” setting is the same in all link source HTML files. Similarly, it is preferable that the setting of the text extraction condition “value of N” is the same in all link destination HTML files.

また、本発明は、HTMLの文書に限定されることなく、XMLなどの他のマークアップ言語で記述された構造化文書も処理対象とすることができる。この場合には、XMLドキュメント(文書)同士のリンクを定義する「XLink(XML Linking Language)」を利用すればよい。   Further, the present invention is not limited to HTML documents, and structured documents described in other markup languages such as XML can be processed. In this case, “XML Linking Language (XML Linking Language)” that defines a link between XML documents (documents) may be used.

≪プログラムなど≫
本発明は、情報抽出装置1の各部2〜6の一部もしくは全部として、コンピュータを機能させる文書検索プログラムとして構成することもできる。このプログラムによれば、S01〜S03.S11〜S14の一部あるいは全部をコンピュータに実行させることが可能となる。
≪Programs≫
The present invention can also be configured as a document search program that causes a computer to function as some or all of the units 2 to 6 of the information extraction apparatus 1. According to this program, S01 to S03. It becomes possible to cause the computer to execute part or all of S11 to S14.

前記プログラムは、Webサイトや電子メールなどネットワークを通じて提供することができる。また、前記プログラムは、CD−ROM,DVD−ROM,CD−R,CD−RW,DVD−R,DVD−RW,MO,HDD,BD−ROM,BD−R,BD−REなどの記録媒体に記録して、保存・配布することも可能である。この記録媒体は、記録媒体駆動装置を利用して読み出され、そのプログラムコード自体が前記実施形態の処理を実現するので、該記録媒体も本発明を構成する。   The program can be provided through a network such as a website or e-mail. The program is stored in a recording medium such as a CD-ROM, DVD-ROM, CD-R, CD-RW, DVD-R, DVD-RW, MO, HDD, BD-ROM, BD-R, or BD-RE. It is also possible to record, save and distribute. This recording medium is read using a recording medium driving device, and the program code itself realizes the processing of the above embodiment, so that the recording medium also constitutes the present invention.

1…情報抽出装置
2…文書集合記録部
3…文書集合DB
4…リンク元情報抽出部
5…本文抽出部
6…出力部
DESCRIPTION OF SYMBOLS 1 ... Information extraction apparatus 2 ... Document set recording part 3 ... Document set DB
4 ... Link source information extraction unit 5 ... Text extraction unit 6 ... Output unit

Claims (3)

参照関係を実現するリンクが表現された構造化文書に基づきリンク先の構造化文書から本文を抽出する装置の情報抽出方法であって、
収集された構造化文書群に対して、それぞれの構造化文書内に存在するリンクと、該リンク周辺テキスト情報とを抽出するリンク元情報抽出ステップと、
前記リンク元情報抽出ステップで抽出されたリンクに基づきリンク先の構造化文書を特定し、該ステップで抽出されたリンク周辺テキスト情報を含むリンク先の構造化文書における代表的な部分を本文として抽出する本文抽出ステップと、を有し、
前記リンク元情報抽出ステップにおいて、リンク先の構造化文書のURLを含むリンクの要素から上位n番目(n=正の整数)のブロック要素に存在するタグの始点から終点までに挟まれた全ての文字列を抽出し、
前記本文抽出ステップにおいて、リンク元情報抽出ステップで抽出された文字列をすべて含む上位N番目(N=正の整数)の要素の配下に存在する文字列を代表的な部分として抽出する
ことを特徴とする情報抽出方法。
An information extraction method of an apparatus for extracting a text from a structured document of a link destination based on a structured document in which a link realizing a reference relationship is expressed,
A link source information extracting step for extracting a link existing in each structured document and the link peripheral text information with respect to the collected structured document group;
Identifying a structured document destination based on the link extracted by the link source information extracting step, extracting the representative portion in the structured document landing including the link around the text information extracted by said step as the body And a text extraction step to
In the link source information extraction step, all of the tags sandwiched from the start point to the end point of the tag present in the upper nth (n = positive integer) block element from the link element including the URL of the linked structured document Extract the string,
In the body extracting step, a character string existing under the top Nth (N = positive integer) element including all the character strings extracted in the link source information extracting step is extracted as a representative part. Information extraction method.
参照関係を実現するリンクが表現された構造化文書に基づきリンク先の構造化文書から本文を抽出する情報抽出装置であって、
収集された構造化文書群に対して、それぞれの構造化文書内に存在するリンクと、該リンク周辺テキスト情報とを抽出するリンク元情報抽出部ステップと、
前記リンク元情報抽出ステップで抽出されたリンクに基づきリンク先の構造化文書を特定し、該ステップで抽出されたリンク周辺テキスト情報を含むリンク先の構造化文書における代表的な部分を本文として抽出する本文抽出部と、を有し、
前記リンク元情報抽出部が、リンク先の構造化文書のURLを含むリンクの要素から上位n番目(n=正の整数)のブロック要素に存在するタグの始点から終点までに挟まれた全ての文字列を抽出し、
前記本文抽出部が、リンク元情報抽出ステップで抽出された文字列をすべて含む上位N番目(N=正の整数)の要素の配下に存在する文字列を代表的な部分として抽出する
ことを特徴とする情報抽出装置。
An information extraction device that extracts a text from a structured document of a link destination based on a structured document in which a link realizing a reference relationship is expressed,
A link source information extracting unit step for extracting a link existing in each structured document and the link peripheral text information with respect to the collected structured document group;
Identifying a structured document destination based on the link extracted by the link source information extracting step, extracting the representative portion in the structured document landing including the link around the text information extracted by said step as the body A text extraction unit to
The link source information extraction unit includes all the tags sandwiched from the start point to the end point of the tag existing in the upper nth (n = positive integer) block element from the link element including the URL of the linked structured document . Extract the string,
The text extraction unit extracts, as a representative part, a character string existing under the top Nth (N = positive integer) element including all the character strings extracted in the link source information extraction step. Information extraction device.
請求項2記載の情報抽出装置の各部としてコンピュータを機能させる情報抽出プログラム。   An information extraction program for causing a computer to function as each unit of the information extraction device according to claim 2.
JP2011166460A 2011-07-29 2011-07-29 Information extraction method, information extraction apparatus, and information extraction program Expired - Fee Related JP5559104B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011166460A JP5559104B2 (en) 2011-07-29 2011-07-29 Information extraction method, information extraction apparatus, and information extraction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011166460A JP5559104B2 (en) 2011-07-29 2011-07-29 Information extraction method, information extraction apparatus, and information extraction program

Publications (2)

Publication Number Publication Date
JP2013030041A JP2013030041A (en) 2013-02-07
JP5559104B2 true JP5559104B2 (en) 2014-07-23

Family

ID=47787016

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011166460A Expired - Fee Related JP5559104B2 (en) 2011-07-29 2011-07-29 Information extraction method, information extraction apparatus, and information extraction program

Country Status (1)

Country Link
JP (1) JP5559104B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766328B (en) * 2017-10-24 2020-06-12 平安科技(深圳)有限公司 Text information extraction method of structured text, storage medium and server
JP7383456B2 (en) * 2019-11-12 2023-11-20 ユーソナー株式会社 Information management system, identification information assignment module, and information management method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11134341A (en) * 1997-10-24 1999-05-21 Nec Corp System for displaying selection of descriptive information in hyper media description language
JP3894428B2 (en) * 2002-02-20 2007-03-22 日本ビクター株式会社 Information extraction method, information retrieval method, and information extraction computer program
JP4801555B2 (en) * 2006-09-29 2011-10-26 株式会社ジャストシステム Document processing apparatus, document processing method, and document processing program
JP4381423B2 (en) * 2007-01-22 2009-12-09 日本電信電話株式会社 Document collection device, document collection method, program, and recording medium
JP5338298B2 (en) * 2008-12-19 2013-11-13 カシオ計算機株式会社 Page browsing device and program
JP2011048730A (en) * 2009-08-28 2011-03-10 Nippon Telegr & Teleph Corp <Ntt> Method for assisting browsing of webpage

Also Published As

Publication number Publication date
JP2013030041A (en) 2013-02-07

Similar Documents

Publication Publication Date Title
US7386558B2 (en) Methods and systems for filtering an Extensible Application Markup Language (XAML) file to facilitate indexing of the logical content contained therein
US20080091699A1 (en) Method of converting structured data
Penev et al. XML schemas and mark-up practices of taxonomic literature
JP4042830B2 (en) Content attribute information normalization method, information collection / service provision system, and program storage recording medium
JP2008226235A (en) Information feedback system, information feedback method, information control server, information control method, and program
JP4542993B2 (en) Structured document extraction apparatus, structured document extraction method, and structured document extraction program
JP5559104B2 (en) Information extraction method, information extraction apparatus, and information extraction program
JP3832693B2 (en) Structured document search and display method and apparatus
Zinn The CLARIN language resource switchboard
Najeeb XML database for hadith and narrators
JP2010250439A (en) Retrieval system, data generation method, program and recording medium for recording program
Rose et al. Virtual XML: A toolbox and use cases for the XML world view
KR20080100344A (en) Scalable algorithm for sharing edi schemas
Srivastava et al. Implementation of web application for disease prediction using AI
KR20070120965A (en) Determining fields for presentable files and extensible markup language schemas for bibliographies and citations
JP4242701B2 (en) Storage search device, storage search program, and storage search program recording medium
JP5739310B2 (en) Document feature extraction apparatus, document feature extraction method, document feature extraction program
JP7116940B2 (en) Method and program for efficiently structuring and correcting open data
Wilson DIGITAL LIBRARIES ON THE WEB: HOW technologies SUPPORT digital content.
Sica et al. Application of Humboldt Extension to Real-world Cases.
Kumar Accessing Data from SEC EDGAR
JP2009110506A (en) Information processing apparatus and information processing program
JP4261876B2 (en) Statistical device, retrieval device, program, statistical method, retrieval method
Srivastava et al. Business Insight from Collection of Unstructured Formatted Documents with IBM Content Harvester.
TW530240B (en) Method and system for web authoring assistance

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130830

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140311

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140512

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140605

R150 Certificate of patent or registration of utility model

Ref document number: 5559104

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees