Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Graph Neural Network を用いた レイアウトつき文書からの情報抽出 / Information extraction from visual documents using Graph Neural Network

Graph Neural Network を用いた レイアウトつき文書からの情報抽出 / Information extraction from visual documents using Graph Neural Network

■イベント 
:ML勉強会
https://sansan.connpass.com/event/211420/

■登壇概要
タイトル:Graph Neural Network を用いたレイアウトつき文書からの情報抽出
発表者: 
DSOC R&D研究員  保坂 大樹

▼Twitter
https://twitter.com/SansanRandD

Sansan DSOC

May 14, 2021
Tweet

More Decks by Sansan DSOC

Other Decks in Science

Transcript

  1. Data Strategy and Operation Center ⾃⼰紹介 • 2020/03 早稲⽥⼤学⼤学院創造理⼯学研究科経営システム⼯学専攻 修了

    • 2020/04 Sansan株式会社 ⼊社 保坂 ⼤樹 Taiju Hosaka Sansan 株式会社 DSOC(Data Strategy & Operation Center) R&D Data Analysis Group 研究員 オンライン名刺
  2. Data Strategy and Operation Center 今回紹介する論⽂ Merge and Recognize: A

    Geometry and 2D Context Aware Graph Model for Named Entity Recognition from Visual Documents (2020) - Chuwei Luo, Yongpan Wang, Qi Zheng, Liangcheng Li, Feiyu Gao, Shiyu Zhang - アリババグループ、浙江⼤学 - 学習されたレイアウト特徴からセグメントのマージ判定を⾏うレイヤーを提案 GraphIE: A Graph-Based Framework for Information Extraction (2019) - Yujie Qian, Enrico Santus, Zhijing Jin, Jiang Guo, Regina Barzilay - MITコンピュータ科学・⼈⼯知能研究所、⾹港⼤学 - GNN を⽤いて情報抽出のためにレイアウト特徴を学習するフレームワークを提案 ※題材とした論⽂や発表内容は、Sansan株式会社のサービスを説明するものではありません。
  3. Data Strategy and Operation Center ⽂書からの情報抽出 ニュース記事 請求書 ・組織の名称 ⋮

    Algorithm 特定のドメインの⽂書データから、あらかじめ定義された興味のある情報を抽出する Input Output ・⽀払いの期限 ⋮
  4. Data Strategy and Operation Center Sansan株式会社 は、2021年5⽉14⽇ に ML勉強会 をオンライン開催しました。

    ⽂書からの情報抽出における出⼒ ・組織の名称 ・開催⽇ ・イベントの名称 Output 組織の名称 開催⽇ イベントの名称 トークン単位でタグを付与する
  5. Data Strategy and Operation Center ⽂書からの情報抽出で⽤いられるアルゴリズム Bidirectional LSTM-CRF (Huang et

    al. 2015) - 深層学習によるアプローチ > ⽂脈を考慮したタグづけを⾏う 1. トークン系列のエンコーディング 2. タグ系列へのデコーディング トークン単位でタグを予測する Algorithm
  6. Data Strategy and Operation Center レイアウトつき⽂書からの情報抽出 Input Output レイアウトに従う⽂書の場合を考える 請求書

    請求⽇ ⽀払い期限 請求⾦額 振込⼝座 2021年5⽉14⽇ 10,000 2021年5⽉31⽇ ・⽀払いの期限 ⽀払いの期限 請求書 Sansan銀⾏ 333
  7. Data Strategy and Operation Center レイアウトつき⽂書からの情報抽出の課題 請求書などの⽂書は、テキストとレイアウトの組み合わせで情報を伝達する - テキストのみを⼊⼒とした場合、推論に必要な情報が不⾜する >

    上の例では、以下の⽂字列からタグを予測することになる “請求書請求⽇請求⾦額振込⼝座⽀払い期限2021年5⽉14⽇10,000Sansan銀⾏3-3-32021年5⽉31⽇” 請求書 請求⽇ ⽀払い期限 請求⾦額 振込⼝座 2021年5⽉14⽇ 10,000 2021年5⽉31⽇ ⽀払いの期限 Sansan銀⾏ 333
  8. Data Strategy and Operation Center レイアウト情報の利⽤ グラフベースの⼿法 (Liu et al.

    2019) グリッドベースの⼿法 (Zhao et al. 2019) ⾔語モデルベースの⼿法 (Xu et al. 2020) 表現学習ベースの⼿法 (Majumder et al. 2020)
  9. Data Strategy and Operation Center 情報抽出アルゴリズムのフレームワーク グラフベースの情報抽出アルゴリズムは、以下の⼿順で推論を⾏う 1. ⼊⼒となる⽂書を受け取り、テキストと座標の組 (セグメント)

    の集合に変換する 2. セグメント間にエッジを定義し、グラフを構築する 3. Graph Neural Network により、レイアウトを考慮した各セグメントの特徴を獲得する 4. セグメントの特徴とテキストの特徴を⼊⼒とし、各トークンのタグ系列を予測する 1. 構造化 2. グラフ化 3. GNN 4. タグ予測 請求⾦額 10,000
  10. Data Strategy and Operation Center ⼊⼒⽂書からのテキストと位置の抽出 請求書 請求⽇ ⽀払い期限 請求⾦額

    振込⼝座 2021年5⽉31⽇ [ { “text”: “請求書”, “rect”: { “left-top”: (25, 20), “right-bottom”: (40, 25) } }, { ... ] 抽出の⽅法 - PDF などの内部情報 - OCR (外部サービスを利⽤) - OCR (End-to-End で学習) - HTML の解析 2021年5⽉14⽇ 10,000 Sansan銀⾏ 333
  11. Data Strategy and Operation Center ⼊⼒⽂書からのグラフの定義 請求書 請求⽇ ⽀払い期限 請求⾦額

    振込⼝座 2021年5⽉14⽇ 10,000 2021年5⽉31⽇ n ノード特徴 - LSTM エンコーディング (最後の隠れ状態) n エッジの定義 - 上下左右の四⽅向で最近傍のセグメントと接続 - 近傍の k 個のセグメントと接続 - 全結合グラフ Sansan銀⾏ 333 ノード特徴
  12. Data Strategy and Operation Center Graph Neural Network によるレイアウト特徴の獲得 :

    グラフのエッジ集合 : 層⽬におけるセグメント の特徴ベクトル : 層⽬における重み/バイアスのパラメータ
  13. Data Strategy and Operation Center レイアウト特徴を⽤いたタグ系列の予測 請求書 振込⼝座 ⽀払い期限 2021年5⽉31⽇

    Sansan銀⾏ 333 請求⾦額 10,000 請求⽇ 2021年5⽉14⽇ Bi-LSTM layer CRF layer Text feature + Layout feature テキスト特徴とレイアウト特徴を結合して、Bi-LSTM CRF の⼊⼒とする - 類似した⽂字列であっても、学習されたレイアウト特徴により異なるタグが出⼒される
  14. Merge and Recognize: A Geometry and 2D Context Aware Graph

    Model for Named Entity Recognition from Visual Documents
  15. Data Strategy and Operation Center GraphIEの課題: 同⼀エンティティの分割 請求書 請求⽇ ⽀払い期限

    請求⾦額 振込⼝座 2021年5⽉31⽇ 2021年5⽉14⽇ 10,000 Sansan銀⾏ 333 請求元住所 東京都渋⾕区四四 4-4-4 Yonyon ビル 2F ⽬的は、⽂書データから興味のある情報を抽出すること - 住所などが複数⾏で記述されており、別セグメントとして構造化される場合、情報を正し く抽出することができない場合がある > GraphIE のアプローチでは、抽出性能に限界がある 請求書番号: 33333333
  16. Data Strategy and Operation Center Merge Layer の導⼊ レイアウト表現を⽤いて、セグメントが結合されるかどうかを予測する層を導⼊ 1.

    構造化 2. グラフ化 3. GNN 4. Merge Layer 請求元住所 東京都渋⾕区四四 4-4-4 Yonyon ビル 2F 5. タグ予測
  17. Data Strategy and Operation Center Merge Layer の伝播計算 レイアウト特徴とセグメント間の位置関係を表現した One-hot

    ベクトルを結合し、セグメン トが結合されるかを予測 0 ⋯ セグメント の後にセグメント が結合されない 1 ⋯ セグメント の後にセグメント が結合される : グラフ畳み込み層の層数 : セグメント と の位置関係を表す 8 次元の One-hot ベクトル : 全結合層
  18. Data Strategy and Operation Center 結合結果を利⽤したタグ系列の予測 : セグメント の 番⽬のトークンの単語ベクトル

    : CRF層 以下の を最⼤にするタグ系列を出⼒ : LSTM層 : セグメント のトークン数 Yonyon ビル 2F 東京都渋⾕区四四 4-4-4 Yonyon ビル 2F 東京都渋⾕区四四 4-4-4 LSTM-CRF LSTM-CRF 東京都 渋⾕区 四四 4-4-4 Yonyon ビル 2F B-Address I-Address I-Address I-Address I-Address I-Address I-Address
  19. Data Strategy and Operation Center Merge Layer で発⽣する損失 Cross Entropy

    Loss セグメントが結合されるかの教師ラベル と、セグメント の k 近傍のセグメントにセグメント が含まれるかどうかを⽰す を⽤いて以下の式で計算 Loss of NSP (Next Sentence Prediction) / SOP (Sentence-Order Prediction) BERT の Next Sentence Prediction や ALBERT の Sentence-Order Prediction などのタスクに各セグメ ントの⽂字列を連結してを⼊⼒し、負の対数尤度を で重みづけして損失とする
  20. Data Strategy and Operation Center まとめ レイアウトを考慮した⽂書からの情報抽出 - 情報抽出にテキストの位置関係 (レイアウト情報)

    を利⽤ - ⾔語モデル × レイアウト特徴 - 2018年ごろから多⾓的なアプローチがなされてきた Graph Neural Network ベースのアプローチ - テキストの位置関係に基づいて⽂書をグラフに変換 - グラフ畳み込みによりレイアウト特徴を獲得 - レイアウト特徴はタグ予測だけでなくセグメントのマージ判定にも利⽤可
  21. Data Strategy and Operation Center 引⽤⽂献 - Qian, Y., Santus,

    E., Jin, Z., Guo, J. and Barzilay, R. “GraphIE: A Graph-Based Framework for Information Extraction”, Proceedings of the North American Chapter of the Association for Computational Linguistics, pp.751-761, 2019. - Luo, C., Wang, Y., Zheng, Q., Li, L., Gao, F. and Zhang, S. “Merge and Recognize: A Geometry and 2D Context Aware Graph Model for Named Entity Recognition from Visual Documents”, Proceedings of the Graph-based Methods for Natural Language Processing (TextGraphs), pp.24-34, 2020. - Liu, X., Gao, F., Zhang, Q. and Zhao, H. “Graph Convolution for Multimodal Information Extraction from Visually Rich Documents”, Processing of the North American Chapter of the Association for Computational Linguistics, pp.32-39, 2019. - Zhao, X., Niu, E., Wu, Z. and Wang, X. “CUTIE: Learning to Understand Documents with Convolutional Universal Text Information Extractor”, arXiv preprint arXiv:1903.12363, 2019. - Xu, Y., Li, M., Cui, L., Huang, S., Wei, F. and Zhou, M. “LayoutLM: Pre-Training of Text and Layout for Document Image Understanding”, Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp.1192- 1200, 2020. - Majumder, B. P., Potti, N., Tata, S., Wendt, J. B., Zhao, Q. and Najork, M. “Representation Learning for Information Extraction from Form-like Documents”, Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp.6495–6504, 2020.