JP7729291B2 - Answer generation device, machine learning method, and program - Google Patents
Answer generation device, machine learning method, and programInfo
- Publication number
- JP7729291B2 JP7729291B2 JP2022141244A JP2022141244A JP7729291B2 JP 7729291 B2 JP7729291 B2 JP 7729291B2 JP 2022141244 A JP2022141244 A JP 2022141244A JP 2022141244 A JP2022141244 A JP 2022141244A JP 7729291 B2 JP7729291 B2 JP 7729291B2
- Authority
- JP
- Japan
- Prior art keywords
- information
- answer
- unit
- text
- rectangular
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
特許法第30条第2項適用 2022年3月7日に言語処理学会 第28回年次大会(予稿集)にて公開 2021年9月17日にInternational Conference on Document Understanding(ICDAR 2021)及びYouTubeウェブサイトにて公開Article 30, paragraph 2 of the Patent Act applies. Published at the 28th Annual Meeting of the Association for Natural Language Processing (Proceedings) on March 7, 2022. Published at the International Conference on Document Understanding (ICDAR 2021) and on the YouTube website on September 17, 2021.
本開示は、質問文を示す質問テキスト及びテキストを含む文書画像を入力として、文書画像の内容に基づいて質問に対する回答情報を生成する技術に関する。 This disclosure relates to a technology that uses question text indicating a question sentence and a document image containing the text as input and generates answer information to the question based on the content of the document image.
質問文を示す質問テキスト及びテキストを含む文書画像を入力として、文書画像の内容に基づいて質問に対する回答テキストを生成する質問応答技術がある(非特許文献1、非特許文献2)。これらの従来のシステムでは、学習データを{文書画像、質問文、正解回答情報}の3つ組とする。そして、従来のシステムは、まず、文書画像に対して、テキスト抽出および文書領域(Title, Paragraph, Captionなど)の抽出を行い、テキスト、文書におけるテキスト領域の座標、及びアイコン等の視覚情報を獲得する。次に、従来のシステムは、文書画像から獲得した情報および与えられた質問文を入力とし、回答の生成を行うように学習を行う。 Question-answering technologies exist that take question text indicating a question and a document image containing the text as input, and generate answer text to the question based on the contents of the document image (Non-Patent Document 1, Non-Patent Document 2). In these conventional systems, training data consists of a triplet of {document image, question, correct answer information}. Conventional systems first extract text and document regions (title, paragraph, caption, etc.) from the document image, acquiring visual information such as text, coordinates of text regions in the document, and icons. Next, conventional systems train to generate answers using the information acquired from the document image and a given question as input.
しかしながら、従来技術では、文書画像内において物体やテキストがどのように配置されているかの学習は行われておらず、テキストのみならず、物体を含めた文書画像の理解には課題が残っている。 However, conventional technologies do not learn how objects and text are arranged within document images, and there remain challenges in understanding document images that include not only text but also objects.
本発明は、上述の点に鑑みてなされたものであって、文書画像内の物体とテキストとの配置関係を考慮することで、より正確な回答情報を生成することを目的とする。 The present invention has been made in consideration of the above points, and aims to generate more accurate answer information by taking into account the positional relationship between objects and text in a document image.
上記課題を解決するため、請求項1に係る発明は、文書画像の内容に基づいて質問文に対する回答情報を生成する回答生成装置であって、前記文書画像中のテキスト情報及び前記文書画像中の物体を示す物体情報、並びに前記質問文に基づいて、エンコード特徴量を出力するエンコード部と、前記エンコード特徴量に基づいて、前記回答情報の出力確率分布情報を出力するデコード部と、前記文書画像における複数の文書テキストの矩形領域を示す矩形領域情報から選択した所定の文書テキストの矩形領域を示す第1の矩形選択領域情報を導出し、前記文書画像における物体の矩形領域を示す矩形領域情報から選択した所定の物体の矩形領域を示す第2の矩形選択領域情報を導出すると共に、前記所定の物体に対する前記所定の文書テキストの配置関係を示す正解配置関係情報を導出する正解配置関係導出部と、前記エンコード特徴量に基づいて、前記第1の矩形選択領域情報に係る前記所定の文書テキストと前記第2の矩形選択領域情報に係る前記所定の物体との配置関係を予測することで、予測配置関係分布情報を出力する配置関係予測部と、前記回答情報の出力確率分布情報、及び正解回答情報、並びに、前記予測配置関係分布情報、及び前記正解配置関係情報に基づいて、ニューラルネットワークのモデルパラメータの学習を行うパラメータ学習部と、を有する回答生成装置である。 In order to solve the above problem, the invention of claim 1 is an answer generation device that generates answer information to a question based on the content of a document image, and includes an encoding unit that outputs encoded features based on text information in the document image, object information indicating an object in the document image, and the question, a decoding unit that outputs output probability distribution information of the answer information based on the encoded features, and a decoder unit that derives first rectangular selection area information indicating a rectangular area of a predetermined document text selected from rectangular area information indicating rectangular areas of multiple document texts in the document image, and a decoder unit that derives first rectangular selection area information indicating a rectangular area of a predetermined object selected from rectangular area information indicating rectangular areas of objects in the document image. The answer generation device includes: a correct layout relation derivation unit that derives second rectangular selection area information that indicates the layout relationship of the specified document text relative to the specified object, and derives correct layout relation information that indicates the layout relationship of the specified document text relative to the specified object; a layout relation prediction unit that predicts the layout relationship between the specified document text related to the first rectangular selection area information and the specified object related to the second rectangular selection area information based on the encoded features, and outputs predicted layout relation distribution information; and a parameter learning unit that learns model parameters of a neural network based on output probability distribution information of the answer information, correct answer information, the predicted layout relation distribution information, and the correct layout relation information.
以上説明したように本発明によれば、物体とテキストとの配置関係を理解する性能が向上し、より正確な回答情報を生成することができるという効果を奏する。 As described above, the present invention has the effect of improving the ability to understand the positional relationship between objects and text, thereby enabling the generation of more accurate answer information.
以下、図面に基づいて本発明の実施形態を説明する。 The following describes an embodiment of the present invention based on the drawings.
●第1の実施形態
まずは、図1乃至図9を用いて、本発明の第1の実施形態について説明する。なお、第1の実施形態に係る回答生成装置3aは、上述のように質問文を示す質問テキスト及びテキストを含む文書画像を入力として、文書画像の内容に基づいて質問に対する回答情報を生成する従来技術に対して、特定の改善を提供するものであり、ニューラルネットワークを用いた回答情報の生成に係る技術分野の向上を示すものである。
First Embodiment First, a first embodiment of the present invention will be described with reference to Figures 1 to 9. Note that the answer generation device 3a according to the first embodiment provides a specific improvement over the conventional technology that receives question text indicating a question sentence and a document image including the text as input and generates answer information to a question based on the contents of the document image, as described above, and represents an advancement in the technical field related to generation of answer information using a neural network.
〔実施形態のシステム構成〕
まず、図1を用いて、本実施形態の通信システムの全体構成について説明する。図1は、本実施形態に係る通信システムの全体構成図である。
[System configuration of the embodiment]
First, the overall configuration of the communication system according to this embodiment will be described with reference to Fig. 1. Fig. 1 is a diagram showing the overall configuration of the communication system according to this embodiment.
図1に示されているように、本実施形態の通信システム1は、回答生成装置3、及び通信端末5によって構築されている。通信端末5は、ユーザによって管理及び使用される。ユーザは、回答生成装置の出力結果を参照して、その後の対応を判断する者である。 As shown in FIG. 1, the communication system 1 of this embodiment is constructed with an answer generation device 3 and a communication terminal 5. The communication terminal 5 is managed and used by a user. The user refers to the output results of the answer generation device and decides on the next course of action.
また、回答生成装置3と通信端末5は、インターネット等の通信ネットワーク100を介して通信することができる。通信ネットワーク100の接続形態は、無線又は有線のいずれでも良い。 In addition, the answer generation device 3 and the communication terminal 5 can communicate via a communication network 100 such as the Internet. The communication network 100 may be connected wirelessly or via a wired connection.
回答生成装置3は、単数又は複数のコンピュータによって構成されている。回答生成装置3が複数のコンピュータによって構成されている場合には、「回答生成装置」と示しても良いし、「回答生成システム」と示しても良い。 The answer generation device 3 is composed of one or more computers. If the answer generation device 3 is composed of multiple computers, it may be referred to as an "answer generation device" or an "answer generation system."
回答生成装置3は、図5に示すように、文章画像内に直接の数値情報(例えば「40%」)に係る回答正解情報が含まれていない場合であっても、「100%-*%=」(*は変数)等のテンプレートを用いて、算術演算の過程を示す算術演算過程情報を自動で生成することで、数値情報の理解能力を向上させる。なお、例えば、文章画像から抽出された全ての数値がテンプレートの「*」に代入される。 As shown in Figure 5, even if the text image does not contain correct answer information related to direct numerical information (e.g., "40%), the answer generation device 3 automatically generates arithmetic operation process information showing the process of arithmetic operations using a template such as "100% - *% =" (where * is a variable), thereby improving the ability to understand numerical information. For example, all numerical values extracted from the text image are substituted for "*" in the template.
通信端末5は、コンピュータであり、図1では、一例としてノート型パソコンが示されている。図1では、ユーザが、通信端末5を操作する。なお、通信端末5を用いずに、回答生成装置3単独で処理をしてもよい。 The communication terminal 5 is a computer, and FIG. 1 shows a laptop computer as an example. In FIG. 1, a user operates the communication terminal 5. Note that the answer generation device 3 may perform processing independently without using the communication terminal 5.
〔ハードウェア構成〕
<回答生成装置のハードウェア構成>
次に、図2を用いて、回答生成装置3の電気的なハードウェア構成を説明する。図2は、回答生成装置の電気的なハードウェア構成図である。
[Hardware configuration]
<Hardware configuration of answer generation device>
Next, the electrical hardware configuration of the answer generation device 3 will be described with reference to Fig. 2. Fig. 2 is a diagram showing the electrical hardware configuration of the answer generation device.
回答生成装置3は、コンピュータとして、図2に示されているように、プロセッサとしてのCPU(Central Processing Unit)301、ROM(Read Only Memory)302、RAM(Random Access Memory)303、SSD(Solid State Drive)304、外部機器接続I/F(Interface)305、ネットワークI/F306、メディアI/F309、及びバスライン310を備えている。 As shown in FIG. 2, the answer generation device 3 is a computer that includes a processor such as a CPU (Central Processing Unit) 301, a ROM (Read Only Memory) 302, a RAM (Random Access Memory) 303, an SSD (Solid State Drive) 304, an external device connection I/F (Interface) 305, a network I/F 306, a media I/F 309, and a bus line 310.
これらのうち、CPU301は、回答生成装置3全体の動作を制御する。ROM302は、IPL(Initial Program Loader)等のCPU301の駆動に用いられるプログラムを記憶する。RAM303は、CPU301のワークエリアとして使用される。 Of these, CPU 301 controls the overall operation of the answer generation device 3. ROM 302 stores programs used to drive CPU 301, such as IPL (Initial Program Loader). RAM 303 is used as a work area for CPU 301.
SSD304は、CPU301の制御に従って各種データの読み出し又は書き込みを行う。なお、SSD304の代わりに、HDD(Hard Disk Drive)を用いても良い。 SSD304 reads and writes various data under the control of CPU301. Note that a HDD (Hard Disk Drive) may be used instead of SSD304.
外部機器接続I/F305は、各種の外部機器を接続するためのインターフェースである。この場合の外部機器は、ディスプレイ、スピーカ、キーボード、マウス、USB(Universal Serial Bus)メモリ、及びプリンタ等である。 The external device connection I/F 305 is an interface for connecting various external devices. In this case, external devices include a display, speakers, keyboard, mouse, USB (Universal Serial Bus) memory, and printer.
ネットワークI/F306は、通信ネットワーク100を介してデータ通信をするためのインターフェースである。 Network I/F 306 is an interface for data communication via communication network 100.
メディアI/F309は、フラッシュメモリ等の記録メディア309mに対するデータの読み出し又は書き込み(記憶)を制御する。記録メディア309mには、DVD(Digital Versatile Disc)やBlu-ray Disc(登録商標)等も含まれる。 The media I/F 309 controls the reading and writing (storage) of data from and to a recording medium 309m such as a flash memory. Recording media 309m also includes DVDs (Digital Versatile Discs) and Blu-ray Discs (registered trademarks).
バスライン310は、図2に示されているCPU301等の各構成要素を電気的に接続するためのアドレスバスやデータバス等である。 Bus line 310 is an address bus, data bus, etc. that electrically connects each component, such as CPU 301, shown in Figure 2.
<通信端末のハードウェア構成>
次に、図3を用いて、通信端末5の電気的なハードウェア構成を説明する。図3は、通信端末の電気的なハードウェア構成図である。
<Hardware configuration of communication terminal>
Next, the electrical hardware configuration of the communication terminal 5 will be described with reference to Fig. 3. Fig. 3 is a diagram showing the electrical hardware configuration of the communication terminal.
通信端末5は、コンピュータとして、図3に示されているように、CPU501、ROM502、RAM503、SSD504、外部機器接続I/F(Interface)505、ネットワークI/F506、ディスプレイ507、ポインティングデバイス508、メディアI/F509、及びバスライン510を備えている。 As shown in FIG. 3, the communication terminal 5 is a computer and includes a CPU 501, ROM 502, RAM 503, SSD 504, an external device connection I/F (Interface) 505, a network I/F 506, a display 507, a pointing device 508, a media I/F 509, and a bus line 510.
これらのうち、CPU501は、通信端末5全体の動作を制御する。ROM502は、IPL等のCPU501の駆動に用いられるプログラムを記憶する。RAM503は、CPU501のワークエリアとして使用される。 Of these, the CPU 501 controls the overall operation of the communication terminal 5. The ROM 502 stores programs used to drive the CPU 501, such as IPL. The RAM 503 is used as a work area for the CPU 501.
SSD504は、CPU501の制御に従って各種データの読み出し又は書き込みを行う。なお、SSD504の代わりに、HDD(Hard Disk Drive)を用いてもよい。 The SSD 504 reads and writes various data under the control of the CPU 501. Note that a hard disk drive (HDD) may be used instead of the SSD 504.
外部機器接続I/F505は、各種の外部機器を接続するためのインターフェースである。この場合の外部機器は、ディスプレイ、スピーカ、キーボード、マウス、USBメモリ、及びプリンタ等である。 The external device connection I/F 505 is an interface for connecting various external devices. In this case, external devices include a display, speakers, keyboard, mouse, USB memory, and printer.
ネットワークI/F506は、通信ネットワーク100を介してデータ通信をするためのインターフェースである。 The network I/F 506 is an interface for data communication via the communication network 100.
ディスプレイ507は、各種画像を表示する液晶や有機EL(Electro Luminescence)などの表示手段の一種である。 Display 507 is a type of display means, such as liquid crystal or organic EL (Electro Luminescence), that displays various images.
ポインティングデバイス508は、各種指示の選択や実行、処理対象の選択、カーソルの移動などを行う入力手段の一種である。なお、ユーザがキーボードを使う場合は、ポインティングデバイス508の機能をOFFにしてもよい。 The pointing device 508 is a type of input means used to select and execute various instructions, select processing targets, move the cursor, etc. If the user uses a keyboard, the function of the pointing device 508 may be turned off.
メディアI/F509は、フラッシュメモリ等の記録メディア509mに対するデータの読み出し又は書き込み(記憶)を制御する。記録メディア509mには、DVDやBlu-ray Disc(登録商標)等も含まれる。 The media I/F 509 controls the reading and writing (storage) of data from and to a recording medium 509m such as a flash memory. Recording media 509m also includes DVDs and Blu-ray Discs (registered trademarks).
バスライン510は、図3に示されているCPU501等の各構成要素を電気的に接続するためのアドレスバスやデータバス等である。 The bus line 510 is an address bus, data bus, etc. that electrically connects the various components, such as the CPU 501 shown in Figure 3.
〔回答生成装置の機能構成〕
本実施形態に係る回答生成装置3aの学習フェーズ及び推論(予測)フェーズにおける機能構成について説明する。なお、図4に学習フェーズの機能構成、図7に推論フェーズの機能構成を示すが、回答生成装置3aは、図4と図7の各部をまとめて有していてもよい。
[Functional configuration of the answer generation device]
The functional configuration of the answer generation device 3a according to this embodiment in the learning phase and inference (prediction) phase will be described. Note that although the functional configuration of the learning phase is shown in Fig. 4 and the functional configuration of the inference phase is shown in Fig. 7, the answer generation device 3a may have all the components of Fig. 4 and Fig. 7 collectively.
<学習フェーズの機能構成>
まず、図4を用いて、学習フェーズにおける回答生成装置3aの各機能について説明する。図4は、第1の実施形態に係り、学習フェーズにおける回答生成装置の機能構成図である。なお、回答生成装置3aは、回答生成装置3の一例である。
<Learning phase functional configuration>
First, the functions of the answer generation device 3a in the learning phase will be described with reference to Fig. 4. Fig. 4 is a functional configuration diagram of the answer generation device in the learning phase according to the first embodiment. Note that the answer generation device 3a is an example of the answer generation device 3.
図4に示すように、回答生成装置3aは、入力部30、テキスト抽出部31a、物体抽出部32a、データ拡張部33、エンコード部35a、デコード部36a、及びパラメータ学習部38aを有する。これら各部は、プログラムに基づき図2のCPU301による命令によって実現される機能である。また、RAM303又はSSD304には、機械学習モデル41aが構築されている。なお、エンコード部とデコード部の処理は、ニューラルネットワークのモデルパラメータに基づいたものである。 As shown in FIG. 4, the answer generation device 3a has an input unit 30, a text extraction unit 31a, an object extraction unit 32a, a data expansion unit 33, an encoding unit 35a, a decoding unit 36a, and a parameter learning unit 38a. Each of these units has a function realized by instructions from the CPU 301 in FIG. 2 based on a program. In addition, a machine learning model 41a is constructed in the RAM 303 or SSD 304. The processing of the encoding unit and decoding unit is based on the model parameters of the neural network.
入力部30は、通信端末7を介して、回答生成装置3aに、学習データ(質問文、正解回答情報、及び文書画像の各データ)を入力する。または、入力部30は、回答生成装置3aに、直接、学習データを入力する。図5は、質問文、文書画像、及び正解回答情報の例を示す図である。例えば、図5に示すように、質問文は「糖尿病を防げた事例の割合は?」である。文書画像は、図5の右側の画像である。正解回答情報は「40%」である。 The input unit 30 inputs learning data (question sentence, correct answer information, and document image data) to the answer generation device 3a via the communication terminal 7. Alternatively, the input unit 30 inputs learning data directly to the answer generation device 3a. Figure 5 is a diagram showing examples of question sentences, document images, and correct answer information. For example, as shown in Figure 5, the question sentence is "What is the percentage of cases in which diabetes was prevented?" The document image is the image on the right side of Figure 5. The correct answer information is "40%."
テキスト抽出部31aは、入力部30によって入力された文書画像を入力して、文書画像中のテキスト情報(文書テキスト系列、文書テキスト矩形領域の各情報)を出力する。 The text extraction unit 31a inputs the document image input by the input unit 30 and outputs the text information in the document image (document text sequence and information on document text rectangular areas).
そのため、テキスト抽出部31aは、文書画像に含まれるテキストの領域を検出し、検出された領域内のテキストをOCR(Optical Character Recognition)等で認識して、文書画像中のテキスト情報を出力する。文書画像中のテキスト情報には、文書テキスト系列及び文書テキスト矩形領域を少なくとも含む。ここで出力される文書テキスト系列は、テキストの座標に応じて、left-to-right,top-to-downの順番で並び替えられている。また、文書テキスト矩形領域は、例えば、「60%」を示す文書画像における矩形領域の左上座標及び右下座標によって表される。これらの処理は、文書画像からテキスト系列、及びテキストの矩形領域を出力できるものであれば何でもよい。本実施形態においては、処理の一例として参考文献1に示されるTesseractを用いる。
<参考文献1>Google: Tesseract Manual. 2018.(https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc)
物体抽出部32aは、入力部30によって入力された文書画像を入力して、文書画像中の物体情報(物体領域特徴情報、物体領域意味ラベル、及び物体矩形領域情報)を出力する。
Therefore, the text extraction unit 31a detects text regions included in the document image, recognizes the text in the detected regions using OCR (Optical Character Recognition), or the like, and outputs text information from the document image. The text information from the document image includes at least a document text sequence and a document text rectangular region. The document text sequence output here is sorted left-to-right and top-to-down according to the text coordinates. Furthermore, the document text rectangular region is represented by, for example, the top-left and bottom-right coordinates of a rectangular region in the document image that indicates "60%." Any process can be used as long as it can output a text sequence and a text rectangular region from the document image. In this embodiment, Tesseract, as shown in Reference 1, is used as an example of the process.
<Reference 1> Google: Tesseract Manual. 2018.(https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc)
The object extraction unit 32a receives the document image input by the input unit 30 and outputs object information in the document image (object region feature information, object region semantic label, and object rectangular region information).
そのため、物体抽出部32aは、文書画像に含まれる物体情報を抽出し、文書画像中の物体情報として出力する。文書画像中の物体情報には、物体(グラフやアイコンなど)の領域特徴vobj、物体領域の意味を表すラベルである物体領域意味ラベル、物体領域の座標を表す物体矩形領域情報を少なくとも含む。これらの処理は、文書画像から、物体領域特徴情報、物体領域意味ラベル、及び物体矩形領域情報を獲得できれば、何を用いても良い。本実施形態においては、処理の一例として参考文献2のFaster-RCNNを用いる。
<参考文献2>Shaoqing Ren, Kaiming He, Ross B. Girshick, Jian Sun: Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. NIPS 2015: 91-99
ここで、本実施形態においては、領域特徴vobjは2048次元のベクトル系列、物体領域意味ラベルは参考文献3で定義された391種類の意味ラベル(graphやdogなど)、矩形領域情報は画像情報上の領域の左上座標と右下座標で表現される。
<参考文献3>Spandan Mada, Zoya Bylinskii, Mathew Tanik, Adria Recasens, Kimberli Zhong, Sami Alesheikh, Hanspeter Pfister, Aude Oliva, Fredo Durand: Synthetically Trained Icon Proposals for Parsing and Summarizing Inforgraphics. arXiv:1807.10441
データ拡張部33は、入力部30によって入力された正解回答情報、及びテキスト抽出部31aによって抽出された文書テキスト系列を入力して、算術演算過程を示す算術演算過程情報を出力する。
Therefore, the object extraction unit 32a extracts object information contained in the document image and outputs it as object information in the document image. The object information in the document image includes at least the region feature v obj of the object (such as a graph or icon), an object region semantic label which is a label indicating the meaning of the object region, and object rectangular region information which indicates the coordinates of the object region. Any process may be used for these processes as long as the object region feature information, object region semantic label, and object rectangular region information can be acquired from the document image. In this embodiment, Faster-RCNN in Reference 2 is used as an example of the process.
<Reference 2> Shaoqing Ren, Kaiming He, Ross B. Girshick, Jian Sun: Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. NIPS 2015: 91-99
In this embodiment, the region feature v obj is represented by a 2048-dimensional vector sequence, the object region semantic labels are represented by 391 types of semantic labels (such as graph or dog) defined in Reference 3, and the rectangular region information is represented by the upper left and lower right coordinates of the region on the image information.
<Reference 3> Spandan Mada, Zoya Bylinskii, Mathew Tanik, Adria Recasens, Kimberli Zhong, Sami Alesheikh, Hanspeter Pfister, Aude Oliva, Fredo Durand: Synthetically Trained Icon Proposals for Parsing and Summarizing Inforgraphics. arXiv:1807.10441
The data expansion unit 33 receives the correct answer information input by the input unit 30 and the document text sequence extracted by the text extraction unit 31a, and outputs arithmetic operation process information indicating the arithmetic operation process.
そのため、データ拡張部33は、正解回答情報及び文書画像内のテキストを用いて、算術演算過程(例えば、「100%-60%=」)を出力する。 Therefore, the data expansion unit 33 outputs an arithmetic operation process (e.g., "100% - 60%=") using the correct answer information and the text in the document image.
データ拡張部33の処理は以下の通りである。 The processing performed by the data expansion unit 33 is as follows:
S111:データ拡張部33は、文書テキスト系列から、所定の件数の数値データを抽出する。本実施形態においては、一例として7件抽出することとする。文字で書かれた数値(one, two等)に関しては、データ拡張部33によって数値データに変換される。図5の例においては、数値データとして「1.7, 1, 10, 4.3, 3.6, 6, 60」が抽出される。 S111: The data expansion unit 33 extracts a predetermined number of items of numerical data from the document text sequence. In this embodiment, seven items are extracted as an example. Numerical values written in text (one, two, etc.) are converted into numerical data by the data expansion unit 33. In the example of Figure 5, the following numerical data are extracted: "1.7, 1, 10, 4.3, 3.6, 6, 60."
S112:データ拡張部33は、例えば、予め「A+B」、「A-B」、「100-A」の3種類の異なった算術演算過程を示すテンプレートを保持している。なお、これら以外の算術演算過程を示すテンプレートを用いることも可能である。データ拡張部33は、S111で抽出した数値データの中から任意の数値をA、Bとし、算術演算過程を示すテンプレートに代入する。図5の例においては、A=60,B=6の場合、66、54、40が代入結果として出力される。 S112: The data extension unit 33 stores templates indicating three different types of arithmetic operation processes, for example, "A+B," "A-B," and "100-A." Templates indicating arithmetic operation processes other than these can also be used. The data extension unit 33 takes arbitrary numerical values from the numerical data extracted in S111 as A and B and substitutes them into the template indicating the arithmetic operation process. In the example of Figure 5, when A = 60 and B = 6, 66, 54, and 40 are output as the substitution results.
S113:データ拡張部33は、上記S112で代入した所定のテンプレートに対して計算を実施し、計算結果(代入結果)と正解回答情報とを比較する。比較の結果、計算結果と正解回答情報が同様のテキスト(値)の場合、上記S112で代入したテンプレートを算術演算過程と特定して、この算術演算過程を示す算術演算過程情報を生成して出力する。図5の例においては、上記S2の代入結果である「40%」が回答正解情報と一致するため、算術演算過程情報が「100%-60%」となる。 S113: The data expansion unit 33 performs a calculation using the specified template substituted in S112 above, and compares the calculation result (substitution result) with the correct answer information. If the comparison shows that the calculation result and the correct answer information have the same text (value), the template substituted in S112 above is identified as an arithmetic operation process, and arithmetic operation process information indicating this arithmetic operation process is generated and output. In the example of Figure 5, the substitution result of S2 above, "40%", matches the correct answer information, so the arithmetic operation process information is "100% - 60%".
また、エンコード部35a及びデコード部36aは、系列変換部20aを構成する。図6は、第1の実施形態に係り、系列変換部の詳細な構成図である。系列変換部20aは、ニューラルネットワークのモデルパラメータを用いて、入力された情報に基づいて出力系列情報を生成する。モデルの構成は、系列を入力として系列を生成する、一般的なencoder-decoderモデル形式を採用する。 The encoding unit 35a and decoding unit 36a constitute the sequence conversion unit 20a. Figure 6 is a detailed configuration diagram of the sequence conversion unit according to the first embodiment. The sequence conversion unit 20a uses neural network model parameters to generate output sequence information based on input information. The model configuration employs a general encoder-decoder model format that takes a sequence as input and generates a sequence.
図6に示すように、エンコード部35aは、文書画像中のテキスト情報受付部351、文書画像中の物体情報受付部352、及び質問文受付部353を有している。これらは、ニューラルネットワークの入力層を構築している。 As shown in Figure 6, the encoding unit 35a has a text information in document image receiving unit 351, an object information in document image receiving unit 352, and a question sentence receiving unit 353. These constitute the input layer of the neural network.
文書画像中のテキスト情報受付部351は、文書画像中のテキスト情報(テキスト系列、テキストの矩形領域情報)を受け付ける。文書画像中の物体情報受付部352は、文書画像中の物体情報(物体領域特徴、物体領域意味ラベル、物体領域の矩形領域情報)を受け付ける。質問文受付部353は、質問文を受け付ける。 The text information in document image receiving unit 351 receives text information in the document image (text sequence, rectangular area information of the text). The object information in document image receiving unit 352 receives object information in the document image (object area features, object area semantic labels, rectangular area information of the object area). The question sentence receiving unit 353 receives a question sentence.
更に、エンコード部35aは、複数の変換部層1(Transformer)3551乃至変換部層L(Transformer)355Lを有している。複数の変換部層1(Transformer)3551乃至変換部層L(Transformer)355Lは、入力層から上記各情報を受け継ぎ、順次後述の計算を行う。 Furthermore, the encoding unit 35 a has a plurality of transformer layers 1 (Transformer) 355 1 to 355 L. The plurality of transformer layers 1 (Transformer) 355 1 to 355 L receive the above information from the input layer and sequentially perform the calculations described below.
また、デコード部36aは、複数の変換部層1(Transformer)3651乃至変換部層L(Transformer)365Lを有している。複数の変換部層1(Transformer)3651乃至変換部層L(Transformer)365Lは、エンコード部35aの変換部層L(Transformer)355Lからエンコード特徴量を受け継ぎ、順次後述の計算を行う。エンコード特徴量は、エンコード部35aに入力された文書画像および質問文の情報を、ニューラルネットワークのモデルパラメータに基づいて変換された所定次元のベクトルを示す。 The decoding unit 36a also has a plurality of transformer layers 1 (Transformer) 365-1 through 365 -L . The plurality of transformer layers 1 (Transformer) 365-1 through 365- L receive encoding features from the transformer layer 355- L of the encoding unit 35a and sequentially perform the calculations described below. The encoding features indicate vectors of a predetermined dimension obtained by converting the document image and question sentence information input to the encoding unit 35a based on the model parameters of the neural network.
なお、複数の変換部層1(Transformer)3551乃至変換部層L(Transformer)355L、及び、複数の変換部層1(Transformer)3651乃至変換部層L(Transformer)365Lは、ニューラルネットワークの中間層を構築している。 The plurality of transformer layers 1 (Transformer) 355 1 to 355 L and the plurality of transformer layers 1 (Transformer) 365 1 to 365 L form intermediate layers of a neural network.
更に、デコード部36aは、回答情報出力部357、及び算術演算過程情報出力部358を有している。これらは、ニューラルネットワークの出力層を構築している。回答情報出力部357は、中間層により得られた回答情報の出力確率分布情報を出力する。算術演算過程情報出力部358は、中間層により得られた算術演算過程の出力確率分布情報を出力する。 Furthermore, the decoding unit 36a has an answer information output unit 357 and an arithmetic operation process information output unit 358. These constitute the output layer of the neural network. The answer information output unit 357 outputs output probability distribution information of the answer information obtained by the intermediate layer. The arithmetic operation process information output unit 358 outputs output probability distribution information of the arithmetic operation process obtained by the intermediate layer.
以上により、系列変換部20aは、質問文、文書画像中のテキスト情報、文書画像中の物体情報、回答情報、及び算術演算過程情報を入力して、出力系列情報を出力することになる。回答情報は、学習フェーズには正解回答情報、推論フェーズにはテキスト生成部39で推論された回答情報を用いる。算術演算過程情報は、学習フェーズにはデータ拡張部33から出力された算術演算過程情報、推論フェーズにはテキスト生成部39で推論された算術演算過程情報である。出力系列情報は、回答情報の出力確率分布情報、及び算術演算過程の出力確率分布情報を示す。以下、エンコード部35a及びデコード部36aについて更に詳細に説明する。 As described above, the sequence conversion unit 20a inputs the question sentence, text information in the document image, object information in the document image, answer information, and arithmetic operation process information, and outputs output sequence information. The answer information uses correct answer information in the learning phase, and answer information inferred by the text generation unit 39 in the inference phase. The arithmetic operation process information is arithmetic operation process information output from the data extension unit 33 in the learning phase, and arithmetic operation process information inferred by the text generation unit 39 in the inference phase. The output sequence information indicates output probability distribution information of the answer information and output probability distribution information of the arithmetic operation process. The encoding unit 35a and decoding unit 36a are described in more detail below.
エンコード部35aは、質問文、テキスト抽出部31aによって抽出された文書画像中のテキスト情報、及び物体抽出部32aによって抽出された文書画像中の物体情報を入力して、エンコード特徴量を出力する。具体的には、エンコード部35aは、質問文、文書テキスト系列、文書テキスト矩形領域、物体矩形領域情報、物体領域意味ラベル、物体矩形領域情報を入力する。 The encoding unit 35a inputs the question sentence, text information in the document image extracted by the text extraction unit 31a, and object information in the document image extracted by the object extraction unit 32a, and outputs encoded features. Specifically, the encoding unit 35a inputs the question sentence, the document text sequence, the document text rectangular region, the object rectangular region information, the object region semantic label, and the object rectangular region information.
そのため、エンコード部35aは、文書画像内のテキスト、物体、及び質問文のエンコードを行う。この場合、画像と言語両方の特徴量を入力として、両方を合わせた特徴量を出力する際に一般的な処理を行えばよい。一例としての処理は以下の通りである。 For this reason, the encoding unit 35a encodes the text, objects, and questions in the document image. In this case, it is sufficient to input both image and language features and perform general processing when outputting the combined features. An example of the processing is as follows:
S121:エンコード部35aは、質問文、文書テキスト系列、及び物体領域意味ラベルをそれぞれ、所定の処理単位であるトークン系列wocr, wq, wobjに分割する。本実施形態においては、トークナイズ処理の一例として、参考文献4に示されるByte-level BPEを用いる。なお、本ステップの代わりに、エンコード部35aは、エンコード部35aの外部、例えばテキスト抽出部31a及び物体抽出部32aで予め生成されたトークン系列wocr, wq, wobjを取得するようにしてもよい。 S121: The encoding unit 35a divides the question sentence, the document text sequence, and the object region semantic label into token sequences w ocr , w q , and w obj , which are predetermined processing units. In this embodiment, the Byte-level BPE described in Reference 4 is used as an example of the tokenization process. Note that instead of this step, the encoding unit 35a may obtain the token sequences w ocr , w q , and w obj that have been generated in advance by an external unit, for example, the text extraction unit 31a and the object extraction unit 32a.
また、処理単位(トークン)は、テキストを所定単位で分割(トークナイズ)したものであれば何でもよい。トークナイズの結果であるトークン系列は、1以上のトークンからなる系列である。所定単位(トークン)は、例えば単語であってもよいし、サブワードであってもよい。
<参考文献4>Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever: Language models are unsupervised multitask learners. Technical report, OpenAI, 2019.
S122:エンコード部35aは、サブワードトークン系列wocr,wq,wobj及び物体領域特徴vobjを用いて、以下の入力トークン系列を用意する。
Furthermore, the processing unit (token) may be anything obtained by dividing (tokenizing) a text into predetermined units. The token sequence resulting from tokenization is a sequence consisting of one or more tokens. The predetermined unit (token) may be, for example, a word or a subword.
<Reference 4> Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever: Language models are unsupervised multitask learners. Technical report, OpenAI, 2019.
S122: The encoding unit 35a prepares the following input token sequence using the subword token sequence w ocr , w q , and w obj and the object region feature v obj .
S123:エンコード部35aは、系列中のk番目の入力埋め込み系列を以下のように定義する。 S123: The encoding unit 35a defines the kth input embedding sequence in the sequence as follows:
<参考文献5>Jacob Devlin, Ming-Wei Chang, Kanton Lee, Kristina Toutanova: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. NAACL19
<Reference 5> Jacob Devlin, Ming-Wei Chang, Kanton Lee, Kristina Toutanova: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. NAACL19
S124:エンコード部35aは、入力埋め込み系列 S124: The encoding unit 35a encodes the input embedded sequence.
<参考文献6>Jimmy Lei Ba, Jamie Ryan Kiros, Geoffrey E. Hinton: Layer Normalization. Arxiv, 2016.
デコード部36aは、エンコード部35aから出力されたエンコード特徴量、並びに、回答情報及び算術演算過程情報を入力して、出力系列情報を出力する。ここで、回答情報は、学習フェーズにはパラメータ学習部38aから出力されるトークナイズ処理済みの正解回答情報(トークナイズ後のトークン系列)、推論フェーズにはテキスト生成部39で推論された回答情報のトークンである。算術演算過程情報は、学習フェーズにはパラメータ学習部38aから出力されるトークナイズ処理済み算術演算過程情報、推論フェーズにはテキスト生成部39で推論された算術演算過程情報である。また、出力系列情報は、回答情報の出力確率分布情報、及び算術演算過程の出力確率分布である。
<Reference 6> Jimmy Lei Ba, Jamie Ryan Kiros, Geoffrey E. Hinton: Layer Normalization. Arxiv, 2016.
The decoding unit 36a receives the encoded features output from the encoding unit 35a, as well as the answer information and arithmetic operation process information, and outputs output sequence information. Here, the answer information is tokenized correct answer information (token sequence after tokenization) output from the parameter learning unit 38a in the learning phase, and tokens of answer information inferred by the text generation unit 39 in the inference phase. The arithmetic operation process information is tokenized arithmetic operation process information output from the parameter learning unit 38a in the learning phase, and arithmetic operation process information inferred by the text generation unit 39 in the inference phase. Furthermore, the output sequence information is output probability distribution information of the answer information and the output probability distribution of the arithmetic operation process.
そのため、デコード部36aは、エンコード部35aで得られたエンコード特徴量に基づいて、回答及び算術演算過程のそれぞれ確率分布を出力する。処理は以下の通りである。 Therefore, the decoding unit 36a outputs probability distributions for the answer and the arithmetic operation process based on the encoding features obtained by the encoding unit 35a. The process is as follows:
S131:デコード部36aは、学習フェーズにおいては、パラメータ学習部38aにより出力される正解回答情報および算術演算過程のトークン系列を出力ステップ毎に取得し、それぞれのトークン系列を結合することで出力系列を作成する。また、デコード部36aは、推論フェーズにおいては、テキスト生成部39において、出力ステップ毎に再帰的に出力されるトークンを結合したものを出力系列とする。また、デコード部36aは、学習フェーズには、系列の開始記号と終端記号を付与し、推論フェーズには、系列の開始記号のみを付与する。本実施形態においては、一例として開始記号に[CLS]、終端記号に[EOS]記号を付与する。さらに、本実施形態においては、トークナイズ処理の一例として、参考文献3に示されるByte-level BPEを用いる。 S131: In the learning phase, the decoding unit 36a acquires the correct answer information and the token sequence of the arithmetic operation process output by the parameter learning unit 38a for each output step, and creates an output sequence by combining each token sequence. Furthermore, in the inference phase, the decoding unit 36a combines the tokens recursively output for each output step in the text generation unit 39 to create an output sequence. Furthermore, the decoding unit 36a assigns a start symbol and a terminal symbol to the sequence in the learning phase, and only assigns the start symbol to the sequence in the inference phase. In this embodiment, as an example, the start symbol is assigned the symbol [CLS], and the terminal symbol is assigned the symbol [EOS]. Furthermore, in this embodiment, the Byte-level BPE shown in Reference 3 is used as an example of tokenization processing.
S132:デコード部36aは、出力系列をエンコード部35aと同様に、以下の埋め込みに変換する。 S132: The decoding unit 36a converts the output sequence into the following embedding, similar to the encoding unit 35a.
ここで、 Here,
S133:デコード部36aは、出力トークンの表現を S133: The decoding unit 36a converts the representation of the output token into
パラメータ学習部38aは、出力系列情報(回答情報の出力確率分布情報、算術演算過程の出力確率分布情報)、正解情報(正解回答情報、算術演算過程情報)を入力して、パラメータ更新情報、トークナイズ処理済み正解回答情報、トークナイズ処理済み算術演算過程情報を出力する。但し、正解情報としては、トークナイズ処理済みの情報であってもよい。 The parameter learning unit 38a inputs output sequence information (output probability distribution information of answer information, output probability distribution information of arithmetic operation process) and correct answer information (correct answer information, arithmetic operation process information), and outputs parameter update information, tokenized correct answer information, and tokenized arithmetic operation process information. However, the correct answer information may also be tokenized information.
そのため、パラメータ学習部38aは、正解情報(正解回答情報、算術演算過程情報)に対してトークナイズ処理を行う。但し、正解回答情報はトークナイズ処理済みの情報を入力としてもよい。また、算術演算過程情報は、別の処理部(例えばデータ拡張部33)によってトークナイズ処理が行われた情報であってもよい。本実施形態においては、トークナイズ処理の一例として、参考文献3に示されるByte-level BPEを用いる。 For this reason, the parameter learning unit 38a performs tokenization processing on the correct answer information (correct answer information, arithmetic operation process information). However, the correct answer information may be input as information that has already been tokenized. Furthermore, the arithmetic operation process information may be information that has been tokenized by another processing unit (for example, the data expansion unit 33). In this embodiment, the Byte-level BPE shown in Reference 3 is used as an example of tokenization processing.
パラメータ学習部38aは、出力系列情報及び正解情報に基づいて、以下の損失を算出し、最小化するように、機械学習モデル41aのモデルパラメータの更新を行う。 The parameter learning unit 38a calculates the following losses based on the output sequence information and correct answer information, and updates the model parameters of the machine learning model 41a to minimize them:
以上により、学習フェーズの機能構成の説明は終了する。 This concludes the explanation of the functional configuration of the learning phase.
<推論フェーズの機能構成>
続いて、推論フェーズにおける回答生成装置3aの各機能について説明する。図7は、推論フェーズにおける回答生成装置の機能構成図である。
<Functional configuration of the inference phase>
Next, the functions of the answer generation device 3a in the inference phase will be described. Fig. 7 is a functional configuration diagram of the answer generation device in the inference phase.
図7に示すように、回答生成装置3aは、入力部30、テキスト抽出部31a、物体抽出部32a、エンコード部35a、デコード部36a、テキスト生成部39b、及び出力部40aを有する。これら各部は、プログラムに基づき図2のCPU301による命令によって実現される機能である。また、RAM303又はSSD304には、学習済み機械学習モデル41bが記憶されている。なお、学習フェーズにおける機能構成と同様の機能構成については、同一の符号を付して説明を省略する。 As shown in FIG. 7, the answer generation device 3a has an input unit 30, a text extraction unit 31a, an object extraction unit 32a, an encoding unit 35a, a decoding unit 36a, a text generation unit 39b, and an output unit 40a. Each of these units has a function realized by instructions from the CPU 301 in FIG. 2 based on a program. In addition, a trained machine learning model 41b is stored in the RAM 303 or the SSD 304. Note that functional components similar to those in the learning phase are assigned the same reference numerals and will not be described again.
テキスト生成部39は、デコード部36aからの出力系列情報を入力して、回答情報、及び算術演算過程情報を出力する。第1の実施形態の出力系列情報は、回答情報の出力確率分布情報、及び算術演算過程の出力確率分布情報である。 The text generation unit 39 inputs output sequence information from the decoding unit 36a and outputs answer information and arithmetic operation process information. In the first embodiment, the output sequence information is output probability distribution information for the answer information and output probability distribution information for the arithmetic operation process.
そのため、テキスト生成部39は、出力系列情報に含まれる回答情報の出力確率分布情報及び算術演算過程の出力確率分布情報を基に、回答情報及び算術演算過程情報を再帰的に生成する。テキスト生成部39は、出力処理毎に確率分布の最大となる単語を選択、又は、確率分布に従ってサンプリングにより単語を生成し、文末トークン[EOS]が生成された場合に単語の生成を終了する。 For this reason, the text generation unit 39 recursively generates answer information and arithmetic operation process information based on the output probability distribution information of the answer information and the output probability distribution information of the arithmetic operation process included in the output sequence information. For each output process, the text generation unit 39 selects the word with the maximum probability distribution, or generates words by sampling according to the probability distribution, and terminates word generation when the end-of-sentence token [EOS] is generated.
出力部40aは、テキスト生成部39によって出力された回答情報及び算術演算過程情報に基づいて、回答生成装置3aから推論結果を出力する。出力する例としては、図2の外部機器接続I/F305に接続されたディスプレイに表示させる場合、ネットワークI/F306を介して通信端末5等に送信する場合等が挙げられる。 The output unit 40a outputs the inference result from the answer generation device 3a based on the answer information and arithmetic operation process information output by the text generation unit 39. Examples of output include displaying the result on a display connected to the external device connection I/F 305 in Figure 2, or transmitting the result to a communication terminal 5 or the like via the network I/F 306.
〔回答生成装置の処理又は動作〕
続いて、図8及び図9を用いて、回答生成装置3aの学習フェーズ及び推論フェーズにおける処理又は動作について説明する。
[Processing or operation of the answer generation device]
Next, the processing or operation of the answer generation device 3a in the learning phase and inference phase will be described with reference to FIGS.
<学習フェーズにおける処理又は動作>
図8は、学習フェーズにおいて回答生成装置が実行する機械学習方法を示すフローチャートである。
<Processing or Operation in the Learning Phase>
FIG. 8 is a flowchart showing the machine learning method executed by the answer generation device in the learning phase.
S11:入力部30は、通信端末7から又は直接的に、学習データ(正解回答情報、文書画像、質問文)を入力する。 S11: The input unit 30 inputs learning data (correct answer information, document image, question text) from the communication terminal 7 or directly.
S12:テキスト抽出部31aは文書画像からテキスト情報を抽出し、物体抽出部32aは文書情報から物体情報を抽出する。 S12: The text extraction unit 31a extracts text information from the document image, and the object extraction unit 32a extracts object information from the document information.
S13:データ拡張部33は算術演算過程情報を生成する。 S13: The data extension unit 33 generates arithmetic operation process information.
S14:エンコード部35aはエンコード特徴量を生成する。 S14: The encoding unit 35a generates encoding features.
S15:デコード部36aは回答情報及び算術演算過程情報を生成する。 S15: The decoding unit 36a generates answer information and arithmetic operation process information.
S16:パラメータ学習部38aは損失を計算してパラメータを更新する。 S16: The parameter learning unit 38a calculates the loss and updates the parameters.
S17:パラメータ学習部38aは未処理データがあるかを判断する。そして、未処理データがある場合には(S17;YES)、処理S11に戻る。一方、未処理データがない場合には(S17;NO)、学習フェーズの処理は終了する。 S17: The parameter learning unit 38a determines whether there is unprocessed data. If there is unprocessed data (S17; YES), the process returns to S11. On the other hand, if there is no unprocessed data (S17; NO), the learning phase ends.
以上により、学習フェーズの処理又は動作の説明は終了する。 This concludes the explanation of the learning phase processing or operation.
<推論フェーズにおける処理又は動作>
図9は、推論フェーズにおいて回答生成装置が実行する回答生成方法を示すフローチャートである。
<Processing or Operation in the Inference Phase>
FIG. 9 is a flowchart showing an answer generation method executed by the answer generation device in the inference phase.
S21:入力部30aは、通信端末7から又は直接的に、入力データ(文書画像、質問文)を入力する。 S21: The input unit 30a inputs input data (document image, question text) from the communication terminal 7 or directly.
S22:テキスト抽出部31aは文書画像からテキスト情報を抽出し、物体抽出部32aは文書情報から物体情報を抽出する。 S22: The text extraction unit 31a extracts text information from the document image, and the object extraction unit 32a extracts object information from the document information.
S23:エンコード部35aはエンコード特徴量を生成する。 S23: The encoding unit 35a generates encoding features.
S24:テキスト生成部39は回答情報及び算術演算過程情報を生成する。 S24: The text generation unit 39 generates answer information and arithmetic operation process information.
S25:テキスト生成部39は文末記号が出力されたかを判断する。そして、文末記号が出力されない場合には(S25;NO)、処理S24に戻る。一方、文末記号が出力された場合には(S25;YES)、処理S26に進む。 S25: The text generation unit 39 determines whether a sentence-end symbol has been output. If a sentence-end symbol has not been output (S25; NO), the process returns to step S24. On the other hand, if a sentence-end symbol has been output (S25; YES), the process proceeds to step S26.
S26:出力部40は、回答情報及び算術演算過程情報を含む推論結果の情報を出力する。 S26: The output unit 40 outputs information on the inference result, including answer information and arithmetic operation process information.
以上により、推論フェーズの処理又は動作の説明が終了する。 This concludes the explanation of the processing or operation of the inference phase.
〔第1の実施形態の実験条件及び実験結果〕
続いて、本実施形態の実験条件及び実験結果について説明する。
[Experimental conditions and results of the first embodiment]
Next, the experimental conditions and results of this embodiment will be described.
<実験条件>
(実験設定)
事前学習とFine-tuningの両方でバッチサイズ64とし、回答生成装置3aは、30エポック学習した。Adam(参考文献8)を用いて最適化し学習率は「3e-5」とした。vobj,wobj,wocr,wtaskの最大長をそれぞれ、36,20,430,40 とした。開発、テストデータにおける評価はBERT-{base,large}を事前学習時の重みの初期値とした。また、large は、baseの実験を基にハイパーパラメータを設定した。
<参考文献8>Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
(評価指標)
ICDAR 2021 Competition で採用されたANLS(参考文献9)(予測文と正解文集合との平均編集距離)を用いる。また、算術演算を必要とする例に絞った(開発データの17.4%)際のANLS をANUM と示す。
<参考文献9>Ali Furkan Biten, Ruben Tito, Andres Mafla, Lluis Gomezi Bigorda, Marcal Rusinol, C. V. Jawahar, Ernest Valveny, and Dimosthenis Karatzas. Scene text visual question answering.In ICCV, pp. 4290-4300, 2019.
<実験結果>
図19は、第1、第2の実施形態に係り、実験結果を示す表である。図19に示すように、表の2行目「BERT w/o ADA」及び5行目の「IG-BERT w/o SRP + ADA」に示すように、算術演算過程の概念を用いることで、用いない従来に比べて、ANLS及びANUMの値が減少した。
<Experimental conditions>
(Experimental Setup)
The batch size was set to 64 for both pre-training and fine-tuning, and the answer generation device 3a was trained for 30 epochs. Optimization was performed using Adam (Reference 8), with a learning rate of 3e-5. The maximum lengths of v obj , w obj , w ocr , and w task were set to 36, 20, 430, and 40, respectively. For evaluation on development and test data, BERT-{base,large} was used as the initial weight values during pre-training. Additionally, for large, the hyperparameters were set based on the base experiment.
<Reference 8> Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
(Evaluation indicators)
We use the ANLS (Reference 9) (average edit distance between predicted sentences and the set of ground truth sentences) adopted in the ICDAR 2021 Competition. ANUM denotes the ANLS when limited to examples requiring arithmetic operations (17.4% of the development data).
<Reference 9> Ali Furkan Biten, Ruben Tito, Andres Mafla, Lluis Gomezi Bigorda, Marcal Rusinol, CV Jawahar, Ernest Valveny, and Dimosthenis Karatzas. Scene text visual question answering.In ICCV, pp. 4290-4300, 2019.
<Experimental Results>
19 is a table showing the experimental results according to the first and second embodiments. As shown in the second row "BERT w/o ADA" and the fifth row "IG-BERT w/o SRP + ADA" in the table, by using the concept of arithmetic operation process, the values of ANLS and ANUM were reduced compared to the conventional case where the concept was not used.
〔第1の実施形態の効果〕
以上説明したように第1の実施形態によれば、回答生成装置3aが回答情報で必要な算術演算過程を生成するために、系列変換部20aが機械学習モデル41aを用いて、学習フェーズには回答情報で必要な算術演算過程を生成するよう学習を行う。これにより、回答生成装置3aによって文書画像に含まれる数値データの理解能力が向上し、従来技術よりも高い性能で算術演算を伴う回答情報の生成が可能になる。
[Effects of the First Embodiment]
As described above, according to the first embodiment, in order for the answer generation device 3a to generate arithmetic operation processes required for answer information, the sequence conversion unit 20a uses the machine learning model 41a to perform learning in the learning phase to generate arithmetic operation processes required for answer information. This improves the answer generation device 3a's ability to understand numerical data included in document images, making it possible to generate answer information involving arithmetic operations with higher performance than conventional techniques.
また、データ拡張部は、複数のテンプレートを用意し、所定のテンプレートを用いることで、算術演算過程情報を自動で生成する。これにより、算術演算過程の正解回答情報を人手で作成する場合に比べて、学習データの作成のコストを下げることができる。 The data extension unit also prepares multiple templates and automatically generates arithmetic operation process information by using a predetermined template. This reduces the cost of creating training data compared to manually creating correct answer information for arithmetic operation processes.
また、文書画像に含まれる物体(アイコン、グラフなど)及びテキスト(60%など)の配置関係を理解することは、システムが文書画像を理解して質問応答を行う上で、非常に重要な要素の一つである。本実施形態の回答生成装置3aは、実世界に多数存在する視覚的に表現された文書(インフォグラフィックやPDF文書、HTML文書など)を知識源として理解し、算術演算を伴う質問応答を行うことが可能となる。 Furthermore, understanding the positional relationships between objects (icons, graphs, etc.) and text (e.g., 60%) contained in a document image is one of the most important factors for a system to understand document images and perform question-answering. The answer generation device 3a of this embodiment is able to understand the many visually represented documents (infographics, PDF documents, HTML documents, etc.) that exist in the real world as knowledge sources and perform question-answering involving arithmetic operations.
●第2の実施形態
続いて、図10乃至図15を用いて、本発明の第2の実施形態について説明する。なお、質問文を示す質問テキスト及びテキストを含む文書画像を入力として、文書画像の内容に基づいて質問に対する回答情報を生成する従来技術に対して、本発明の第2の実施形態に係る回答生成装置3bは特定の改善を提供するものであり、ニューラルネットワークを用いた回答情報の生成に係る技術分野の向上を示すものである。また、本実施形態に係る通信システムの全体構成、及びハードウェア構成は、第1の実施形態と同様であるため、説明を省略する。更に、図10に学習フェーズの機能構成、図15に推論フェーズの機能構成を示すが、回答生成装置3bは、図10と図13の各部をまとめて有していてもよい。
Second Embodiment Next, a second embodiment of the present invention will be described using FIGS. 10 to 15 . Compared to conventional techniques that use question text indicating a question sentence and a document image containing the text as input and generate answer information to a question based on the content of the document image, the answer generation device 3 b according to the second embodiment of the present invention provides specific improvements and represents an advancement in the technical field related to generating answer information using a neural network. The overall configuration and hardware configuration of the communication system according to this embodiment are similar to those of the first embodiment, and therefore will not be described here. Furthermore, while FIG. 10 shows the functional configuration of the learning phase and FIG. 15 shows the functional configuration of the inference phase, the answer generation device 3 b may also include the components of FIGS. 10 and 13 collectively.
〔回答生成装置の機能構成〕
本実施形態に係る回答生成装置3bの学習フェーズ及び推論(予測)フェーズにおける機能構成について説明する。
[Functional configuration of the answer generation device]
The functional configuration of the answer generation device 3b according to this embodiment in the learning phase and inference (prediction) phase will be described.
<学習フェーズの機能構成>
図10を用いて、学習フェーズにおける回答生成装置3bの各機能について説明する。図10は、第2の実施形態に係り、学習フェーズにおける回答生成装置の機能構成図である。なお、回答生成装置3bは、回答生成装置3の一例である。
<Learning phase functional configuration>
The functions of the answer generation device 3b in the learning phase will be described with reference to Fig. 10. Fig. 10 is a functional configuration diagram of the answer generation device in the learning phase according to the second embodiment. Note that the answer generation device 3b is an example of the answer generation device 3.
図4に示すように、回答生成装置3bは、入力部30、テキスト抽出部31b、物体抽出部32b、正解配置関係導出部34、エンコード部35b、デコード部36b、配置関係予測部37、及びパラメータ学習部38bを有する。これら各部は、プログラムに基づき図2のCPU301による命令によって実現される機能である。また、RAM303又はSSD304には、機械学習モデル42a、及び機械学習済みの機械学習モデル(Wsrp)43が構築されている。なお、入力部30、テキスト抽出部31b、物体抽出部32b、及びエンコード部35bは、それぞれ第1の実施形態における、入力部30、テキスト抽出部31a、物体抽出部32a、及びエンコード部35bと同様の処理を実行するため、説明を省略する。 As shown in FIG. 4 , the answer generation device 3b includes an input unit 30, a text extraction unit 31b, an object extraction unit 32b, a correct layout relation derivation unit 34, an encoding unit 35b, a decoding unit 36b, a layout relation prediction unit 37, and a parameter learning unit 38b. These units are functions implemented by commands from the CPU 301 in FIG. 2 based on a program. A machine learning model 42a and a machine learning-completed machine learning model (W srp ) 43 are also built in the RAM 303 or the SSD 304. The input unit 30, the text extraction unit 31b, the object extraction unit 32b, and the encoding unit 35b perform the same processes as the input unit 30, the text extraction unit 31a, the object extraction unit 32a, and the encoding unit 35b in the first embodiment, respectively, and therefore description thereof will be omitted.
入力部30は、通信端末7を介して、回答生成装置3bに、学習データ(質問文、正解回答情報、及び文書画像の各データ)を入力する。または、入力部30は、回答生成装置3aに、直接、学習データを入力する。図11は、第2の実施形態に係り、正解配置関係導出部の処理の概念図である。例えば、図11に示すように、質問文は「女性のアイコンの上に書かれている数字は何か?」である。文書画像は、図5と同じである。正解回答情報は「3.6%」である。 The input unit 30 inputs the learning data (data on the question, correct answer information, and document image) to the answer generation device 3b via the communication terminal 7. Alternatively, the input unit 30 inputs the learning data directly to the answer generation device 3a. Figure 11 is a conceptual diagram of the processing of the correct layout relation derivation unit according to the second embodiment. For example, as shown in Figure 11, the question is "What number is written above the woman's icon?" The document image is the same as in Figure 5. The correct answer information is "3.6%."
正解配置関係導出部34は、テキスト抽出部31bから出力された文書テキストの矩形領域情報、及び物体抽出部32bから出力された物体の矩形領域情報を入力して、文書テキストの矩形選択領域情報(第1の矩形選択領域情報の一例)、物体の矩形選択領域情報(第2の矩形選択領域情報の一例)、及び正解配置関係情報を出力する。 The correct layout relation derivation unit 34 inputs the rectangular area information of the document text output from the text extraction unit 31b and the rectangular area information of the object output from the object extraction unit 32b, and outputs rectangular selection area information of the document text (an example of first rectangular selection area information), rectangular selection area information of the object (an example of second rectangular selection area information), and correct layout relation information.
そのため、正解配置関係導出部34は、物体の矩形領域情報及び文書テキストの矩形領域情報から、それぞれ1つずつランダム所定の物体の矩形領域情報及び所定の文書テキストの矩形領域情報を選択し、Mクラス(M=1以上であれば,何でも良い)からなる正解配置関係を定義して出力する。本実施形態においては、参考文献7で定義されたM=12の配置関係(図11の右下を参照)を用いる。ここでは、実線の矩形領域に対する破線の矩形領域の配置関係に関して、11クラスの配置関係分類タスクと、矩形の領域同士が離れすぎている1クラスの配置関係分類タスクによる合計12クラスの配置関係分類タスクを解く例が示されている。
<参考文献7>Ting Yao, Yingwei Pan, Yehao Li, Tao Mei: Exploring visual relationship for image captioning. ECCV18
また、エンコード部35b及びデコード部36bは、系列変換部20bを構成する。図12は、第2の実施形態に係り、系列変換部の詳細な構成図である。系列変換部20bは、ニューラルネットワークのモデルパラメータを用いて、入力された情報に基づいて出力系列情報を生成する。モデルの構成は、系列を入力として系列を生成するための一般的なencoder-decoderモデル形式を採用する。
Therefore, the correct layout relation derivation unit 34 randomly selects one rectangular area information of a predetermined object and one rectangular area information of a predetermined document text from the rectangular area information of the object and the rectangular area information of the document text, respectively, and defines and outputs a correct layout relation consisting of M classes (any number as long as M=1 or greater). In this embodiment, the layout relation of M=12 defined in Reference 7 (see the lower right of FIG. 11 ) is used. Here, an example is shown in which, regarding the layout relations of dashed-line rectangular areas with respect to solid-line rectangular areas, a layout relation classification task of 11 classes and one class in which the rectangular areas are too far apart are solved, for a total of 12 classes.
<Reference 7> Ting Yao, Yingwei Pan, Yehao Li, Tao Mei: Exploring visual relationship for image captioning. ECCV18
The encoding unit 35b and decoding unit 36b constitute a sequence transformation unit 20b. Fig. 12 is a detailed block diagram of the sequence transformation unit according to the second embodiment. The sequence transformation unit 20b uses neural network model parameters to generate output sequence information based on input information. The model configuration employs a general encoder-decoder model format for generating sequences using sequences as input.
系列変換部20bは、第1の実施形態における系列変換部20aのうち算術演算過程情報出力部358を有しないで、その他は有するため、同じ部等には同一の符号を付して説明を省略する。 The sequence conversion unit 20b does not have the arithmetic operation process information output unit 358 of the sequence conversion unit 20a in the first embodiment, but does have the other components. Therefore, the same components are assigned the same reference numerals and their descriptions are omitted.
デコード部36bは、基本的にデコード部36aと同様の処理を行うが、第2の実施形態ではデータ拡張部33がないため、算術演算過程情報の入力はなく、算術演算過程の出力確率分布情報の出力はない。 The decoding unit 36b basically performs the same processing as the decoding unit 36a, but since the second embodiment does not have a data extension unit 33, no arithmetic operation process information is input, and no output of output probability distribution information for the arithmetic operation process is performed.
配置関係予測部37は、正解配置関係導出部34によって導出された文書テキストの矩形選択領域情報及び物体の矩形選択領域情報、並びに、エンコード部35bから出力されたエンコード特徴量を入力して、予測配置関係分布情報を出力する。 The layout relationship prediction unit 37 inputs the rectangular selection area information of the document text and the rectangular selection area information of the object derived by the correct layout relationship derivation unit 34, as well as the encoded features output from the encoding unit 35b, and outputs predicted layout relationship distribution information.
そのため、配置関係予測部37は、エンコード特徴量を基に、画像文書内の物体とテキストとの配置関係を予測することで、配置関係を考慮した回答生成が可能となる。配置関係予測部37処理は以下の通りである。 Therefore, the layout relationship prediction unit 37 predicts the layout relationship between objects and text in the image document based on the encoded features, making it possible to generate answers that take layout relationships into account. The process of the layout relationship prediction unit 37 is as follows:
S211:配置関係予測部37は、物体とテキストに対応するエンコード特徴量(エンコード部35aに入力された文書画像および質問文の情報を、ニューラルネットワークのモデルパラメータに基づいて変換された所定次元のベクトル)から、正解配置関係導出部34によって出力された文書テキストの矩形選択領域情報及び物体の矩形選択領域情報に対応する特徴量eobj及びetextを獲得する。 S211: The layout relationship prediction unit 37 acquires feature quantities e obj and e text corresponding to the rectangular selection area information of the document text and the rectangular selection area information of the object output by the correct layout relationship derivation unit 34, from the encoded feature quantities corresponding to the object and the text (vectors of a predetermined dimension obtained by converting the information on the document image and question sentence input to the encoding unit 35 a based on the model parameters of the neural network).
S212:配置関係予測部37は、eobj及びetextを基に、予測配置関係分布情報を以下の通り算出して出力する。 S212: The layout relationship prediction unit 37 calculates and outputs predicted layout relationship distribution information based on e obj and e text as follows:
そのため、パラメータ学習部38bは、正解回答情報に対してトークナイズ処理を行う。但し、正解回答情報はトークナイズ処理済みの情報を入力としてもよい。本実施形態においては、トークナイズ処理の一例として、参考文献3に示されるByte-level BPEを用いる。 For this reason, the parameter learning unit 38b performs tokenization processing on the correct answer information. However, the correct answer information may be input as information that has already been tokenized. In this embodiment, the Byte-level BPE shown in Reference 3 is used as an example of tokenization processing.
パラメータ学習部38bは、出力系列情報及び正解情報に基づいて、以下の損失を算出し、最小化するように、機械学習モデル42aのモデルパラメータの更新を行う。 The parameter learning unit 38b calculates the following losses based on the output sequence information and correct answer information, and updates the model parameters of the machine learning model 42a to minimize them:
以上により、学習フェーズの機能構成の説明は終了する。 This concludes the explanation of the functional configuration of the learning phase.
<推論フェーズの機能構成>
続いて、推論フェーズにおける回答生成装置3bの各機能について説明する。図13は、推論フェーズにおける回答生成装置の機能構成図である。
<Functional configuration of the inference phase>
Next, the functions of the answer generation device 3b in the inference phase will be described. Fig. 13 is a functional configuration diagram of the answer generation device in the inference phase.
図7に示すように、回答生成装置3bは、入力部30、テキスト抽出部31b、物体抽出部32b、エンコード部35b、デコード部36b、テキスト生成部39b、及び出力部40bを有する。これら各部は、プログラムに基づき図2のCPU301による命令によって実現される機能である。また、RAM303又はSSD304には、学習済み機械学習モデル42bが記憶されている。なお、学習フェーズにおける機能構成と同様の機能構成については、同一の符号を付して説明を省略する。 As shown in FIG. 7, the answer generation device 3b has an input unit 30, a text extraction unit 31b, an object extraction unit 32b, an encoding unit 35b, a decoding unit 36b, a text generation unit 39b, and an output unit 40b. Each of these units has a function realized by instructions from the CPU 301 in FIG. 2 based on a program. In addition, the RAM 303 or the SSD 304 stores a trained machine learning model 42b. Note that functional components similar to those in the learning phase are assigned the same reference numerals and will not be described again.
テキスト生成部39bは、デコード部36aからの出力系列情報を入力して、回答情報を出力する。第2の実施形態の出力系列情報は、回答情報の出力確率分布情報である。 The text generation unit 39b inputs the output sequence information from the decoding unit 36a and outputs answer information. In the second embodiment, the output sequence information is output probability distribution information for the answer information.
そのため、テキスト生成部39bは、出力系列情報を基に、回答情報を再帰的に生成する。テキスト生成部39bは、出力ステップ毎に確率分布の最大となる単語を選択、又は確率分布に従ってサンプリングにより単語を生成し、文末トークン[EOS]が生成された場合に単語の生成を終了する。 For this reason, the text generation unit 39b recursively generates answer information based on the output sequence information. For each output step, the text generation unit 39b selects the word with the maximum probability distribution, or generates words by sampling according to the probability distribution, and ends word generation when the end-of-sentence token [EOS] is generated.
出力部40bは、テキスト生成部39によって出力された回答情報に基づいて、回答生成装置3bから推論結果を出力する。出力する例としては、図2の外部機器接続I/F305に接続されたディスプレイに表示させる場合、ネットワークI/F306を介して通信端末5等に送信する場合等が挙げられる。 The output unit 40b outputs the inference results from the answer generation device 3b based on the answer information output by the text generation unit 39. Examples of output include displaying the results on a display connected to the external device connection I/F 305 in Figure 2, or transmitting the results to a communication terminal 5 or the like via the network I/F 306.
〔回答生成装置の処理又は動作〕
続いて、図14及び図15を用いて、回答生成装置3bの学習フェーズ及び推論フェーズにおける処理又は動作について説明する。
[Processing or operation of the answer generation device]
Next, the processing or operation of the answer generation device 3b in the learning phase and inference phase will be described with reference to FIGS.
<学習フェーズにおける処理又は動作>
図14は、学習フェーズにおいて回答生成装置が実行する機械学習方法を示すフローチャートである。
<Processing or Operation in the Learning Phase>
FIG. 14 is a flowchart showing the machine learning method executed by the answer generation device in the learning phase.
S31:入力部30は、通信端末7から又は直接的に、学習データ(正解回答情報、文書画像、質問文)を入力する。 S31: The input unit 30 inputs learning data (correct answer information, document image, question text) from the communication terminal 7 or directly.
S32:テキスト抽出部31bは文書画像からテキスト情報を抽出し、物体抽出部32bは文書情報から物体情報を抽出する。 S32: The text extraction unit 31b extracts text information from the document image, and the object extraction unit 32b extracts object information from the document information.
S33:正解配置関係導出部34は正解配置関係を導出する。 S33: The correct layout relation derivation unit 34 derives the correct layout relation.
S34:エンコード部35bはエンコード特徴量を生成する。 S34: The encoding unit 35b generates encoding features.
S35:デコード部36bは回答情報を予測して回答情報の出力確率分布情報を出力し、配置関係予測部37は配置関係情を予測して予測配置関係分布情報を出力する。 S35: The decoding unit 36b predicts the answer information and outputs output probability distribution information for the answer information, and the layout relationship prediction unit 37 predicts the layout relationship information and outputs predicted layout relationship distribution information.
S36:パラメータ学習部38bは損失を計算してパラメータを更新する。 S36: The parameter learning unit 38b calculates the loss and updates the parameters.
S37:パラメータ学習部38bは未処理データがあるかを判断する。そして、未処理データがある場合には(S37;YES)、処理S31に戻る。一方、未処理データがない場合には(S37;NO)、学習フェーズの処理は終了する。 S37: The parameter learning unit 38b determines whether there is unprocessed data. If there is unprocessed data (S37; YES), the process returns to S31. On the other hand, if there is no unprocessed data (S37; NO), the learning phase ends.
以上により、学習フェーズの処理又は動作の説明は終了する。 This concludes the explanation of the learning phase processing or operation.
<推論フェーズにおける処理又は動作>
図15は、推論フェーズにおいて回答生成装置が実行する回答生成方法を示すフローチャートである。
<Processing or Operation in the Inference Phase>
FIG. 15 is a flowchart showing an answer generation method executed by the answer generation device in the inference phase.
S41:入力部30は、通信端末7から又は直接的に、入力データ(文書画像、質問文)を入力する。 S41: The input unit 30 inputs input data (document image, question text) from the communication terminal 7 or directly.
S42:テキスト抽出部31bは文書画像からテキスト情報を抽出し、物体抽出部32aは文書情報から物体情報を抽出する。 S42: The text extraction unit 31b extracts text information from the document image, and the object extraction unit 32a extracts object information from the document information.
S43:エンコード部35bはエンコード特徴量を生成する。 S43: The encoding unit 35b generates encoding features.
S44:テキスト生成部39は回答情報を生成する。 S44: The text generation unit 39 generates answer information.
S45:テキスト生成部39は文末記号が出力されたかを判断する。そして、文末記号が出力されない場合には(S45;NO)、処理S44に戻る。一方、文末記号が出力された場合には(S45;YES)、処理S46に進む。 S45: The text generation unit 39 determines whether a sentence-end symbol has been output. If a sentence-end symbol has not been output (S45; NO), the process returns to step S44. On the other hand, if a sentence-end symbol has been output (S45; YES), the process proceeds to step S46.
S46:出力部40bは、回答情報を含む推論結果の情報を出力する。 S46: The output unit 40b outputs information about the inference result, including the answer information.
以上により、推論フェーズの処理又は動作の説明が終了する。 This concludes the explanation of the processing or operation of the inference phase.
〔実験条件及び実験結果〕
続いて、第2の実施形態の実験条件及び実験結果について説明する。なお、第2の実施形態の実験条件は第1の実施形態と同様であるため省略する。
[Experimental conditions and results]
Next, the experimental conditions and results of the second embodiment will be described. Note that the experimental conditions of the second embodiment are the same as those of the first embodiment, and therefore will not be described here.
<実験結果>
図19に示すように、表の4行目「IG-BERT w/o SRP」に示すように、配置関係の概念を用いることで、用いない従来に比べて、ANLS及びANUMの値が減少した。
<Experimental Results>
As shown in FIG. 19, as shown in the fourth row of the table, "IG-BERT w/o SRP," by using the concept of layout relationship, the values of ANLS and ANUM were reduced compared to the conventional case where the concept was not used.
〔第2の実施形態の効果〕
以上説明したように第2の実施形態によれば、回答生成装置3bでは、回答情報の生成の機械学習に加えて、配置関係予測部37及びパラメータ学習部38bによって、文書画像内の物体とテキストとの配置関係に関する学習を行う。これにより、配置関係を考慮した回答情報の生成が可能となる。よって、回答生成装置3bにおける物体とテキストとの配置関係を理解する性能が向上し、従来技術よりも高い性能で文書画像を理解して質問に対する応答が可能になる。
[Effects of the second embodiment]
As described above, according to the second embodiment, in the answer generation device 3b, in addition to machine learning for generating answer information, the layout relationship prediction unit 37 and the parameter learning unit 38b perform learning on the layout relationship between objects and text in a document image. This makes it possible to generate answer information that takes the layout relationship into consideration. Therefore, the answer generation device 3b's ability to understand the layout relationship between objects and text is improved, making it possible to understand document images and respond to questions with higher performance than conventional techniques.
以上により、回答生成装置3bは、実世界に多数存在する視覚的に表現された文書(インフォグラフィック、PDF文書、HTML文書など)を知識源として理解し、質問応答を行うことが可能となる。 As a result, the answer generation device 3b can understand the many visually represented documents (infographics, PDF documents, HTML documents, etc.) that exist in the real world as knowledge sources and perform question and answering.
●補足
本発明は上述の実施形態に限定されるものではなく、以下に示すような構成又は処理(動作)であってもよい。
Supplementary Information The present invention is not limited to the above-described embodiment, and may have the following configurations or processes (operations).
(1)回答生成装置3a,3bはコンピュータとプログラムによっても実現できるが、このプログラムを(非一時的な)記録媒体に記録することも、通信ネットワーク100を介して提供することも可能である。 (1) The answer generation devices 3a and 3b can be realized using a computer and a program, but this program can also be recorded on a (non-temporary) recording medium or provided via the communication network 100.
(2)上記実施形態では、通信端末5の一例としてノート型パソコンが示されているが、これに限るものではなく、例えば、デスクトップパソコン、タブレット端末、スマートフォン、スマートウォッチ、カーナビゲーション装置、冷蔵庫、電子レンジ等であってもよい。 (3)各CPU301,501は、単一だけでなく、複数であってもよい。 (2) In the above embodiment, a notebook computer is shown as an example of the communication terminal 5, but this is not limited to this. For example, the communication terminal 5 may be a desktop computer, a tablet terminal, a smartphone, a smartwatch, a car navigation device, a refrigerator, a microwave oven, etc. (3) Each CPU 301, 501 may be a single CPU or multiple CPUs.
●付記項
上述の実施形態には、以下に示す発明としても表すことができる。
Supplementary Notes The above-described embodiment can also be expressed as the following inventions.
〔付記項1〕
文書画像の内容に基づいて質問文に対する回答情報を生成するプロセッサを有する回答生成装置であって、
前記プロセッサは、
前記文書画像中のテキスト情報及び前記文書画像中の物体を示す物体情報、並びに前記質問文に基づいて、エンコード特徴量を出力するエンコード処理と、
前記エンコード特徴量に基づいて、前記回答情報の出力確率分布情報を出力するデコード処理と、
前記文書画像における複数の文書テキストの矩形領域を示す矩形領域情報から選択した所定の文書テキストの矩形領域を示す第1の矩形選択領域情報を導出し、前記文書画像における1以上の物体の矩形領域を示す矩形領域情報から選択した所定の物体の矩形領域を示す第2の矩形選択領域情報を導出すると共に、前記所定の物体に対する前記所定の文書テキストの配置関係を示す正解配置関係情報を導出する正解配置関係導出処理と、
前記エンコード特徴量に基づいて、前記第1の矩形選択領域情報に係る前記所定の文書テキストと前記第2の矩形選択領域情報に係る前記所定の物体との配置関係を予測することで、予測配置関係分布情報を出力する配置関係予測部と、
前記回答情報の出力確率分布情報、及び正解回答情報に基づいて(前記回答情報の出力確率分布情報が正解回答情報に近づくように)、並びに、前記予測配置関係分布情報、及び前記正解配置関係情報に基づいて(前記予測配置関係分布情報が前記正解配置関係情報に近づくように)、ニューラルネットワークのモデルパラメータの学習を行うパラメータ学習処理と、
を実行する回答生成装置。
[Additional Note 1]
An answer generation device having a processor that generates answer information to a question based on the content of a document image,
The processor:
an encoding process for outputting encoded features based on text information in the document image, object information indicating objects in the document image, and the question;
a decoding process for outputting output probability distribution information of the answer information based on the encoded feature;
a correct layout relationship derivation process that derives first rectangular selection area information indicating a rectangular area of a predetermined document text selected from rectangular area information indicating rectangular areas of a plurality of document texts in the document image, derives second rectangular selection area information indicating a rectangular area of a predetermined object selected from rectangular area information indicating rectangular areas of one or more objects in the document image, and derives correct layout relationship information indicating a layout relationship of the predetermined document text with respect to the predetermined object;
a layout relationship prediction unit that predicts a layout relationship between the predetermined document text related to the first rectangular selection area information and the predetermined object related to the second rectangular selection area information based on the encoded feature, and outputs predicted layout relationship distribution information;
a parameter learning process for learning model parameters of a neural network based on output probability distribution information of the answer information and correct answer information (so that the output probability distribution information of the answer information approaches the correct answer information), and based on the predicted layout relationship distribution information and the correct layout relationship information (so that the predicted layout relationship distribution information approaches the correct layout relationship information);
An answer generation device that executes the above.
〔付記項2〕
前記正解配置関係導出処理は、前記第1の矩形選択領域情報に係る前記所定の文書テキスト及び前記第2の矩形選択領域情報に係る前記所定の物体との配置関係が、所定の配置関係を表す複数のクラスのいずれに該当するかを予測することで前記正解配置関係情報を導出する処理を含む、付記項1に記載の回答生成装置。
[Additional note 2]
The answer generation device described in Appendix 1, wherein the correct layout relationship derivation process includes a process of deriving the correct layout relationship information by predicting to which of a plurality of classes representing a predetermined layout relationship the layout relationship between the specified document text related to the first rectangular selection area information and the specified object related to the second rectangular selection area information falls.
〔付記項3〕
付記項1又は2に記載の回答生成装置であって、
前記エンコード処理及びデコード処理は、前記パラメータ学習部による予め学習済みの前記モデルパラメータを用い、前記文書画像及び前記質問文に基づいて、前記回答情報の出力確率分布情報を出力する処理を含み、
前記プロセッサは、前記回答情報の出力確率分布情報に基づいて、前記回答情報を生成するテキスト生成処理を実行する、
回答生成装置。
[Additional note 3]
3. The response generation device according to claim 1 or 2,
the encoding process and the decoding process include a process of outputting output probability distribution information of the answer information based on the document image and the question sentence by using the model parameters previously learned by the parameter learning unit,
the processor executes a text generation process to generate the answer information based on output probability distribution information of the answer information.
Answer generator.
〔付記項4〕
文書画像の内容に基づいて質問文に対する回答情報を生成するプロセッサが実行する機械学習方法であって、
前記プロセッサは、
前記文書画像中のテキスト情報及び前記文書画像中の物体を示す物体情報、並びに前記質問文に基づいて、前記文書画像において前記質問文に対応する領域を示すベクトルであるエンコード特徴量を出力し、
前記エンコード特徴量に基づいて、前記回答情報の出力確率分布情報を出力し、
前記文書画像における複数の文書テキストの矩形領域を示す矩形領域情報から選択した所定の文書テキストの矩形領域を示す第1の矩形選択領域情報を導出し、前記文書画像における1以上の物体の矩形領域を示す矩形領域情報から選択した所定の物体の矩形領域を示す第2の矩形選択領域情報を導出すると共に、前記所定の物体に対する前記所定の文書テキストの配置関係を示す正解配置関係情報を導出し、
前記エンコード特徴量に基づいて、前記第1の矩形選択領域情報に係る前記所定の文書テキストと前記第2の矩形選択領域情報に係る前記所定の物体との配置関係を予測することで、予測配置関係分布情報を出力し、
前記回答情報の出力確率分布情報、及び正解回答情報、並びに、前記予測配置関係分布情報、及び前記正解配置関係情報に基づいて、ニューラルネットワークのモデルパラメータの機械学習を行う、
機械学習方法。
[Additional note 4]
A machine learning method executed by a processor that generates answer information to a question based on the content of a document image,
The processor:
outputting an encoded feature, which is a vector indicating a region in the document image corresponding to the question, based on text information in the document image, object information indicating an object in the document image, and the question;
outputting output probability distribution information of the answer information based on the encoded feature;
deriving first rectangular selection area information indicating a rectangular area of a predetermined document text selected from rectangular area information indicating rectangular areas of a plurality of document texts in the document image; deriving second rectangular selection area information indicating a rectangular area of a predetermined object selected from rectangular area information indicating rectangular areas of one or more objects in the document image; and deriving correct layout relationship information indicating a layout relationship of the predetermined document text with respect to the predetermined object;
predicting a layout relationship between the predetermined document text related to the first rectangular selection area information and the predetermined object related to the second rectangular selection area information based on the encoded feature, and outputting predicted layout relationship distribution information;
performing machine learning of model parameters of a neural network based on output probability distribution information of the answer information, correct answer information, the predicted layout relationship distribution information, and the correct layout relationship information;
Machine learning methods.
〔付記項5〕
コンピュータに、付記項1乃至3のいずれか一項に記載の回答生成装置を実現させるプログラムが記録された非一時的記録媒体。
[Additional Note 5]
A non-transitory recording medium having recorded thereon a program for causing a computer to implement the answer generation device according to any one of appended items 1 to 3.
1 通信システム
3 回答生成装置
3a 回答生成装置
3b 回答生成装置
5 通信端末
30 入力部
31a,31b テキスト抽出部
32a,32b 物体抽出部
33 データ拡張部
34 正解配置関係導出部
35a,35b エンコード部
36a,36b デコード部
37 配置関係予測部
38a,38b パラメータ学習部
39a,39b テキスト生成部
40a,44b 出力部
20a 系列変換部
20b 系列変換部
41a 機械学習モデル
41b 学習済み機械学習モデル
42a 機械学習モデル
42b 学習済み機械学習モデル
1 Communication system 3 Answer generation device 3a Answer generation device 3b Answer generation device 5 Communication terminal 30 Input unit 31a, 31b Text extraction unit 32a, 32b Object extraction unit 33 Data expansion unit 34 Correct layout relationship derivation unit 35a, 35b Encoding unit 36a, 36b Decoding unit 37 Layout relationship prediction unit 38a, 38b Parameter learning unit 39a, 39b Text generation unit 40a, 44b Output unit 20a Sequence conversion unit 20b Sequence conversion unit 41a Machine learning model 41b Trained machine learning model 42a Machine learning model 42b Trained machine learning model
Claims (5)
前記文書画像中のテキスト情報及び前記文書画像中の物体を示す物体情報、並びに前記質問文に基づいて、エンコード特徴量を出力するエンコード部と、
前記エンコード特徴量に基づいて、前記回答情報の出力確率分布情報を出力するデコード部と、
前記文書画像における複数の文書テキストの矩形領域を示す矩形領域情報から選択した所定の文書テキストの矩形領域を示す第1の矩形選択領域情報を導出し、前記文書画像における物体の矩形領域を示す矩形領域情報から選択した所定の物体の矩形領域を示す第2の矩形選択領域情報を導出すると共に、前記所定の物体に対する前記所定の文書テキストの配置関係を示す正解配置関係情報を導出する正解配置関係導出部と、
前記エンコード特徴量に基づいて、前記第1の矩形選択領域情報に係る前記所定の文書テキストと前記第2の矩形選択領域情報に係る前記所定の物体との配置関係を予測することで、予測配置関係分布情報を出力する配置関係予測部と、
前記回答情報の出力確率分布情報、及び正解回答情報、並びに、前記予測配置関係分布情報、及び前記正解配置関係情報に基づいて、ニューラルネットワークのモデルパラメータの学習を行うパラメータ学習部と、
を有する回答生成装置。 An answer generation device that generates answer information to a question based on the content of a document image,
an encoding unit that outputs encoded features based on text information in the document image, object information indicating an object in the document image, and the question;
a decoding unit that outputs output probability distribution information of the answer information based on the encoded feature;
a correct layout relation derivation unit that derives first rectangular selection area information indicating a rectangular area of a predetermined document text selected from rectangular area information indicating rectangular areas of a plurality of document texts in the document image, derives second rectangular selection area information indicating a rectangular area of a predetermined object selected from rectangular area information indicating rectangular areas of objects in the document image, and derives correct layout relation information indicating a layout relation of the predetermined document text with respect to the predetermined object;
a layout relationship prediction unit that predicts a layout relationship between the predetermined document text related to the first rectangular selection area information and the predetermined object related to the second rectangular selection area information based on the encoded feature, and outputs predicted layout relationship distribution information;
a parameter learning unit that learns model parameters of a neural network based on output probability distribution information of the answer information, correct answer information, the predicted layout relationship distribution information, and the correct layout relationship information;
An answer generation device having the above.
前記エンコード部及び前記デコード部は、前記パラメータ学習部による予め学習済みの前記モデルパラメータを用い、前記文書画像及び前記質問文に基づいて、前記回答情報の出力確率分布情報を出力する処理を含み、
前記回答情報の出力確率分布情報に基づいて、前記回答情報を生成するテキスト生成部を有する
回答生成装置。 3. The response generation device according to claim 1,
the encoding unit and the decoding unit include a process of outputting output probability distribution information of the answer information based on the document image and the question sentence, using the model parameters previously learned by the parameter learning unit;
an answer generation device comprising: a text generation unit that generates the answer information based on output probability distribution information of the answer information;
前記回答生成装置は、
前記文書画像中のテキスト情報及び前記文書画像中の物体を示す物体情報、並びに前記質問文に基づいて、エンコード特徴量を出力し、
前記エンコード特徴量に基づいて、前記回答情報の出力確率分布情報を出力し、
前記文書画像における複数の文書テキストの矩形領域を示す矩形領域情報から選択した所定の文書テキストの矩形領域を示す第1の矩形選択領域情報を導出し、前記文書画像における物体の矩形領域を示す矩形領域情報から選択した所定の物体の矩形領域を示す第2の矩形選択領域情報を導出すると共に、前記所定の物体に対する前記所定の文書テキストの配置関係を示す正解配置関係情報を導出し、
前記エンコード特徴量に基づいて、前記第1の矩形選択領域情報に係る前記所定の文書テキストと前記第2の矩形選択領域情報に係る前記所定の物体との配置関係を予測することで、予測配置関係分布情報を出力し、
前記回答情報の出力確率分布情報、及び正解回答情報、並びに、前記予測配置関係分布情報、及び前記正解配置関係情報に基づいて、ニューラルネットワークのモデルパラメータの学習を行う、
機械学習方法。 A machine learning method executed by an answer generation device that generates answer information to a question based on the content of a document image,
The answer generation device
outputting encoded features based on text information in the document image, object information indicating an object in the document image, and the question;
outputting output probability distribution information of the answer information based on the encoded feature;
deriving first rectangular selection area information indicating a rectangular area of a predetermined document text selected from rectangular area information indicating rectangular areas of a plurality of document texts in the document image; deriving second rectangular selection area information indicating a rectangular area of a predetermined object selected from rectangular area information indicating rectangular areas of objects in the document image; and deriving correct layout relationship information indicating a layout relationship of the predetermined document text with respect to the predetermined object;
predicting a layout relationship between the predetermined document text related to the first rectangular selection area information and the predetermined object related to the second rectangular selection area information based on the encoded feature, and outputting predicted layout relationship distribution information;
learning model parameters of a neural network based on output probability distribution information of the answer information, correct answer information, the predicted layout relationship distribution information, and the correct layout relationship information;
Machine learning methods.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022141244A JP7729291B2 (en) | 2022-09-06 | 2022-09-06 | Answer generation device, machine learning method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022141244A JP7729291B2 (en) | 2022-09-06 | 2022-09-06 | Answer generation device, machine learning method, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2024036781A JP2024036781A (en) | 2024-03-18 |
| JP7729291B2 true JP7729291B2 (en) | 2025-08-26 |
Family
ID=90273258
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022141244A Active JP7729291B2 (en) | 2022-09-06 | 2022-09-06 | Answer generation device, machine learning method, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7729291B2 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021157234A1 (en) | 2020-02-06 | 2021-08-12 | Mitsubishi Electric Corporation | Scene-aware video dialog |
| WO2021171732A1 (en) | 2020-02-28 | 2021-09-02 | 日本電信電話株式会社 | Learning device, text generating device, learning method, text generating method, and program |
| JP2022013643A (en) | 2020-06-30 | 2022-01-18 | 北京百度網訊科技有限公司 | Image question answering method, device, computer device, medium, and program |
-
2022
- 2022-09-06 JP JP2022141244A patent/JP7729291B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021157234A1 (en) | 2020-02-06 | 2021-08-12 | Mitsubishi Electric Corporation | Scene-aware video dialog |
| WO2021171732A1 (en) | 2020-02-28 | 2021-09-02 | 日本電信電話株式会社 | Learning device, text generating device, learning method, text generating method, and program |
| JP2022013643A (en) | 2020-06-30 | 2022-01-18 | 北京百度網訊科技有限公司 | Image question answering method, device, computer device, medium, and program |
Non-Patent Citations (1)
| Title |
|---|
| 田中 涼太 他,VisualMRC:文書画像に対する機械読解,言語処理学会第27回年次大会 発表論文集,日本,言語処理学会,2021年03月08日,p.831-836 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2024036781A (en) | 2024-03-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110390009B (en) | Generating topic-based summaries of text content | |
| CN113449085B (en) | Multi-mode emotion classification method and device and electronic equipment | |
| JP7104059B2 (en) | Probability-based Gaida | |
| JP6501874B2 (en) | Multilingual Image Question Answering | |
| CN108647233B (en) | Answer sorting method for question-answering system | |
| US20220309597A1 (en) | Computer vision framework for real estate | |
| US11678012B2 (en) | Apparatus and method for user interest information generation | |
| CN111368531B (en) | Translation text processing method and device, computer equipment and storage medium | |
| KR102361616B1 (en) | Method and apparatus for recognizing named entity considering context | |
| US20250200955A1 (en) | Model training method and apparatus, device, storage medium, and product | |
| WO2023134085A1 (en) | Question answer prediction method and prediction apparatus, electronic device, and storage medium | |
| CN114416995A (en) | Information recommendation method, device and equipment | |
| CN119760650B (en) | A web page parsing method and system based on artificial intelligence | |
| CN115510193B (en) | Query result vectorization method, query result determination method and related devices | |
| WO2026016688A1 (en) | Video segmentation method, server, storage medium, and program product | |
| CN117011737A (en) | A video classification method, device, electronic device and storage medium | |
| CN115186085A (en) | Reply content processing method and interaction method of media content interaction content | |
| KR102673273B1 (en) | Method and apparatus for correcting text | |
| CN116563581A (en) | Image detection model training method and device | |
| CN114707633B (en) | Feature extraction method, device, electronic equipment and storage medium | |
| JP7729291B2 (en) | Answer generation device, machine learning method, and program | |
| JP7726159B2 (en) | Answer generation device, machine learning method, and program | |
| CN114610878B (en) | Model training method, computer device and computer readable storage medium | |
| Patel | Efficient image captioning method using deep learning | |
| CN114610819A (en) | Establishment method of character attribute relation extraction database in long text, entity extraction method, device and database |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A80 | Written request to apply exceptions to lack of novelty of invention |
Free format text: JAPANESE INTERMEDIATE CODE: A80 Effective date: 20220912 |
|
| RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20240701 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240731 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20250626 |
|
| 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: 20250715 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250728 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7729291 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |