JP7252818B2 - Data extraction system from digital documents - Google Patents

Data extraction system from digital documents Download PDF

Info

Publication number
JP7252818B2
JP7252818B2 JP2019072770A JP2019072770A JP7252818B2 JP 7252818 B2 JP7252818 B2 JP 7252818B2 JP 2019072770 A JP2019072770 A JP 2019072770A JP 2019072770 A JP2019072770 A JP 2019072770A JP 7252818 B2 JP7252818 B2 JP 7252818B2
Authority
JP
Japan
Prior art keywords
text
data
caption
coordinate information
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019072770A
Other languages
Japanese (ja)
Other versions
JP2020170445A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2019072770A priority Critical patent/JP7252818B2/en
Publication of JP2020170445A publication Critical patent/JP2020170445A/en
Application granted granted Critical
Publication of JP7252818B2 publication Critical patent/JP7252818B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、デジタル文書からグラフや表などのデータを抽出する手法に関する。 The present invention relates to a technique for extracting data such as graphs and tables from digital documents.

人工知能(AI:Artificial Intelligence)などによるデータ分析で、デジタル文書として発行されている新聞記事、論文、企業の決算報告などのデータを分析し、ユーザにとって価値ある情報を提供するサービスが一般的になっている。データ分析を行うための準備として、Webなどから収集した大量のデジタル文書を、利活用がしやすい形式に変換する処理が必要となる。デジタル文書は、Hyper Text Markup Language(HTML)やExtensible Markup Language(XML)といった、様々なファイルフォーマットで提供されるが、これらのフォーマットのデジタル文書には、データそのものの他に、データの構造を示すメタ情報が含まれている。このようなデジタル文書の構造を解析し、デジタル文書のタイトルや、本文、著者、発行日、表、グラフといった、分析対象とするデータのみを抽出し、Data Base(DB)などのストレージ装置に格納する変換処理を、データ分析のデータ準備として行う必要がある。 Data analysis using AI (Artificial Intelligence) is a service that analyzes data such as newspaper articles, papers, and corporate financial statements published as digital documents and provides valuable information to users. It's becoming As a preparation for data analysis, it is necessary to convert a large amount of digital documents collected from the Web etc. into a format that is easy to use. Digital documents are provided in various file formats, such as Hyper Text Markup Language (HTML) and Extensible Markup Language (XML). Digital documents in these formats contain not only the data itself, but also the structure of the data. Contains meta information. Analyze the structure of such digital documents, extract only the data to be analyzed, such as the title of the digital document, text, author, publication date, table, graph, etc., and store it in a storage device such as a data base (DB). It is necessary to perform the conversion process for data analysis as data preparation for data analysis.

現在、数多くのデジタル文書がPortable Document Format(PDF)のファイルとして頒布されており、PDFファイルの分析が、データ分析において求められている。データ分析を行う際、データ準備として、PDFファイルの構造を解析し、分析対象のデータを抽出する処理を行う必要がある。表やグラフといったデータは、重要な情報が格納されている可能性が高く、表やグラフデータの抽出が強く求められる。 Currently, many digital documents are distributed as files in Portable Document Format (PDF), and analysis of PDF files is required in data analysis. When analyzing data, it is necessary to analyze the structure of the PDF file and extract the data to be analyzed as data preparation. Data such as tables and graphs are highly likely to contain important information, and extraction of table and graph data is strongly desired.

PDFファイルは、テキストとバイナリが混在するなど、複雑なフォーマットとなっており、そのままでは、データ構造の解析が難しい。また、PDFファイルは、文書ページ中のオブジェクト(テキスト、画像など)と、当該オブジェクトがページ中のどこに存在するかを示す座標情報によって構成されており、各オブジェクトが、どのようなデータかを示す情報は、埋め込まれていない。例えば、文書ページ中のテキストが、文書の本文なのか、それとも、表データなのかといった情報は、PDFファイルには埋め込まれておらず、これに複雑なフォーマットであることも加わり、PDFファイルでは、文書中のデータの識別と抽出が難しい。 A PDF file has a complicated format such as a mixture of text and binary, and it is difficult to analyze the data structure as it is. In addition, a PDF file consists of objects (text, images, etc.) in the document page and coordinate information that indicates where the object exists in the page, and indicates what kind of data each object is. Information is not embedded. For example, information such as whether the text in the document page is the text of the document or table data is not embedded in the PDF file. Difficulty identifying and extracting data in documents.

従来技術として、PDFファイルのテキストデータを、データ構造の解析が容易なフォーマットに変換したうえで、表データの抽出処理を行う方式がある。PDFファイルからの表データの抽出は、表の検出、レイアウト認識、および表中テキストの抽出によって行われる。表の検出は、PDFファイルの文書ページから表を検出すること、レイアウト認識は、表の各セルが、どの行、列に属するかを認識する処理である。表中テキストの抽出は、検出した表内のテキストを抽出する処理である。抽出したテキストは、元の表の構造(レイアウト)を再現したHTMLのテーブル表現や、DBのテーブルなどの形式で、ストレージ装置に保存する。 As a conventional technology, there is a method of converting the text data of the PDF file into a format that facilitates analysis of the data structure, and then extracting the table data. Extraction of tabular data from PDF files is done through table detection, layout recognition, and in-table text extraction. Table detection is to detect a table from document pages of a PDF file, and layout recognition is to recognize which row and column each cell of the table belongs to. The table text extraction is a process of extracting the detected text in the table. The extracted text is saved in a storage device in a format such as an HTML table representation that reproduces the structure (layout) of the original table, or a DB table.

従来技術の一つは、PDFファイルを画像ファイルに変換し、データ構造の解析を行う方式である。表の罫線などの画像情報(表の罫線など)を解析し、表の検出および表レイアウトの認識を行う。表中テキストの抽出は、OCR(Optical Character Recognition/Reader)によって行う。特許文献1では、表を画像データとして抽出し、画像解析によって表データを抽出する技術が示されている。 One of the conventional techniques is a method of converting a PDF file into an image file and analyzing the data structure. Analyze image information such as table ruled lines (table ruled lines, etc.) to detect tables and recognize table layouts. The text in the table is extracted by OCR (Optical Character Recognition/Reader). Patent Document 1 discloses a technique of extracting a table as image data and extracting the table data by image analysis.

もう一つは、PDFファイルを座標情報付きのテキストファイルに変換し、データ構造の解析を行う方式である。PDFMiner(https://github.com/euske/pdfminer/)等のテキスト抽出ツールを用いると、PDF文書中のテキストに対して、ページ内での座標を付与したテキストファイルを得ることができる。座標は、ある程度まとまった単位(単位ごと、文章ごと、など)で付与される。座標情報付きのテキストを解析し、テキスト間の位置関係を解析することで、表データの検出とレイアウト認識を行う。例として、非特許文献1などが挙げられる。 Another method is to convert the PDF file into a text file with coordinate information and analyze the data structure. By using a text extraction tool such as PDFMiner (https://github.com/euske/pdfminer/), it is possible to obtain a text file with the coordinates within the page assigned to the text in the PDF document. Coordinates are given in a certain unit (per unit, per sentence, etc.). By analyzing the text with coordinate information and analyzing the positional relationship between the texts, table data detection and layout recognition are performed. Non-Patent Document 1 and the like can be cited as an example.

US20150093021A1US20150093021A1

Martha et.al., “TAO: System for Table Detection and Extraction from PDF Documents”, FLAIRS Conference, 2016Martha et.al., “TAO: System for Table Detection and Extraction from PDF Documents”, FLAIRS Conference, 2016

特許文献1の画像解析によって表データ抽出を行う方式では、ページ中の表ではないオブジェクトを表と誤検出してしまう問題がある。また、表のレイアウト認識において、横方向の罫線しか含まない表など、画像情報が不足している表では、表のレイアウトを正確に認識出来ない問題がある。また、表中テキストの抽出において、OCRのテキスト誤認識が発生する問題がある。 The method of extracting tabular data by image analysis disclosed in Patent Document 1 has a problem of erroneously detecting an object that is not a table on a page as a table. Further, in recognizing the layout of a table, there is a problem that the layout of the table cannot be accurately recognized for a table lacking image information, such as a table containing only horizontal ruled lines. In addition, there is a problem that misrecognition of OCR text occurs when extracting text in a table.

一方、非特許文献1の座標情報付きテキストを解析し、表データ抽出を行う方式では、表の罫線などの画像情報を用いることができないため、表の検出において、表の範囲を正しく認識することが、難しい問題がある。 On the other hand, in the method of analyzing the text with coordinate information of Non-Patent Document 1 and extracting the table data, it is not possible to use image information such as the ruled lines of the table. However, there is a difficult problem.

そこで本願発明の課題は、デジタル文書を対象とした、データ分析の質を向上することにある。 Accordingly, an object of the present invention is to improve the quality of data analysis for digital documents.

本発明の好ましい一側面は、文書ページ中のオブジェクトと当該オブジェクトの座標情報を含むデジタル文書を、画像データと座標情報付きのテキストデータに変換する変換処理部と、テキストデータから、抽出したいオブジェクトに関連するキャプションを抽出するテキストデータ解析部と、画像データから、抽出したキャプションの情報に基づいて、抽出したいオブジェクトの検出を実行する画像解析部と、を備えるデジタル文書からのデータ抽出システムである。 A preferred aspect of the present invention includes a conversion processing unit that converts a digital document containing an object in a document page and coordinate information of the object into image data and text data with coordinate information, and an object to be extracted from the text data. A data extraction system from a digital document comprising a text data analysis unit for extracting associated captions and an image analysis unit for detecting objects to be extracted from image data based on the extracted caption information.

本発明の好ましい他の一側面は、デジタル文書から所望のオブジェクトを抽出する、デジタル文書からのデータ抽出方法であって、デジタル文書から座標情報付きのテキストデータを生成する、テキストデータ生成処理、キーワード検索により、テキストデータから所望のオブジェクトのキャプションを検出する、キャプション検出処理、キャプションが検出されたデジタル文書の頁の画像データから、所望のオブジェクトを抽出する、オブジェクト抽出処理、を備える、デジタル文書からのデータ抽出方法である。 Another preferred aspect of the present invention is a method for extracting data from a digital document for extracting a desired object from the digital document, comprising text data generation processing for generating text data with coordinate information from the digital document, keywords From a digital document comprising: a caption detection process for detecting a caption of a desired object from text data by searching; and an object extraction process for extracting a desired object from image data of a page of the digital document where the caption is detected data extraction method.

デジタル文書を対象とした、データ分析の質が向上する。上記した以外のさらに具体的な課題、構成、及び効果は、以下の実施形態の説明により明らかにされる。 Improve the quality of data analysis for digital documents. Further specific problems, configurations, and effects other than those described above will be clarified by the following description of the embodiments.

実施例に係るデータ抽出装置のハードウェア構成を示すブロック図。1 is a block diagram showing the hardware configuration of a data extraction device according to an embodiment; FIG. 実施例に係るデータ抽出プログラムの論理構成を示す論理ブロック図。3 is a logical block diagram showing the logical configuration of the data extraction program according to the embodiment; FIG. 表のキャプションを検出する際の処理を示す流れ図。FIG. 4 is a flow diagram showing the process when detecting captions for tables; FIG. PDFファイルを座標情報付きのテキストファイルに変換した際の、座標情報付きテキストファイルの例を示す表図。Table diagram showing an example of a text file with coordinate information when converting a PDF file into a text file with coordinate information. 表のキャプションを検出する際、表のキャプションと本文を区別するために用いる文章パターンの例を示す表図。FIG. 10 is a table diagram showing an example of a text pattern used to distinguish between a table caption and a text when detecting a table caption. 画像解析部に送られる表のキャプションの検出結果の例を示す表図。FIG. 11 is a table diagram showing an example of a table caption detection result sent to the image analysis unit; 表の検出および、レイアウト認識を実行する際の処理を示すフロー図。FIG. 4 is a flow diagram showing processing when detecting a table and performing layout recognition; 表の検出を実行する際、どのように画像解析を行う範囲を限定するかを示す説明図。FIG. 4 is an explanatory diagram showing how to limit the range of image analysis when detecting a table; 罫線によってセルが格子状に表現されている表のレイアウト認識を実行する際の処理を示すフロー図。FIG. 10 is a flow diagram showing processing when layout recognition is executed for a table in which cells are represented in a grid pattern by ruled lines; 罫線情報が不足している表のレイアウト認識を実行する際の処理を示すフロー図。FIG. 10 is a flowchart showing processing when executing layout recognition of a table lacking ruled line information; 結合セルを含み、かつ、罫線情報が不足している表の行・列の認識を実行する際の処理を示すフロー図。FIG. 10 is a flowchart showing processing when recognizing rows and columns of a table that includes merged cells and lacks ruled line information; ヒストグラム解析を行なう表の例を示す表図。FIG. 4 is a table diagram showing an example of a table for histogram analysis; ヒストグラム解析により、セルの認識を行った結果の例を示す表図。FIG. 10 is a chart showing an example of results of cell recognition performed by histogram analysis; 表のレイアウト認識において、正しくレイアウトを認識した場合の例を示す説明図。FIG. 10 is an explanatory diagram showing an example of correct layout recognition in table layout recognition; 表のレイアウト認識において、誤ってレイアウトを認識した場合の例を示す説明図。FIG. 11 is an explanatory diagram showing an example of a case where a layout is recognized erroneously in layout recognition of a table; 座標情報テキストファイル内に存在するPDF文書の本文を解析し、表のレイアウト認識を行う方法を示す説明図。FIG. 4 is an explanatory diagram showing a method of analyzing the text of a PDF document that exists in a coordinate information text file and recognizing the layout of a table. データ抽出プログラムが抽出する表の座標情報の構造を示す表図。FIG. 4 is a table diagram showing the structure of coordinate information of a table extracted by a data extraction program; データ抽出プログラムが、表中のテキストを抽出し、出力する処理を示すフロー図。FIG. 4 is a flow diagram showing the process of extracting and outputting text in a table by a data extraction program; データ抽出プログラムが、表データを出力する形式の例を示す説明図。Explanatory drawing which shows the example of the format which a data extraction program outputs tabular data. データ抽出プログラムが、抽出した表データの性質を示す情報を、座標情報付きのテキストファイルから抽出する処理を示すフロー図。FIG. 4 is a flow diagram showing a process of extracting information indicating properties of extracted table data from a text file with coordinate information by a data extraction program. 抽出した表データの性質を示す情報を、座標情報付きのテキストファイルから抽出ために用いる、文章パターンの例を示す表図。FIG. 10 is a chart showing an example of a text pattern used for extracting information indicating properties of extracted table data from a text file with coordinate information; 抽出したグラフデータの性質を示す情報を、座標情報付きのテキストファイルから抽出するために用いる、文章パターンの例を示す表図。FIG. 4 is a chart showing an example of sentence patterns used for extracting information indicating properties of extracted graph data from a text file with coordinate information; データ抽出プログラムが、グラフの検出と出力を実行する際の処理を示すフロー図。FIG. 4 is a flow chart showing the processing when the data extraction program executes graph detection and output.

以下では、本発明の実施例を、図面を参照して説明する。なお、以下に説明する実施例は特許請求の範囲にかかる発明を限定するものではなく、また実施例で説明されている諸要素及びその組み合わせの全てが発明の解決手段に必須であるとは限らない。 Embodiments of the invention are described below with reference to the drawings. It should be noted that the embodiments described below do not limit the claimed invention, and not all of the elements and combinations thereof described in the embodiments are essential to the solution of the invention. do not have.

以下に説明する発明の構成において、同一部分又は同様な機能を有する部分には同一の符号を異なる図面間で共通して用い、重複する説明は省略することがある。 In the configuration of the invention described below, the same reference numerals may be used in common for the same parts or parts having similar functions between different drawings, and redundant description may be omitted.

同一あるいは同様な機能を有する要素が複数ある場合には、同一の符号に異なる添字を付して説明する場合がある。ただし、複数の要素を区別する必要がない場合には、添字を省略して説明する場合がある。 When there are a plurality of elements having the same or similar functions, they may be described with the same reference numerals and different suffixes. However, if there is no need to distinguish between multiple elements, the subscripts may be omitted.

本明細書等における「第1」、「第2」、「第3」などの表記は、構成要素を識別するために付するものであり、必ずしも、数、順序、もしくはその内容を限定するものではない。また、構成要素の識別のための番号は文脈毎に用いられ、一つの文脈で用いた番号が、他の文脈で必ずしも同一の構成を示すとは限らない。また、ある番号で識別された構成要素が、他の番号で識別された構成要素の機能を兼ねることを妨げるものではない。 Notations such as “first”, “second”, “third” in this specification etc. are attached to identify the constituent elements, and do not necessarily limit the number, order, or content thereof isn't it. Also, numbers for identifying components are used for each context, and numbers used in one context do not necessarily indicate the same configuration in other contexts. Also, it does not preclude a component identified by a certain number from having the function of a component identified by another number.

図面等において示す各構成の位置、大きさ、形状、範囲などは、発明の理解を容易にするため、実際の位置、大きさ、形状、範囲などを表していない場合がある。このため、本発明は、必ずしも、図面等に開示された位置、大きさ、形状、範囲などに限定されない。 The position, size, shape, range, etc. of each configuration shown in the drawings, etc. may not represent the actual position, size, shape, range, etc., in order to facilitate understanding of the invention. Therefore, the present invention is not necessarily limited to the positions, sizes, shapes, ranges, etc. disclosed in the drawings and the like.

本明細書において単数形で表される構成要素は、特段文脈で明らかに示されない限り、複数形を含むものとする。 Elements presented herein in the singular shall include the plural unless the context clearly dictates otherwise.

なお、以下の説明では、「プログラム」を主語として処理を説明する場合があるが、プログラムは、プロセッサ(例えばCentral Processing Unit(CPU))によって実行されることで、定められた処理を、適宜に記憶資源(例えばメモリ)及び/又は通信インターフェースデバイス(例えばポート)を用いながら行うため、処理の主語がプログラムとされても良い。プログラムを主語として説明された処理は、プロセッサ或いはそのプロセッサを有する計算機が行う処理としても良い。 In the following explanation, the processing may be explained with the subject of "program", but the program is executed by a processor (e.g. Central Processing Unit (CPU)) to appropriately perform the specified processing. The subject of processing may be a program because it is performed using storage resources (eg, memory) and/or communication interface devices (eg, ports). A process described using a program as a subject may be a process performed by a processor or a computer having the processor.

以下で詳細に説明される実施例は、デジタル文書から表やグラフ等の所望のオブジェクトを抽出するものであり、その概要を以下に述べる。一つの実施例のシステムでは、PDFファイルを座標情報付きのテキストファイルに変換し、座標情報付きのテキストファイルから表のキャプションを検出する。そして、キャプションを検出したPDFファイルの文書ページを、画像ファイルに変換する。次に、画像ファイルに変換したページに対して、画像解析を行い、表を検出する。この際、表キャプションの座標をもとに、画像解析を実施する画像の範囲を限定する。表のキャプションの座標は、座標情報付きのテキストファイルから取得する。 The embodiments detailed below extract desired objects such as tables and graphs from digital documents, and are summarized below. In one embodiment, the system converts a PDF file to a text file with coordinate information and detects table captions from the text file with coordinate information. Then, the document page of the PDF file in which the caption is detected is converted into an image file. Next, image analysis is performed on the page converted into the image file to detect a table. At this time, the range of the image for which the image analysis is performed is limited based on the coordinates of the table caption. Coordinates for table captions are obtained from a text file with coordinate information.

なお、実施例ではPDFを例に説明しているが、文書ページ中のオブジェクト(テキスト、画像など)と、当該オブジェクトの座標情報を含んでいるデジタル文書であれば、これに限るものではない。このようなデジタル文書からは、座標情報付きのテキストファイルや画像ファイルを容易に生成することができる。 Although PDF is used as an example in the embodiment, any digital document containing objects (text, images, etc.) in document pages and coordinate information of the objects can be used. A text file or an image file with coordinate information can be easily generated from such a digital document.

表キャプションを含むページにのみ画像解析を行うことで、表を含まないページから、表でないものを表として検出してしまう表の誤検出を回避することができる。また、表のキャプションの位置から画像解析の範囲を限定することで、画像解析においてノイズとなる情報を減らし、表でないものを表として認識してしまう表の誤検出が発生する可能性を低減することができる。また、表の検出を画像解析によって行う事で、表の検出において罫線等の情報も利用することができ、表の範囲を正確に認識することができる。なお、表とは一般には、文字や数字などのデータを、縦横の罫線で格子状に区切ったセルに記述して表したものであるが、罫線の一部または全部が省略される場合もある。また、セルが部分的に結合したり分離したりすることもある。 By performing image analysis only on pages that include table captions, it is possible to avoid erroneous detection of a table that is not a table from a page that does not include a table. In addition, by limiting the range of image analysis from the position of the caption of the table, the information that becomes noise in image analysis is reduced, and the possibility of misdetection of a table that is not a table but is recognized as a table is reduced. be able to. Further, by performing table detection by image analysis, information such as ruled lines can be used in table detection, and the range of the table can be accurately recognized. In general, a table is a representation of data such as letters and numbers in cells separated by vertical and horizontal ruled lines in a grid pattern, but some or all of the ruled lines may be omitted. . Also, cells may be partially merged or separated.

画像解析により検出した表に対して、レイアウト認識を実施する。この際、横方向の罫線しか含まない表など、画像情報が不足している表では、座標情報付きのテキストファイルから、表の構造を説明する本文を抽出し、表のレイアウトの推測に利用できる。これにより、表のレイアウトを正確に認識することが可能となる。 Layout recognition is performed on the table detected by image analysis. At this time, for tables that lack image information, such as tables that contain only horizontal ruled lines, text that explains the structure of the table can be extracted from a text file with coordinate information and used to estimate the layout of the table. . This makes it possible to accurately recognize the layout of the table.

画像解析によって検出・レイアウト認識を実行した表の各セルの座標情報を抽出する。この座標情報と、座標情報付きテキストファイルの内容を照合し、各セルのテキストを座標情報付きテキストファイルから抽出する。これにより、OCRによるテキストの誤認識を回避することができる。また、座標情報付きテキストファイルと予め定義した文章パターンを照合し、表の内容を説明する本文を、表データの性質を示す情報として抽出することができる。 Extract the coordinate information of each cell of the table for which detection and layout recognition are performed by image analysis. This coordinate information is collated with the contents of the text file with coordinate information, and the text of each cell is extracted from the text file with coordinate information. This makes it possible to avoid erroneous recognition of text by OCR. Also, a text file with coordinate information and a predefined sentence pattern can be compared to extract the text explaining the contents of the table as information indicating the properties of the table data.

他の実施例では、PDFファイルを座標情報付きのテキストファイルに変換し、座標情報付きのテキストファイルからグラフのキャプションを検出する。そして、キャプションを検出したPDFファイルの文書ページを、画像ファイルに変換する。次に、画像ファイルに変換したページに対して、画像解析を行い、グラフを検出する。この際、グラフキャプションの座標をもとに、画像解析を実施する画像の範囲を限定する。グラフキャプションの座標は、座標情報付きのテキストファイルから取得する。グラフキャプションを含むページにのみ画像解析を行うことで、グラフを含まないページから、グラフでないものをグラフとして検出してしまうグラフの誤検出を回避することができる。また、グラフのキャプションの位置から画像解析の範囲を限定することで、画像解析においてノイズとなる情報を減らし、グラフでないものをグラフと検出してしまうなど、グラフの誤検出が発生する可能性を低減することができる。なお、グラフとは一般に、互いに関係のある二つ以上の数量の関係を図として示したものである。 In another embodiment, the PDF file is converted to a text file with coordinate information, and the caption of the graph is detected from the text file with coordinate information. Then, the document page of the PDF file in which the caption is detected is converted into an image file. Next, image analysis is performed on the page converted into the image file to detect the graph. At this time, the range of the image for which the image analysis is performed is limited based on the coordinates of the graph caption. Coordinates for graph captions are obtained from a text file with coordinate information. By performing image analysis only on pages that include graph captions, it is possible to avoid erroneous detection of graphs that are not graphs but are detected as graphs from pages that do not include graphs. In addition, by limiting the range of image analysis from the position of the caption of the graph, the information that becomes noise in image analysis is reduced, and the possibility of misdetection of graphs, such as detecting things that are not graphs as graphs, is reduced. can be reduced. A graph is generally a diagram showing the relationship between two or more mutually related quantities.

また、座標情報付きテキストファイルと予め定義した文章パターンを照合し、座標情報付きテキストファイルから、グラフの内容を説明する本文を、グラフデータの情報を示す情報として抽出することができる。 Also, the text file with coordinate information and a predefined sentence pattern can be compared, and the text explaining the contents of the graph can be extracted from the text file with coordinate information as information indicating the information of the graph data.

図1を用いて、実施例1に係るデータ抽出装置の計算機システムの概要を説明する。図1は、実施例に係る計算機システムのハードウェア構成を示す。データ抽出装置100はデータ抽出プログラムを実行し、PDFファイルから、表データを抽出する。CPU102は、バス101を介して主記憶装置であるメモリ103と接続しており、メモリ103上のデータ抽出プログラムを実行する。 The outline of the computer system of the data extraction device according to the first embodiment will be described with reference to FIG. FIG. 1 shows the hardware configuration of a computer system according to an embodiment. The data extraction device 100 executes a data extraction program to extract tabular data from the PDF file. A CPU 102 is connected to a memory 103 as a main storage device via a bus 101 and executes a data extraction program on the memory 103 .

CPU102およびメモリ103は、バス101を介して、二次記憶装置であるディスク装置104と接続している。CPU102上で実行されるデータ抽出プログラムは、ディスク装置104に格納されているPDFファイルをメモリ103上に読みこんだり、ディスク装置104に格納されているPDFファイルにデータを書き込んだりすることができる。 CPU 102 and memory 103 are connected via bus 101 to disk device 104, which is a secondary storage device. A data extraction program executed on the CPU 102 can read a PDF file stored in the disk device 104 into the memory 103 and write data to the PDF file stored in the disk device 104.例文帳に追加

以上のハードウェア構成は、一般的なサーバで構成することができる。図示はしていないが、一般的なサーバが備える各種の入力装置や出力装置を備えていても良い。以上のハードウェア構成は、単体のサーバで構成してもよいし、あるいは、入力装置、出力装置、CPU、ディスク装置の任意の部分が、ネットワークで接続された他のサーバで構成されてもよい。また、本実施例中、ソフトウエアで構成した機能と同等の機能は、FPGA(Field Programmable Gate Array)、ASIC(Application Specific Integrated Circuit)などのハードウェアでも実現できる。 The above hardware configuration can be configured with a general server. Although not shown, various input devices and output devices that are provided in general servers may be provided. The above hardware configuration may be composed of a single server, or any part of the input device, output device, CPU, and disk device may be composed of other servers connected by a network. . Further, in the present embodiment, functions equivalent to those configured by software can be realized by hardware such as FPGA (Field Programmable Gate Array) and ASIC (Application Specific Integrated Circuit).

なお、本実施例では、対象のファイルとしてPDFファイルを例とするが、文書ページ中のオブジェクト(テキスト、画像など)と、当該オブジェクトがページ中のどこに存在するかを示す座標情報を含んでいれば、他の形式のデジタル文書であってもよい。 In this embodiment, a PDF file is used as an example of a target file. However, any object (text, image, etc.) in a document page and coordinate information indicating where the object exists in the page are included. For example, it may be a digital document in any other format.

図2は、実施例1に係るデータ抽出プログラム200の機能ブロック構成を示す。変換処理部201は、ディスク装置104に格納されているPDFファイルを読み込み、座標情報付きのテキストファイルに変換する。また、ディスク装置104に格納されているPDFファイルを読み込み、画像ファイルに変換する。 FIG. 2 shows a functional block configuration of a data extraction program 200 according to the first embodiment. A conversion processing unit 201 reads a PDF file stored in the disk device 104 and converts it into a text file with coordinate information. Also, the PDF file stored in the disk device 104 is read and converted into an image file.

テキストデータ解析部202は、座標情報付きのテキストファイルを解析し、表キャプションを抽出する。また、座標情報付きのテキストファイルを解析して、表の構造を説明する本文と、表の性質を示す本文を抽出する。ここで、キャプションとは写真・図版・表・グラフなどに付される表題やタイトルをいい、実施例1では表に付されるキャプション(例えば「表1:○○○のデータ」)を抽出する。 A text data analysis unit 202 analyzes a text file with coordinate information and extracts table captions. Also, the text file with coordinate information is analyzed to extract the text describing the structure of the table and the text indicating the properties of the table. Here, the caption refers to a title or title attached to a photograph, illustration, table, graph, etc. In Example 1, the caption attached to the table (for example, "Table 1: Data of ○○○") is extracted. .

画像解析部203は、テキストデータ解析部202から受け取った表キャプションの情報をもとに画像ファイルを解析し、表の検出を行う。また、テキストデータ解析部202が座標情報付きテキストファイルを解析して得た表の構造を説明する本文をもとに、表のレイアウト認識を実行する。そして、表の座標情報を抽出する。 The image analysis unit 203 analyzes the image file based on the table caption information received from the text data analysis unit 202 to detect the table. Also, the text data analysis unit 202 analyzes the text file with coordinate information, and based on the text explaining the structure of the table, the table layout is recognized. Then, the table coordinate information is extracted.

データ格納部204は、画像解析部203が抽出した表の座標情報と、座標情報付きテキストファイルを照合し、表中テキストの抽出をおこなう。そして、抽出したテキストを、ファイルやDBのテーブルとして出力する。 The data storage unit 204 collates the table coordinate information extracted by the image analysis unit 203 with the text file with coordinate information, and extracts the text in the table. Then, output the extracted text as a file or DB table.

図3は実施例1に係るデータ抽出プログラム200が、表データの抽出を行う一連の処理において、表キャプションを抽出する処理300を示す。まず、変換処理部201が、表データを抽出するPDFファイルを座標情報付きのテキストファイルに変換する(処理310)。 FIG. 3 shows a process 300 for extracting table captions in a series of processes for extracting table data by the data extraction program 200 according to the first embodiment. First, the conversion processing unit 201 converts a PDF file from which table data is to be extracted into a text file with coordinate information (process 310).

図4のファイル400は、座標情報付きのテキストファイルの例を示している。図4に示すように、変換したPDFファイルの文書ページごとにタグを付与し、メタ情報として、ページの横方向・縦方向の大きさ(ページサイズ)と、ページ番号を付与する。また、文書ページ中の各テキストに対し、タグを付与し、メタ情報として、テキストの座標情報を付与する。図4の例では、テキストの左上部の横座標・縦座標と、テキストの幅と高さを、座標情報として付与している。例では、ページごとにPAGEタグを、テキストごとにTOKENタグを付与しているが、タグ名は別のものでも良い。座標情報付きテキストファイルへの変換は、PDFMiner等の、既存のテキスト抽出ツールを用いることで、実行する事ができるし、独自の変換処理を開発して組み込んでもよい。 A file 400 in FIG. 4 shows an example of a text file with coordinate information. As shown in FIG. 4, a tag is attached to each document page of the converted PDF file, and the size of the page in the horizontal and vertical directions (page size) and the page number are added as meta information. Also, each text in the document page is tagged, and the coordinate information of the text is added as meta information. In the example of FIG. 4, the horizontal and vertical coordinates of the upper left portion of the text and the width and height of the text are provided as coordinate information. In the example, a PAGE tag is given to each page and a TOKEN tag is given to each text, but the tag names may be different. Conversion to a text file with coordinate information can be executed by using an existing text extraction tool such as PDFMiner, or you can develop your own conversion process and incorporate it.

次に、テキストデータ解析部202が、座標情報付きのテキストファイルから、表のキャプションの抽出を行う。まず、座標情報付きのテキストファイルに対し、「表」、「Table」といった、表のキャプションに含まれそうなキーワードを含むテキストを検索する処理を行う(処理311)。検索は、TOKENタグを付与されたテキストに対して行う。キーワードを含むテキストを検出したら、それを抽出する。 Next, the text data analysis unit 202 extracts the caption of the table from the text file with coordinate information. First, the text file with coordinate information is searched for text containing keywords such as "table" and "table" that are likely to be included in the caption of the table (process 311). Search is performed on the text given the TOKEN tag. If you find text containing keywords, extract it.

次に、座標情報付きテキストファイルの座標情報をもとに、キーワードを含むテキストの周囲のテキストも抽出する(処理312)。テキストを抽出する範囲は、予め設定しておく。そして、抽出したテキスト全体を、予め設定した文章パターンと照合する(処理313)。 Next, based on the coordinate information in the text file with coordinate information, the text around the text containing the keyword is also extracted (process 312). The range for extracting text is set in advance. Then, the entire extracted text is compared with a preset sentence pattern (process 313).

図5Aは、抽出したテキストと照合するために、予め設定した文章パターンを格納したテーブルの例である。これらの文章は、本文中で表などを引用したり参照したりする際に用いられる表現であり、これらの文章が表のキャプションとして用いられる可能性は小さい。テーブル500に示すような文章パターンは事前に定義しておき、ディスク装置104等に格納しておく。 FIG. 5A is an example of a table storing preset sentence patterns for matching with extracted text. These sentences are expressions used when citing or referring to tables, etc. in the text, and there is little possibility that these sentences will be used as captions for tables. A sentence pattern as shown in the table 500 is defined in advance and stored in the disk device 104 or the like.

もし、テキスト全体が、「表○○は××を示す」(○○、××は任意の単語・文字)などといった、テーブル500に含まれる文章パターンのいずれかと一致する一連の文章になっていたら、キーワードを含むテキストを、表キャプションではないと判断する(処理314:No)。 If the entire text is a series of sentences that match any of the sentence patterns included in the table 500, such as "Table XX indicates XX" (XX and XX are arbitrary words/characters). If so, it is determined that the text containing the keyword is not a table caption (process 314: No).

もし、一連の文章になっていなければ、キーワードを含むテキストが、表キャプションであると判断し(処理314:Yes)、当該テキストを含むページのページ番号とページサイズ、当該テキスト、当該テキストの座標情報を、表キャプションの情報として抽出し、画像解析部203に送る(処理315)。処理312から処理315までの一連の処理は、キーワード検索によって得られたテキスト数だけ繰り返す(処理316)。 If it is not a series of sentences, the text containing the keyword is judged to be a table caption (process 314: Yes), the page number and page size of the page containing the text, the text, the coordinates of the text The information is extracted as table caption information and sent to the image analysis unit 203 (process 315). A series of processes from process 312 to process 315 are repeated by the number of texts obtained by keyword search (process 316).

図5Bのテーブル510は、画像解析部203に送られる表キャプションの情報の例を示す。ページごとにページ番号とページサイズを記録し、各ページについて、検出したキャプションと、その座標(座標情報付きテキストファイル上での座標)を記録する。 A table 510 in FIG. 5B shows an example of table caption information sent to the image analysis unit 203 . The page number and page size are recorded for each page, and the detected caption and its coordinates (coordinates on the text file with coordinate information) are recorded for each page.

図6は、データ抽出プログラム200が、表データの抽出を行う一連の処理において、表の検出・レイアウト認識を行う処理600を示す。表の検出・レイアウト認識処理600は、処理300において表キャプションが検出されたページそれぞれに対して、実行される。 FIG. 6 shows a process 600 in which the data extraction program 200 performs table detection and layout recognition in a series of processes for extracting table data. The table detection and layout recognition process 600 is performed for each page on which a table caption was detected in process 300 .

まず、画像解析部203が、テキストデータ解析部202が、処理300において作成したテーブル510を参照し、表キャプションを含むページのページ番号を確認する(処理610)。そして、PDFファイルの当該文書ページを、画像ファイルに変換する(処理611)。画像ファイルへの変換は、pdftoppm(https://www.xpdfreader.com/pdftoppm-man.html)等の、既存の画像変換ツールを用いることで、実行することができるし、独自の変換処理を開発して組み込んでもよい。 First, the image analysis unit 203 refers to the table 510 created by the text data analysis unit 202 in process 300, and confirms the page number of the page including the table caption (process 610). Then, the document page of the PDF file is converted into an image file (process 611). Conversion to an image file can be executed by using an existing image conversion tool such as pdftoppm (https://www.xpdfreader.com/pdftoppm-man.html), or a unique conversion process can be developed and incorporated.

次に、処理300においてテキストデータ解析部が抽出した表キャプションの座標情報(図5Bのテーブル510参照)を、画像ファイルの座標スケールに合わせる処理を行う(処理612)。画像ファイル上での当該文書ページのサイズをもとに、表キャプションの座標情報を、座標情報付きテキストファイル上での座標情報から、画像ファイル上での座標情報に変換する。変換は、以下の式で実行することができる。 Next, the table caption coordinate information (see table 510 in FIG. 5B) extracted by the text data analysis unit in process 300 is adjusted to the coordinate scale of the image file (process 612). Based on the size of the relevant document page on the image file, the coordinate information of the table caption is converted from the coordinate information on the text file with coordinate information to the coordinate information on the image file. The conversion can be performed with the following formula.


表キャプションの横座標(画像ファイル)=
表キャプションの横座標(テキストファイル)×(文書ページの横方向サイズ(画像ファイル)÷文書ページの横方向サイズ(テキストファイル))

表キャプションの縦座標(画像ファイル)=
表キャプションの縦座標(テキストファイル)×(文書ページの縦方向サイズ(画像ファイル)÷文書ページの縦方向サイズ(テキストファイル))

画像ファイル上での文書ページのサイズは、OpenCV(https://opencv.org)等の画像処理ライブラリによって取得することが出来る。

Table caption abscissa (image file) =
Abscissa of table caption (text file) x (horizontal size of document page (image file) / horizontal size of document page (text file))

Table caption ordinate (image file) =
Vertical coordinate of table caption (text file) x (Vertical size of document page (image file) / Vertical size of document page (text file))

The size of the document page on the image file can be obtained by image processing libraries such as OpenCV (https://opencv.org).

次に、画像解析部203は、表検出を実行する画像範囲を限定する処理を行う(処理613)。画像範囲の限定は、表キャプションの座標をもとに行う。なお、図6のフローでは、キャプションが抽出された頁のみを画像変換しているが、予め全ての頁を画像変換しておいてもよい。 Next, the image analysis unit 203 performs processing for limiting the image range for performing table detection (processing 613). The image range is limited based on the coordinates of the table caption. In the flow of FIG. 6, only the page from which the caption is extracted is image-converted, but all pages may be image-converted in advance.

図7は、画像解析部203が、表検出を実行する画像範囲を限定する際の例を示している。画像700では、表キャプションが、表の左上に配置されていることを前提として、表検出を実行する範囲を領域701に限定している。画像710では、表キャプションが、表の左上に配置されていることを前提として領域711と領域712に限定している。 FIG. 7 shows an example in which the image analysis unit 203 limits the image range for performing table detection. In image 700, the table detection is limited to area 701 on the premise that the table caption is located at the top left of the table. In the image 710, the table caption is limited to areas 711 and 712 on the premise that it is arranged at the top left of the table.

画像710に示すように、同一ページ中に複数の表キャプションが含まれる場合では、表キャプション同士の位置関係から、表検出を実行する画像範囲に、複数の表が含まれないように、画像範囲を限定する。 As shown in the image 710, when multiple table captions are included in the same page, the image range is adjusted so that the image range for which table detection is performed does not include multiple tables, due to the positional relationship between the table captions. limit.

例では、表キャプションが表の左上に存在することを前提としているが、表キャプションの位置は、文書ごとに異なっている。表検出を実行する画像範囲を限定する際は、表キャプションと表の位置関係を考慮して、画像範囲を限定する際の処理を変更する必要がある。 The example assumes that the table caption is in the upper left corner of the table, but the position of the table caption varies from document to document. When limiting the image range for table detection, it is necessary to consider the positional relationship between the table caption and the table and change the processing for limiting the image range.

この場合、例えばユーザが処理600の開始前に、表キャプションと表検出を実行する画像範囲の位置関係を指定するように構成してもよい。あるいは、処理613を省略して、表キャプションを含む頁全体を表検出を実行する画像範囲としてもよい。ただし、表キャプションと表検出を実行する画像範囲の位置関係を利用するほうが、処理量の低下と精度の向上が期待できる。 In this case, for example, the user may specify the positional relationship between the table caption and the image range for which table detection is to be performed before the process 600 starts. Alternatively, the process 613 may be omitted and the entire page including the table caption may be the image range for table detection. However, using the positional relationship between the table caption and the image range in which table detection is performed can be expected to reduce the amount of processing and improve accuracy.

次に、画像解析部203は、処理613で限定した画像範囲から、表検出を実行する(処理614)。表検出はどのような方法を用いても良い。例えば、画像処理ライブラリ等を用いて矩形検出を行い、検出した矩形を表として検出する方法がある。また、画像処理ライブラリ等を用いて直線検出を行い、縦方向の座標上で最も上位にある直線と、最も下位にある直線を、表の上辺と下辺として、上辺、下辺に囲まれている範囲を、表として検出してもよい。 Next, the image analysis unit 203 executes table detection from the image range limited in process 613 (process 614). Any method may be used for table detection. For example, there is a method of detecting rectangles using an image processing library or the like and detecting the detected rectangles as a table. In addition, straight lines are detected using an image processing library, etc., and the highest and lowest straight lines in the vertical coordinate are taken as the upper and lower sides of the table, and the range surrounded by the upper and lower sides may be detected as a table.

次に、画像解析部203は、処理614で検出した表のレイアウト認識を実行する(処理615)。この処理は、処理614で認識した表それぞれに実行される。表のレイアウト認識は、どのような方法を用いてもよい。 Next, the image analysis unit 203 executes layout recognition of the table detected in process 614 (process 615). This process is performed for each table identified in process 614 . Any method may be used for table layout recognition.

図8Aは表レイアウト認識処理の一例の流れ図である。例えば、図8Aの処理615Aは、表の各セルの範囲が、縦方向・横方向の罫線で表現されている表の、レイアウト認識の例を示している。 FIG. 8A is a flowchart of an example of table layout recognition processing. For example, process 615A in FIG. 8A shows an example of layout recognition of a table in which each cell range of the table is represented by vertical and horizontal ruled lines.

この例では、まず画像処理ライブラリ等を用いて、処理614で検出した表の範囲に対して、矩形検出処理を実行する(処理8110)。そして、検出した各矩形を、表の各セルとして認識する。そして、各セルの座標情報、例えば、表の左上の点の横座標・縦座標、セルの幅、高さを、画像処理ライブラリ等を用いて抽出する(処理8111)。そして、この座標情報をもとに、セルごとに、縦方向・横方向で、それぞれ隣接するセルを判定し、同一列、同一行に属するセルを認識する(処理8112)。以上の処理は、画像解析部203が画像解析により実行する。 In this example, first, using an image processing library or the like, rectangle detection processing is executed for the range of the table detected in processing 614 (processing 8110). Then, each detected rectangle is recognized as each cell of the table. Then, the coordinate information of each cell, for example, the abscissa and ordinate of the upper left point of the table, and the cell width and height are extracted using an image processing library or the like (process 8111). Then, based on this coordinate information, cells adjacent to each other in the vertical and horizontal directions are determined for each cell, and cells belonging to the same column and the same row are recognized (process 8112). The above processing is executed by the image analysis unit 203 through image analysis.

図8Bの処理615Bは、横方向の罫線のみを含む表のレイアウト認識の例を示している。
図8Cは、処理615Bのうちの処理8212の詳細を示す流れ図である。
処理615Bの例では、画像解析部203は、まず画像処理ライブラリ等を用いて、処理614で検出した表の範囲に対してヒストグラム解析を行う(処理8210)。表画像の縦方向、横方向において、色を持つピクセルの数をカウントしていき、ヒストグラムを作成する。そして、ヒストグラムの谷の部分をセルのバウンダリとして、表の各セルを認識する。
Process 615B in FIG. 8B shows an example of layout recognition for a table containing only horizontal ruled lines.
FIG. 8C is a flow diagram showing details of operation 8212 of operation 615B.
In the example of process 615B, the image analysis unit 203 first uses an image processing library or the like to perform histogram analysis on the range of the table detected in process 614 (process 8210). A histogram is created by counting the number of colored pixels in the vertical and horizontal directions of the table image. Then, each cell of the table is recognized using the trough portion of the histogram as the boundary of the cell.

図9Aと図9Bは、横方向の罫線のみを含む表において、ヒストグラム解析によってセルを認識する際の例を示している。図9Aの表9110は、ヒストグラム解析を行う表の例を示し、図9Bの表9120は、表9110に対して、ヒストグラム解析を行った結果を示している。表9120において、点線で囲まれている領域を、セルと認識し、各セルの座標情報、例えば、表の左上の点の横座標・縦座標、セルの幅、高さを、画像処理ライブラリ等を用いて抽出する(処理8211)。 9A and 9B show an example of recognizing cells by histogram analysis in a table containing only horizontal ruled lines. A table 9110 in FIG. 9A shows an example of a table for histogram analysis, and a table 9120 in FIG. 9B shows the results of histogram analysis on the table 9110. FIG. In the table 9120, the area surrounded by the dotted line is recognized as a cell, and the coordinate information of each cell, for example, the abscissa and ordinate of the upper left point in the table, the width and height of the cell, and the image processing library etc. (process 8211).

次に、同一列・同一行に属するセルの認識を行う(処理8212)。図8Cは、横方向の罫線のみを含む表において、同一列・同一行に属するセルを認識する処理8212の詳細を示す。まず、各セルについて、他のセルとの座標距離を計算する(処理8310)。そして、縦方向にもっと近い距離のセル同士を同一列、横方向に最も近い距離のセル同士を同一行とする(処理8311)。しかし、これでは、行・列の認識を誤る可能性がある。 Next, cells belonging to the same column and same row are recognized (process 8212). FIG. 8C shows details of processing 8212 for recognizing cells belonging to the same column and same row in a table that includes only horizontal ruled lines. First, for each cell, the coordinate distance to other cells is calculated (process 8310). Cells that are closer in the vertical direction are placed in the same column, and cells that are closest in the horizontal direction are placed in the same row (process 8311). However, this may result in misrecognition of rows and columns.

図9Cの表9210は、表9110の列を正しく認識した場合を示している。列9213と列9214が結合セル9217に接続し、同一列9211として認識される。同様に、列9215と列9216が、結合セル9218に接続し、同一列9212として認識される。 Table 9210 in FIG. 9C shows a case where the columns of table 9110 are correctly recognized. Columns 9213 and 9214 connect to merged cell 9217 and are recognized as the same column 9211 . Similarly, columns 9215 and 9216 connect to merged cell 9218 and are recognized as the same column 9212 .

図9Dの表9220は、表9110の列を誤って認識した場合を示している。本来は、列9224が、結合セル9227に接続し、列9223と同様に、列9221に属するべきである。しかし、列9224が、列9225、列9226と結合セル9228によって接続し、同一列9222として認識されてしまっている。これは、セル9229に最も座標距離が近いセルが、結合セル9228と判定されてしまったことによる。 Table 9220 of FIG. 9D illustrates the case where columns of table 9110 are misrecognized. Originally, column 9224 should be connected to merged cell 9227 and belong to column 9221 like column 9223 . However, the column 9224 is connected to the columns 9225 and 9226 by the merged cell 9228 and is recognized as the same column 9222 . This is because the cell closest in coordinate distance to the cell 9229 has been determined to be the merged cell 9228 .

このような列・行の誤認識を修正するため、本実施例では、データ格納部204により、PDF文書の本文から、セルのレイアウトを推測する処理を行う。まず、各セル中のテキストを座標情報付きのテキストファイルから抽出する処理を行う(処理8312)。画像解析部203は、各セル中のテキストを座標情報付きのテキストファイルから抽出するため、各セルの座標情報を、画像ファイル上の座標情報から、座標情報付きのテキストファイル上での座標情報に変換する。変換は以下の式で行う。 In order to correct such erroneous recognition of columns and rows, in this embodiment, the data storage unit 204 performs a process of estimating the cell layout from the text of the PDF document. First, a process of extracting text in each cell from a text file with coordinate information is performed (process 8312). In order to extract the text in each cell from the text file with coordinate information, the image analysis unit 203 converts the coordinate information of each cell from the coordinate information on the image file to the coordinate information on the text file with coordinate information. Convert. Conversion is performed by the following formula.


セルの横座標(テキストファイル)=
セルの横座標(画像ファイル)×(文書ページの横方向サイズ(テキストファイル)÷文書ページの横方向サイズ(画像ファイル))

セルの縦座標(テキストファイル)=
セルの縦座標(画像ファイル)×(文書ページの縦方向サイズ(テキストファイル)÷文書ページの縦方向サイズ(画像ファイル))

セルの幅(テキストファイル)=
セルの幅(画像ファイル)×(文書ページの横方向サイズ(テキストファイル)÷文書ページの横方向サイズ(画像ファイル))

セルの高さ(テキストファイル)=
セルの高さ(画像ファイル)×(文書ページの横方向サイズ(テキストファイル)÷文書ページの横方向サイズ(画像ファイル))

Cell abscissa (text file) =
Horizontal coordinate of cell (image file) x (horizontal size of document page (text file) / horizontal size of document page (image file))

Cell ordinate (text file) =
Vertical coordinate of cell (image file) x (Vertical size of document page (text file) ÷ Vertical size of document page (image file))

cell width (text file) =
Cell width (image file) x (horizontal size of document page (text file) / horizontal size of document page (image file))

cell height (text file) =
Cell height (image file) x (horizontal size of document page (text file) / horizontal size of document page (image file))

データ格納部204では、この座標情報と、座標情報付きテキストファイル内の座標情報を照合し、座標上でセルの範囲内に存在するテキストを、セル中のテキストとして抽出する。ファイル400を例とすると、TOKENタグが付与されている各テキストの座標情報を参照し、当該テキストの中心座標を以下の式で求める。

中心座標(X, Y)=(横座標+(幅/2), 縦座標+(高さ/2))

この中心座標が、セルの座標範囲内に収まっていれば、当該テキストが当該セル中のテキストであると判定する。
The data storage unit 204 compares this coordinate information with the coordinate information in the text file with coordinate information, and extracts the text existing within the range of the cell on the coordinates as the text in the cell. Taking the file 400 as an example, the coordinate information of each text attached with the TOKEN tag is referred to, and the center coordinates of the text are obtained by the following formula.

Center coordinates (X, Y) = (abscissa + (width/2), ordinate + (height/2))

If the center coordinates are within the coordinate range of the cell, the text is determined to be the text in the cell.

次に、テキストデータ解析部202で、座標情報付きのテキストファイルから表の説明文を抽出、参照し(処理8313)、行・列の修正を行う(処理8314)。まず、座標情報付きのテキストファイルにおいてTOKENタグが付与されている全テキストを抽出し、各テキストの座標情報をもとに文章を形成する。これは、座標上で連続しているテキストを一連の文章として認識することで行う。そうして形成した文章に、表の構造を説明する文章パターンが含まれるかどうかを調べ、もし含まれていれば、その文章パターンが含まれている一文を、表の説明文と判定し、抽出する。 Next, the text data analysis unit 202 extracts and refers to the description of the table from the text file with the coordinate information (process 8313), and corrects the rows and columns (process 8314). First, extract all texts with TOKEN tags in a text file with coordinate information, and form sentences based on the coordinate information of each text. This is done by recognizing text that is continuous on coordinates as a series of sentences. Examine whether or not the sentence thus formed contains a sentence pattern explaining the structure of the table, and if so, determine a sentence containing the sentence pattern as an explanatory sentence of the table, Extract.

図9Eに、表の構造を説明する文章パターン9300の例を示す。文章パターン9300は、ディスク装置104等に予め記憶しておく。図の例では、文章パターンが1つだが、複数の文章パターンをあらかじめ用意しておき、いずれかの文章パターンが含まれれば、その一文を、表の説明文と判定しても良い。 FIG. 9E shows an example sentence pattern 9300 that describes the structure of a table. The sentence pattern 9300 is stored in advance in the disk device 104 or the like. In the example shown in the figure, there is one sentence pattern, but a plurality of sentence patterns may be prepared in advance, and if any sentence pattern is included, the sentence may be determined as the explanatory sentence of the table.

次に、表の説明文の解析を行う。図9Eの説明文9310は、表9110の説明文が、文章パターン9300によって抽出された例を示す。文章パターン9300では、「××」をセル中テキストに含むセルと、「△△」をセル中テキストに含むセルが、「○○」をセル中テキストに含む結合セルによって接続し、同一の列を形成することを示す。よって、説明文9310を参照することで、「Step」をセル中テキストに含む結合セルに、「Compound」をセル中テキストに含むセルと、「Yield」をセル中テキストに含むセルがそれぞれ接続することがわかる。 Next, the explanation of the table is analyzed. A descriptive text 9310 in FIG. 9E shows an example in which the descriptive text of the table 9110 is extracted by the text pattern 9300 . In the sentence pattern 9300, a cell containing "XX" in the cell text and a cell containing "△△" in the cell text are connected by a merged cell containing "○○" in the cell text, and are in the same column. to form Therefore, by referring to the descriptive text 9310, a merged cell containing "Step" in the cell text is connected to a cell containing "Compound" in the cell text and a cell containing "Yield" in the cell text. I understand.

処理8312で各セルに対応するテキストが抽出されているので、抽出した各セルのセル中テキストを参照すれば、説明文9310に基づいてセルの接続関係を推定することができる。たとえば、画像解析部によるセル間の座標距離をもとにした行・列の認識で、図9Dの表9220に示すように、結合セル9228とセル9229が同一列9222に属するというような誤認識が起きても、説明文9310とセル内テキストを照合することにより、説明文9310に基づくセルの接続関係と矛盾することが分かる。よって、図9Cの表9210に示すように、結合セル9217とセル9119が同一列9211を形成する、正しい列認識に修正することができる。 Since the text corresponding to each cell has been extracted in process 8312, the connection relationship of the cells can be estimated based on the description 9310 by referring to the extracted in-cell text of each cell. For example, in row/column recognition based on coordinate distances between cells by the image analysis unit, as shown in table 9220 in FIG. Even if , it can be found that it is inconsistent with the connection relation of the cell based on the description 9310 by comparing the description 9310 with the text in the cell. Thus, as shown in table 9210 of FIG. 9C, the correct column recognition can be corrected, with combined cell 9217 and cell 9119 forming the same column 9211. FIG.

表レイアウトの認識処理が終了したら、次に、表の座標情報の出力を行う(処理616)。 After completion of the table layout recognition process, the coordinate information of the table is output (process 616).

図10の座標情報1000は、表レイアウト認識処理515によってレイアウト認識した表の座標情報の出力例を示している。表を構成する各セルにユニークなIDを付与し、各セルの座標情報(座標情報1000の例では、セルの左上部の横座標、縦座標、セル幅、セルの高さ)を出力する。この座標情報は、画像ファイル上での座標情報である。また、各セルについて、表レイアウト認識処理によって認識した隣接セルのIDを出力する。隣接セルは、同一行と認識されたセル群において、最も横方向での座標距離が近いものと、同一列と認識されたセル群において、最も横方向での座標距離が近いものである。同一行の隣接セルは、左右それぞれ存在し、同一列の隣接セルは、上下それぞれ存在する。当該セルが結合セルの場合は、左右、上下、それぞれで、複数のセルと隣接する場合がある。また、抽出した表の座標情報1000には、テーブル510に記載された表のキャプションにおいて対応するものを付与する。座標情報1000は、画像解析部203から、データ格納部204に送られる。 Coordinate information 1000 in FIG. 10 shows an output example of table coordinate information whose layout is recognized by the table layout recognition processing 515 . A unique ID is assigned to each cell constituting the table, and coordinate information of each cell (in the example of coordinate information 1000, the abscissa, ordinate, cell width, and cell height of the upper left corner of the cell) is output. This coordinate information is coordinate information on the image file. Also, for each cell, the ID of the adjacent cell recognized by the table layout recognition process is output. Adjacent cells are those with the closest horizontal coordinate distance among the cells recognized as being on the same row, and those with the closest horizontal coordinate distance among the cells recognized as being on the same column. Adjacent cells on the same row exist on the left and right, and adjacent cells on the same column exist on the top and bottom. If the cell is a merged cell, it may be adjacent to multiple cells on the left, right, top and bottom. Further, the extracted coordinate information 1000 of the table is provided with the corresponding caption in the table 510 . The coordinate information 1000 is sent from the image analysis section 203 to the data storage section 204 .

処理614で検出された全ての表に対し、処理615と処理616を実行したら、表レイアウト認識処理を終了する(処理617:Yes)。そうで無ければ、引き続き、処理615と処理616を行う(処理617:No)。 After executing the processes 615 and 616 for all the tables detected in the process 614, the table layout recognition process is terminated (process 617: Yes). Otherwise, processing 615 and processing 616 are subsequently performed (processing 617: No).

表キャプションが検出された全てのページに対し、処理610から処理617までを実行したら、表検出・レイアウト認識処理を終了する(処理618:Yes)。そうで無ければ、引き続き、処理610から処理617を行う(処理618:No)。 After the processes 610 to 617 have been executed for all pages in which table captions have been detected, the table detection/layout recognition process ends (process 618: Yes). Otherwise, processing 610 to processing 617 are continuously performed (processing 618: No).

図11は実施例1に係るデータ抽出プログラム200が、表データの抽出を行う一連の処理において、表中テキストを抽出し、出力する処理を示す。この処理は、処理614で検出された表の数だけ行う。 FIG. 11 shows a process of extracting and outputting text in a table in a series of processes for extracting table data by the data extraction program 200 according to the first embodiment. This process is performed as many times as the number of tables detected in process 614 .

データ格納部204は、画像解析部203から受け取った表の座標情報1000をもとに、各セルについて、座標情報付きのテキストファイルから、セル中テキストの抽出を行う(処理1110)。テキストの抽出方法は、処理8312で示した方法と同様である。 Based on the table coordinate information 1000 received from the image analysis unit 203, the data storage unit 204 extracts the text in the cell from the text file with the coordinate information for each cell (process 1110). The text extraction method is the same as the method shown in process 8312 .

次に、抽出したテキストを、もとの表の構造を再現するデータに整形し、出力する(処理1111)。画像解析部203から受け取った表の座標情報から1000、各セルの隣接セルを認識して、もとの表の構造を再現して、データを出力する。出力形式は、HTMLのテーブル表現やDBのテーブル構造が考えられる。 Next, the extracted text is shaped into data that reproduces the structure of the original table, and is output (process 1111). Based on the table coordinate information received from the image analysis unit 203, the adjacent cells of each cell are recognized, the original table structure is reproduced, and the data is output. The output format can be HTML table representation or DB table structure.

図12のHTMLファイル1210は、表1200をHTMLのテーブル表現で表したものである。HTMLファイル1210に示すように、各セルに、thタグ、またはtdタグを付与する。そして、同一行のセルを、trタグで囲み、全体をtableタグで囲むで、表の構造を表現する。水平方向の結合セルを表現する場合は、HTMLファイル1210に示すように、colspan属性を付与し、列方向の結合セルを表現する場合は、rowspan属性を付与する。 The HTML file 1210 in FIG. 12 expresses the table 1200 in HTML table representation. As shown in the HTML file 1210, each cell is given a th tag or a td tag. Then, the cells in the same row are enclosed in tr tags, and the entire cell is enclosed in table tags to express the structure of the table. As shown in the HTML file 1210, a colspan attribute is added to represent horizontally merged cells, and a rowspan attribute is added to represent column-wise merged cells.

処理1110で抽出した各セルのテキストにthまたはtdタグを付与し、表の座標情報1000内に記録されている各セルの隣接セルを参照して、同一行のセルをtrタグで囲むことで、HTMLのテーブル表現で、抽出した表データを出力することができる。列方向に複数の隣接セルを持つ結合セルの場合は、colspan属性を付与し、行方向に複数の隣接セルを持つ結合セルの場合は、rowspan属性を付与する。 By adding a th or td tag to the text of each cell extracted in process 1110, referring to adjacent cells of each cell recorded in table coordinate information 1000, and enclosing cells in the same row with tr tags , can output the extracted tabular data in HTML table representation. Add the colspan attribute to merged cells that have multiple adjacent cells in the column direction, and add the rowspan attribute to merged cells that have multiple adjacent cells in the row direction.

出力形式は、必ずしもHTMLのテーブル表現である必要は無く、既に述べたように、DBのテーブル構造などでもよい。出力の際、表のキャプションをメタデータとして付与する。HTMLのテーブル表現として出力する場合は、tableタグの属性情報として表のキャプションを付与する方法などが考えられる。DBのテーブルの場合は、表のキャプションをテーブル名にしてしまう方法などが考えられる。出力したデータは、ファイルやDB等のかたちで、ディスク装置104上に保存する。 The output format does not necessarily have to be an HTML table representation, and as already mentioned, a DB table structure or the like may be used. When outputting, append the caption of the table as metadata. When outputting as an HTML table expression, a method such as adding a caption of the table as attribute information of the table tag can be considered. In the case of DB tables, a method such as setting the caption of the table to the table name can be considered. The output data is saved on the disk device 104 in the form of a file, DB, or the like.

図13は実施例1に係るデータ抽出プログラム200が、表データの抽出を行う一連の処理において、表データの性質を示す情報を抽出し、出力する処理を示す。 FIG. 13 shows a process in which the data extraction program 200 according to the first embodiment extracts and outputs information indicating properties of table data in a series of processes for extracting table data.

まず、テキストデータ解析部202が、座標情報付きのテキストファイルにおいてTOKENタグが付与されている全テキストを抽出し、各テキストの座標情報をもとに文章を形成する。これは、座標上で連続しているテキストを一連の文章として認識することで行う。そうして形成した文章に、表の性質を説明する文章パターンが含まれるかどうかを調べる(処理1310)。 First, the text data analysis unit 202 extracts all texts to which the TOKEN tag is attached in the text file with coordinate information, and forms sentences based on the coordinate information of each text. This is done by recognizing text that is continuous on coordinates as a series of sentences. It is checked whether the text thus formed contains a text pattern that explains the properties of the table (process 1310).

もし含まれていれば、その文章パターンが含まれている一文を、表の性質を示す情報として、抽出し、データ格納部に渡す。データ格納部は、渡された情報(テキスト)を、図11で出力した表データと関連付けて、ファイルやDB等のかたちでディスク装置104上に保存する(処理1311)。 If it is included, the sentence including the sentence pattern is extracted as information indicating the properties of the table and transferred to the data storage unit. The data storage unit associates the passed information (text) with the table data output in FIG. 11 and saves it in the form of a file, DB, or the like on the disk device 104 (process 1311).

図14は、表の性質を説明する本文を抽出する文章パターンの一例である、文章パターン1400を示す表図である。 FIG. 14 is a table diagram showing a sentence pattern 1400, which is an example of a sentence pattern for extracting a text explaining the properties of a table.

処理1111で出力した表データのメタデータである表キャプションを、処理1311で抽出した情報と照合することで、処理1111で出力した表データの性質を、データ分析時に、データ分析を実行するアプリケーションが、知ることができる。 By comparing the table caption, which is the metadata of the table data output in the process 1111, with the information extracted in the process 1311, the properties of the table data output in the process 1111 can be identified by the application executing the data analysis at the time of data analysis. , can be known.

実施例1では、デジタル文書中の表を抽出する例を示した。抽出するオブジェクトとしては表に限らず、グラフや図面等でもよい。実施例2では、デジタル文書中のグラフを抽出する例を説明する。 In Example 1, an example of extracting a table in a digital document was shown. Objects to be extracted are not limited to tables, and may be graphs, drawings, or the like. A second embodiment describes an example of extracting a graph from a digital document.

実施例2に係るデータ抽出装置の計算機システムの概要を説明する。実施例2に係る計算機システムのハードウェア構成は、図1と同様でよい。実施例2は、PDFファイルから、グラフデータを抽出する例であるため、データ抽出装置100はグラフ抽出のためのデータ抽出プログラムを実行し、PDFファイルからグラフデータを抽出する。 An overview of the computer system of the data extraction device according to the second embodiment will be described. The hardware configuration of the computer system according to the second embodiment may be the same as in FIG. Since the second embodiment is an example of extracting graph data from a PDF file, the data extraction device 100 executes a data extraction program for graph extraction and extracts graph data from the PDF file.

グラフ抽出のためにメモリ103に格納されるデータ抽出プログラム200の機能ブロック構成は、図2と同様でよい。ただし、各機能ブロック201~204が実行する具体的処理が実施例1と一部異なる。図2を参照して以下で説明する。 The functional block configuration of the data extraction program 200 stored in the memory 103 for graph extraction may be the same as in FIG. However, the specific processing executed by each functional block 201 to 204 is partly different from the first embodiment. Description is made below with reference to FIG.

変換処理部201は、ディスク装置104に格納されているPDFファイルを読み込み、座標情報付きのテキストファイルに変換する。また、ディスク装置104に格納されているPDFファイルを読み込み、画像ファイルに変換する。この処理は実施例1と同様でよい。 A conversion processing unit 201 reads a PDF file stored in the disk device 104 and converts it into a text file with coordinate information. Also, the PDF file stored in the disk device 104 is read and converted into an image file. This treatment may be the same as in the first embodiment.

テキストデータ解析部202は、座標情報付きのテキストファイルを解析し、グラフキャプションを抽出する。また、座標情報付きのテキストファイルを解析して、グラフの性質を示す本文を抽出する。 A text data analysis unit 202 analyzes a text file with coordinate information and extracts graph captions. It also analyzes the text file with the coordinate information and extracts the text that indicates the properties of the graph.

グラフキャプションを抽出する処理は、実施例1の図3に示すフローと同様であるが、キーワード検索処理311では、座標情報付きのテキストファイルに対し、「グラフ」、「Graph」といった、グラフのキャプションに含まれそうなキーワードを含むテキストを検索する処理を行う。また、文章パターンと照合する処理313では、図5Aに示す表を抽出するための文章パターンの代わりに、グラフを抽出するための文章パターンを用いる。具体例としては、「グラフ」や「Graph」の内容を説明する文章パターンである。 The process of extracting graph captions is the same as the flow shown in FIG. 3 of the first embodiment. Search for text containing keywords that are likely to be included in . Also, in the processing 313 for matching with a sentence pattern, a sentence pattern for extracting a graph is used instead of the sentence pattern for extracting the table shown in FIG. 5A. A specific example is a sentence pattern that describes the contents of a "graph" or "graph".

抽出されたキーワード周辺のテキストが、文章パターンの文章になっていなければ、キーワードを含むテキストが、グラフキャプションであると判断し、図5Bと同様の情報(ただし表に関するデータは、グラフに関するデータに置き換わる)を画像解析部203に送る(処理315)。処理312から処理315までの一連の処理は、キーワード検索によって得られたテキスト数だけ繰り返す(処理316)。 If the text around the extracted keyword does not form a sentence pattern, it is determined that the text containing the keyword is a graph caption, and the same information as in FIG. replaced) is sent to the image analysis unit 203 (process 315). A series of processes from process 312 to process 315 are repeated by the number of texts obtained by keyword search (process 316).

また、グラフの性質を示す本文を抽出する処理も、図13と同様であるが、図14に示す表の性質を示す本文を抽出するための文章パターンの代わりに、グラフの性質を示す本文を抽出するための文章パターンを用いる。 Also, the processing for extracting the text indicating the characteristics of the graph is similar to that shown in FIG. Use sentence patterns to extract.

図15は、グラフの性質を示す本文を抽出するための文章パターンの一例である、文章パターン2300を示す表図である。 FIG. 15 is a table showing a sentence pattern 2300, which is an example of a sentence pattern for extracting a text that indicates the properties of a graph.

画像解析部203は、テキストデータ解析部202から受け取ったグラフキャプションの情報をもとに画像ファイルを解析し、グラフの検出を行う。 The image analysis unit 203 analyzes the image file based on the graph caption information received from the text data analysis unit 202 to detect the graph.

データ格納部は204は、画像解析部203が抽出したグラフを、ファイルなどのかたちで出力する。 A data storage unit 204 outputs the graph extracted by the image analysis unit 203 in the form of a file or the like.

図16は、データ抽出プログラム200が、グラフデータの抽出を行う一連の処理において、グラフの検出・出力を行う処理2000を示す。グラフの検出・出力処理2000は、処理300においてグラフのキャプションが検出されたページそれぞれに対して、実行される。 FIG. 16 shows a process 2000 for detecting and outputting a graph in a series of processes for extracting graph data by the data extraction program 200 . The graph detection/output process 2000 is executed for each page where the graph caption was detected in process 300 .

まず、画像解析部203が、テキストデータ解析部202が、処理300において作成したテーブル510(ただし表キャプションはグラフキャプションに置き換わる)を参照し、グラフキャプションを含むページのページ番号を確認する(処理2010)。そして、PDFファイルの当該文書ページを、画像ファイルに変換する(処理2011)。画像ファイルへの変換は、実施例1と同様である。 First, the image analysis unit 203 refers to the table 510 (however, table captions are replaced with graph captions) created by the text data analysis unit 202 in process 300, and confirms the page numbers of pages including graph captions (process 2010). ). Then, the document page of the PDF file is converted into an image file (process 2011). Conversion to an image file is the same as in the first embodiment.

次に、処理300においてテキストデータ解析部202が抽出したグラフキャプションの座標情報を、画像ファイルの座標スケールに合わせる処理を行う(処理2012)。画像ファイル上での当該文書ページのサイズをもとに、グラフキャプションの座標情報を、座標情報付きテキストファイル上での座標情報から、画像ファイル上での座標情報に変換する。サイズ変換は、実施例1の変換式において、「表キャプション」を「グラフキャプション」に置き換えることで、表キャプションの場合と同様に実行することができる。 Next, the coordinate information of the graph caption extracted by the text data analysis unit 202 in the process 300 is adjusted to the coordinate scale of the image file (process 2012). Based on the size of the document page on the image file, the coordinate information of the graph caption is converted from the coordinate information on the text file with coordinate information to the coordinate information on the image file. Size conversion can be performed in the same manner as the table caption by replacing "table caption" with "graph caption" in the conversion formula of the first embodiment.

次に、画像解析部203は、グラフ検出を実行する画像範囲を限定する処理を行う(処理2013)。画像範囲の限定は、グラフキャプションの座標をもとに行う。画像解析部203が、グラフ検出を実行する画像範囲を限定する手法は、実施例1と同様である。 Next, the image analysis unit 203 performs processing for limiting the image range for executing graph detection (processing 2013). The image range is limited based on the coordinates of the graph caption. The method of limiting the image range in which the image analysis unit 203 executes graph detection is the same as in the first embodiment.

次に、画像解析部203は、処理2013で限定した画像範囲から、グラフ検出を実行する(処理2014)。グラフ検出はどのような方法を用いても良い。例えば、画像処理ライブラリ等を用いて矩形検出を行い、検出した矩形をグラフとして検出する方法がある。また、画像処理ライブラリ等を用いて直線検出を行い、直交する2つの直線をグラフの縦軸と横軸として認識し、両直線で囲まれる範囲を、グラフとして検出してもよい。グラフを検出したら、画像解析部203は、検出したグラフの画像を、データ格納部204に送る。 Next, the image analysis unit 203 executes graph detection from the image range limited in process 2013 (process 2014). Any method may be used for graph detection. For example, there is a method of detecting rectangles using an image processing library or the like and detecting the detected rectangles as a graph. Further, straight line detection may be performed using an image processing library or the like, two orthogonal straight lines may be recognized as the vertical axis and the horizontal axis of the graph, and the range surrounded by both straight lines may be detected as a graph. After detecting the graph, the image analysis unit 203 sends the image of the detected graph to the data storage unit 204 .

グラフの画像を受け取ったデータ格納部204は、ファイルなどのかたちで、ディスク装置104に保存する。出力の際、グラフのキャプションをメタデータとして付与する。メタデータの付与の方法は、どのような方法でも良いが、グラフのキャプションをファイル名にしてしまう方法などが考えられる。 The data storage unit 204 that has received the graph image stores it in the disk device 104 in the form of a file or the like. At the time of output, the caption of the graph is given as metadata. Any method can be used to add the metadata, but one possible method is to use the caption of the graph as the file name.

実施例2においても、実施例1の図13と同様にデータ抽出プログラム200が、グラフデータの抽出を行う一連の処理において、グラフデータの性質を示す情報を抽出し、出力する処理を行なうことができる。 In the second embodiment, as in FIG. 13 of the first embodiment, the data extraction program 200 can extract and output information indicating the properties of graph data in a series of processes for extracting graph data. can.

まず、テキストデータ解析部202が、座標情報付きのテキストファイルにおいてTOKENタグが付与されている全テキストを抽出し、各テキストの座標情報をもとに文章を形成する。これは、座標上で連続しているテキストを一連の文章として認識することで行う。そうして形成した文章に、グラフの性質を説明する文章パターン(図15参照)が含まれるかどうかを調べ(処理1310)、もし含まれていれば、その文章パターンが含まれている一文を、グラフの性質を示す情報として、抽出し、データ格納部204に渡す。データ格納部204は、渡された情報(テキスト)を、ファイルやDB等のかたちでディスク装置104上に保存する(処理1311)。 First, the text data analysis unit 202 extracts all texts to which the TOKEN tag is attached in the text file with coordinate information, and forms sentences based on the coordinate information of each text. This is done by recognizing text that is continuous on coordinates as a series of sentences. It is checked whether or not the sentence thus formed contains a sentence pattern (see FIG. 15) explaining the properties of the graph (process 1310). , is extracted as information indicating the properties of the graph and passed to the data storage unit 204 . The data storage unit 204 saves the transferred information (text) on the disk device 104 in the form of a file, DB, or the like (process 1311).

処理2015で出力したグラフデータのメタデータであるグラフキャプションを、処理2211で抽出した情報と照合することで、処理2015で出力したグラフデータの性質を、データ分析時に、データ分析を実行するアプリケーションが、知ることができる。 By comparing the graph caption, which is the metadata of the graph data output in the process 2015, with the information extracted in the process 2211, the properties of the graph data output in the process 2015 can be identified by the application executing the data analysis. , can be known.

以上詳細に説明した実施例によれば、画像情報と座標情報付きテキストの双方を利用することで、例えばPDFファイルから、表データやグラフデータを正確に抽出することが可能となる。また、表データ、グラフデータとともに、表、グラフの性質を示すような情報を抽出することが可能になる。これらにより、データ分析の質が向上する。 According to the embodiments described in detail above, by using both image information and text with coordinate information, it is possible to accurately extract table data and graph data from, for example, a PDF file. In addition to table data and graph data, it is possible to extract information indicating the properties of the table and graph. These will improve the quality of data analysis.

本明細書で示すデータ抽出方法は、PDFファイルだけでなく、文書ページ中のオブジェクトと、当該オブジェクトの座標情報によって構成されているデジタル文書全般に適用することができる。実施例記載の技術により、これらのデジタル文書を対象とした、データ分析の質が向上する。 The data extraction method described in this specification can be applied not only to PDF files, but also to digital documents in general, which are composed of objects in document pages and coordinate information of the objects. The techniques described in the examples improve the quality of data analysis for these digital documents.

データ抽出装置100、バス101、CPU102、メモリ103、ディスク装置104、データ抽出プログラム200、変換処理部201、テキストデータ解析部202、画像解析部203、データ格納部204 Data extraction device 100, bus 101, CPU 102, memory 103, disk device 104, data extraction program 200, conversion processing unit 201, text data analysis unit 202, image analysis unit 203, data storage unit 204

Claims (8)

文書ページ中のオブジェクトと当該オブジェクトの座標情報を含むデジタル文書を、画像データと座標情報付きのテキストデータに変換する変換処理部と、
前記テキストデータから、前記オブジェクトに関連するキャプションを抽出するテキストデータ解析部と、
前記画像データから、抽出した前記キャプションの情報に基づいて、前記オブジェクトの検出を実行する画像解析部を備え、
前記変換処理部は、
前記デジタル文書のうち、前記キャプションが抽出されたページを画像データに変換し、
前記画像解析部は、
前記キャプションが抽出されたページの画像データに対し、前記オブジェクトの検出を実行する
ジタル文書からのデータ抽出システム。
a conversion processing unit that converts a digital document containing an object in a document page and coordinate information of the object into image data and text data with coordinate information;
a text data analysis unit that extracts captions associated with the object from the text data;
an image analysis unit that detects the object based on the caption information extracted from the image data;
The conversion processing unit is
Converting the page from which the caption was extracted from the digital document into image data;
The image analysis unit
performing the object detection on the image data of the page from which the caption was extracted ;
Data extraction system from digital documents.
文書ページ中のオブジェクトと当該オブジェクトの座標情報を含むデジタル文書を、画像データと座標情報付きのテキストデータに変換する変換処理部と、
前記テキストデータから、前記オブジェクトに関連するキャプションを抽出するテキストデータ解析部と、
前記画像データから、抽出した前記キャプションの情報に基づいて、前記オブジェクトの検出を実行する画像解析部を備え、
前記変換処理部は、
前記デジタル文書のうち、前記キャプションが抽出されたページを画像データに変換し、
前記画像解析部は、
前記キャプションが抽出されたページの画像データに対し、前記キャプションの座標情報に基づいて画像解析を実施する画像範囲を限定し、前記オブジェクトの検出を実行する
ジタル文書からのデータ抽出システム。
a conversion processing unit that converts a digital document containing an object in a document page and coordinate information of the object into image data and text data with coordinate information;
a text data analysis unit that extracts captions associated with the object from the text data;
an image analysis unit that detects the object based on the caption information extracted from the image data;
The conversion processing unit is
Converting the page from which the caption was extracted from the digital document into image data;
The image analysis unit
Limiting an image range in which image analysis is performed on the image data of the page from which the caption is extracted based on the coordinate information of the caption, and detecting the object ;
Data extraction system from digital documents.
文書ページ中のオブジェクトと当該オブジェクトの座標情報を含むデジタル文書を、画像データと座標情報付きのテキストデータに変換する変換処理部と、
前記テキストデータから、前記オブジェクトに関連するキャプションを抽出するテキストデータ解析部と、
前記画像データから、抽出した前記キャプションの情報に基づいて、前記オブジェクトの検出を実行する画像解析部を備え、
前記オブジェクトは表であって、
検出した表の座標情報と、前記座標情報付きのテキストデータを照合し、表中のテキストを抽出する、データ格納部を備え、
前記画像解析部は、
検出した表の各セルを抽出し、
前記データ格納部は、
前記各セルの座標情報と、前記座標情報付きのテキストデータを照合し、各セル中のテキストを抽出する
ジタル文書からのデータ抽出システム。
a conversion processing unit that converts a digital document containing an object in a document page and coordinate information of the object into image data and text data with coordinate information;
a text data analysis unit that extracts captions associated with the object from the text data;
an image analysis unit that detects the object based on the caption information extracted from the image data;
The object is a table,
A data storage unit that compares the detected coordinate information of the table with the text data with the coordinate information and extracts the text in the table,
The image analysis unit
Extract each cell of the detected table,
The data storage unit
matching the coordinate information of each cell with the text data with the coordinate information, and extracting the text in each cell ;
Data extraction system from digital documents.
前記テキストデータ解析部は、
前記テキストデータと予め設定した文章パターンとの照合により、表の構造を説明するテキストを抽出し、
前記データ格納部は、
前記セル中のテキストと前記表の構造を説明するテキストに基づいて、表のレイアウトを認識する、
請求項記載のデジタル文書からのデータ抽出システム。
The text data analysis unit
extracting text explaining the structure of the table by matching the text data with a preset sentence pattern;
The data storage unit
recognizing the layout of a table based on text in said cells and text describing the structure of said table;
4. A system for extracting data from digital documents according to claim 3 .
前記テキストデータ解析部は、
前記テキストデータとキーワードとの照合によりキャプションの候補となるテキストを検索し、前記キャプションの候補と予め設定した文章パターンとの照合により、前記キャプションの候補がキャプションか本文の一部かを識別する、
請求項1~3のいずれかに記載のデジタル文書からのデータ抽出システム。
The text data analysis unit
Searching text that is a candidate for a caption by matching the text data with a keyword, and identifying whether the candidate for the caption is a caption or a part of the text by matching the candidate for the caption with a preset sentence pattern;
A system for extracting data from digital documents according to any one of claims 1 to 3 .
前記オブジェクトは、表データあるいはグラフデータである、
請求項1~3のいずれかに記載のデジタル文書からのデータ抽出システム。
the object is tabular data or graph data;
A system for extracting data from digital documents according to any one of claims 1 to 3 .
前記テキストデータ解析部は、
予め定義しておいた文章パターンをもとに、前記オブジェクトの性質を示す情報を、前記座標情報付きのテキストデータから抽出する、
請求項1~3のいずれかに記載のデジタル文書からのデータ抽出システム。
The text data analysis unit
extracting information indicating the properties of the object from the text data with the coordinate information based on a sentence pattern defined in advance ;
A system for extracting data from digital documents according to any one of claims 1 to 3 .
前記キャプションの情報は、当該キャプションが検出された頁および当該キャプションが検出された座標の少なくとも一つである、
請求項1~3のいずれかに記載のデジタル文書からのデータ抽出システム。
The caption information is at least one of the page where the caption is detected and the coordinates where the caption is detected,
A system for extracting data from digital documents according to any one of claims 1 to 3 .
JP2019072770A 2019-04-05 2019-04-05 Data extraction system from digital documents Active JP7252818B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019072770A JP7252818B2 (en) 2019-04-05 2019-04-05 Data extraction system from digital documents

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019072770A JP7252818B2 (en) 2019-04-05 2019-04-05 Data extraction system from digital documents

Publications (2)

Publication Number Publication Date
JP2020170445A JP2020170445A (en) 2020-10-15
JP7252818B2 true JP7252818B2 (en) 2023-04-05

Family

ID=72746804

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019072770A Active JP7252818B2 (en) 2019-04-05 2019-04-05 Data extraction system from digital documents

Country Status (1)

Country Link
JP (1) JP7252818B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346161A (en) 2002-05-23 2003-12-05 Kansai Electric Power Co Inc:The In-chart text/chart caption/chart legend/chart kind extraction program, computer-readable recording medium for recording extraction program and in-chart text/chart caption/chart legend/chart kind extraction device
JP2008129793A (en) 2006-11-20 2008-06-05 Canon Inc Document processing system, apparatus and method, and recording medium with program recorded thereon
JP2011048816A (en) 2009-08-25 2011-03-10 Fuji Xerox Co Ltd Discrimination method, discrimination device and computer program
JP2011141597A (en) 2010-01-05 2011-07-21 Canon Inc Image processing apparatus, image processing method and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11306197A (en) * 1998-04-24 1999-11-05 Canon Inc Processor and method for image processing, and computer-readable memory
KR101316780B1 (en) * 2012-02-21 2013-10-17 한국과학기술원 Automatic Table Classification Method and System based on Information in Table within Document
KR101811581B1 (en) * 2016-11-15 2017-12-26 주식회사 셀바스에이아이 Aparatus and method for cell decomposition for a table recognition in document image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346161A (en) 2002-05-23 2003-12-05 Kansai Electric Power Co Inc:The In-chart text/chart caption/chart legend/chart kind extraction program, computer-readable recording medium for recording extraction program and in-chart text/chart caption/chart legend/chart kind extraction device
JP2008129793A (en) 2006-11-20 2008-06-05 Canon Inc Document processing system, apparatus and method, and recording medium with program recorded thereon
JP2011048816A (en) 2009-08-25 2011-03-10 Fuji Xerox Co Ltd Discrimination method, discrimination device and computer program
JP2011141597A (en) 2010-01-05 2011-07-21 Canon Inc Image processing apparatus, image processing method and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, Pengyuan et al.,Extracting Figures and Captions from Scientific Publications,CIKM '18: Proceedings of the 27th ACM International Conference on Information and Knowledge Management [online],ACM,2018年10月17日,pp.1595-1598,[検索日:2022.09.21], Internet<URL: https://dl.acm.org/doi/abs/10.1145/3269206.3269265 ><DOI: 10.1145/3269206.3269265 >

Also Published As

Publication number Publication date
JP2020170445A (en) 2020-10-15

Similar Documents

Publication Publication Date Title
US6336124B1 (en) Conversion data representing a document to other formats for manipulation and display
US8107727B2 (en) Document processing apparatus, document processing method, and computer program product
JP5144940B2 (en) Improved robustness in table of contents extraction
JP5663866B2 (en) Information processing apparatus and information processing program
JP3940491B2 (en) Document processing apparatus and document processing method
JP3694149B2 (en) Image search apparatus, image search key text generation method, program for causing a computer to function as the apparatus, and computer-readable recording medium on which a program for causing the computer to execute the method is recorded
US5164899A (en) Method and apparatus for computer understanding and manipulation of minimally formatted text documents
Déjean et al. A system for converting PDF documents into structured XML format
US20070168382A1 (en) Document analysis system for integration of paper records into a searchable electronic database
JP4785655B2 (en) Document processing apparatus and document processing method
US7310773B2 (en) Removal of extraneous text from electronic documents
US9098581B2 (en) Method for finding text reading order in a document
JPH10228473A (en) Document picture processing method, document picture processor and storage medium
JPS61267177A (en) Retrieving system for document picture information
JP2007095102A (en) Document processor and document processing method
US11475688B2 (en) Information processing apparatus and information processing method for extracting information from document image
US20090030882A1 (en) Document image processing apparatus and document image processing method
JP2003288334A (en) Document processor and document processing method
JP4261988B2 (en) Image processing apparatus and method
JPH11184894A (en) Method for extracting logical element and record medium
JP2007310501A (en) Information processor, its control method, and program
JP4983526B2 (en) Data processing apparatus and data processing program
JP7252818B2 (en) Data extraction system from digital documents
WO2014068770A1 (en) Data extraction method, data extraction device, and program thereof
JP2010231637A (en) Apparatus, method and program for processing document image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220914

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220927

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221125

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230324

R150 Certificate of patent or registration of utility model

Ref document number: 7252818

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150