Slide 1

Slide 1 text

Graph Neural Network を⽤いた レイアウトつき⽂書からの情報抽出 Sansan株式会社 DSOC R&D 研究員 保坂 ⼤樹

Slide 2

Slide 2 text

Data Strategy and Operation Center ⾃⼰紹介 • 2020/03 早稲⽥⼤学⼤学院創造理⼯学研究科経営システム⼯学専攻 修了 • 2020/04 Sansan株式会社 ⼊社 保坂 ⼤樹 Taiju Hosaka Sansan 株式会社 DSOC(Data Strategy & Operation Center) R&D Data Analysis Group 研究員 オンライン名刺

Slide 3

Slide 3 text

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株式会社のサービスを説明するものではありません。

Slide 4

Slide 4 text

対象とする問題

Slide 5

Slide 5 text

Data Strategy and Operation Center ⽂書からの情報抽出 ニュース記事 請求書 ・組織の名称 ⋮ Algorithm 特定のドメインの⽂書データから、あらかじめ定義された興味のある情報を抽出する Input Output ・⽀払いの期限 ⋮

Slide 6

Slide 6 text

Data Strategy and Operation Center ⽂書からの情報抽出における⼊⼒ Input データを記述するテキストのみを⼊⼒とすることが多い Sansan株式会社 は、2021年5⽉14⽇ に ML勉強会 をオンライン開催しました。 ニュース記事

Slide 7

Slide 7 text

Data Strategy and Operation Center Sansan株式会社 は、2021年5⽉14⽇ に ML勉強会 をオンライン開催しました。 ⽂書からの情報抽出における出⼒ ・組織の名称 ・開催⽇ ・イベントの名称 Output 組織の名称 開催⽇ イベントの名称 トークン単位でタグを付与する

Slide 8

Slide 8 text

Data Strategy and Operation Center ⽂書からの情報抽出で⽤いられるアルゴリズム Bidirectional LSTM-CRF (Huang et al. 2015) - 深層学習によるアプローチ > ⽂脈を考慮したタグづけを⾏う 1. トークン系列のエンコーディング 2. タグ系列へのデコーディング トークン単位でタグを予測する Algorithm

Slide 9

Slide 9 text

Data Strategy and Operation Center レイアウトつき⽂書からの情報抽出 Input Output レイアウトに従う⽂書の場合を考える 請求書 請求⽇ ⽀払い期限 請求⾦額 振込⼝座 2021年5⽉14⽇ 10,000 2021年5⽉31⽇ ・⽀払いの期限 ⽀払いの期限 請求書 Sansan銀⾏ 333

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

Data Strategy and Operation Center レイアウト情報の利⽤ グラフベースの⼿法 (Liu et al. 2019) グリッドベースの⼿法 (Zhao et al. 2019) ⾔語モデルベースの⼿法 (Xu et al. 2020) 表現学習ベースの⼿法 (Majumder et al. 2020)

Slide 12

Slide 12 text

GraphIE: A Graph-Based Framework for Information Extraction

Slide 13

Slide 13 text

Data Strategy and Operation Center 情報抽出アルゴリズムのフレームワーク グラフベースの情報抽出アルゴリズムは、以下の⼿順で推論を⾏う 1. ⼊⼒となる⽂書を受け取り、テキストと座標の組 (セグメント) の集合に変換する 2. セグメント間にエッジを定義し、グラフを構築する 3. Graph Neural Network により、レイアウトを考慮した各セグメントの特徴を獲得する 4. セグメントの特徴とテキストの特徴を⼊⼒とし、各トークンのタグ系列を予測する 1. 構造化 2. グラフ化 3. GNN 4. タグ予測 請求⾦額 10,000

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

Data Strategy and Operation Center ⼊⼒⽂書からのグラフの定義 請求書 請求⽇ ⽀払い期限 請求⾦額 振込⼝座 2021年5⽉14⽇ 10,000 2021年5⽉31⽇ n ノード特徴 - LSTM エンコーディング (最後の隠れ状態) n エッジの定義 - 上下左右の四⽅向で最近傍のセグメントと接続 - 近傍の k 個のセグメントと接続 - 全結合グラフ Sansan銀⾏ 333 ノード特徴

Slide 16

Slide 16 text

Data Strategy and Operation Center Graph Neural Network によるレイアウト特徴の獲得 : グラフのエッジ集合 : 層⽬におけるセグメント の特徴ベクトル : 層⽬における重み/バイアスのパラメータ

Slide 17

Slide 17 text

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 の⼊⼒とする - 類似した⽂字列であっても、学習されたレイアウト特徴により異なるタグが出⼒される

Slide 18

Slide 18 text

Merge and Recognize: A Geometry and 2D Context Aware Graph Model for Named Entity Recognition from Visual Documents

Slide 19

Slide 19 text

Data Strategy and Operation Center GraphIEの課題: 同⼀エンティティの分割 請求書 請求⽇ ⽀払い期限 請求⾦額 振込⼝座 2021年5⽉31⽇ 2021年5⽉14⽇ 10,000 Sansan銀⾏ 333 請求元住所 東京都渋⾕区四四 4-4-4 Yonyon ビル 2F ⽬的は、⽂書データから興味のある情報を抽出すること - 住所などが複数⾏で記述されており、別セグメントとして構造化される場合、情報を正し く抽出することができない場合がある > GraphIE のアプローチでは、抽出性能に限界がある 請求書番号: 33333333

Slide 20

Slide 20 text

Data Strategy and Operation Center Merge Layer の導⼊ レイアウト表現を⽤いて、セグメントが結合されるかどうかを予測する層を導⼊ 1. 構造化 2. グラフ化 3. GNN 4. Merge Layer 請求元住所 東京都渋⾕区四四 4-4-4 Yonyon ビル 2F 5. タグ予測

Slide 21

Slide 21 text

Data Strategy and Operation Center Merge Layer の伝播計算 レイアウト特徴とセグメント間の位置関係を表現した One-hot ベクトルを結合し、セグメン トが結合されるかを予測 0 ⋯ セグメント の後にセグメント が結合されない 1 ⋯ セグメント の後にセグメント が結合される : グラフ畳み込み層の層数 : セグメント と の位置関係を表す 8 次元の One-hot ベクトル : 全結合層

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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 などのタスクに各セグメ ントの⽂字列を連結してを⼊⼒し、負の対数尤度を で重みづけして損失とする

Slide 24

Slide 24 text

Data Strategy and Operation Center 性能評価: タグ単位の抽出結果

Slide 25

Slide 25 text

Data Strategy and Operation Center 性能評価: エンティティ単位の抽出結果

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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.

Slide 28

Slide 28 text

No content