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

SNLP2022:What does the sea say to the shore? A ...

Yuki Zenimoto
September 25, 2022

SNLP2022:What does the sea say to the shore? A BERT based DST style approach for speaker to dialogue attribution in novels

Yuki Zenimoto

September 25, 2022
Tweet

More Decks by Yuki Zenimoto

Other Decks in Science

Transcript

  1. What does the sea say to the shore? A BERT

    based DST style approach for speaker to dialogue attribution in novels Carolina Cuesta-Lazaro, Animesh Prasad, Trevor Wood ACL 2022 読み手: 銭本 友樹/Zenimoto Yuki (筑波大) @第14回最先端NLP勉強会
  2. 本発表の姿勢 ⚫小説発話者分類研究の布教をしたい ⚫日本語での研究が少ない[ⅰ][ⅱ][ⅲ][ⅳ] ⚫素晴らしい日本語データセットが爆誕[3]したので 日本語小説発話者分類研究がもっと増えてほしい ⚫発話者分類の包括的な話をします 2 [3] Yamazaki et

    al.小説会話文への話者情報付与, 2022, 国⽴国語研究所「日常会話コーパス」プロジェクト報告書 5 [ⅰ] Du et al.小説からの自由対話コーパスの自動構築, 2019, 言語処理学会第25会年次大会 [ⅱ] Miyazaki et al.発話テキストへのキャラクタ性付与のための音変化表現の分類, 2019, 自然言語処理 [ⅲ] Ishikawa et al.口調ベクトルを用いた小説発話の話者推定, 2022, 自然言語処理研究発表会 [ⅳ] Zenimoto et al. Speaker Identification of Quotes in Japanese Novels based on Gender Classification Model by BERT, 2022, PACLIC
  3. どんな論文? 問題設定:異なる年代/文体に対応可能なEnd-to-End発話者分類 やったこと: ⚫ 発話者分類に深層学習を初めて導入 - Before:ルールベースがSoTA[1] ⚫ 1パラグラフ全体の埋め込みを分類に使用 -

    Before:1発話文単位で処理&発話文と地の文の意味は未使用 ⚫ 異なる年代/文体の15小説のデータセットを新たに構築 - Before:19世紀の3小説[1] 結果:既存のSoTA[1]と比較して平均50%以上の性能改善 - サブタスク毎の性能も詳細に調査 3 [1] Muzny et al. A Two-stage Sieve Approach for Quote Attribution, 2017, EACL
  4. 導入:小説の発話者分類 5 Elizabeth Bennet Mr. Collins … Mr. Darcy “Do

    you really think so?” cried Elizabeth, brightening up ... “You are uniformly charming!” cried he, with an air of awkward … “I see your design, Bingley,” said his friend. … Texts in Novels Character List
  5. 導入:発話者分類の流れ 6 Direct Speech Identification Mention Extraction Entity Linking Speaker

    Attribution Poole was asleep, and Bowman was reading on the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.”
  6. 導入:発話者分類の流れ 7 Direct Speech Identification Poole was asleep, and Bowman

    was reading on the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” Mention Extraction Entity Linking Speaker Attribution
  7. 導入:発話者分類の流れ 8 Poole was asleep, and Bowman was reading on

    the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” Direct Speech Identification Mention Extraction Entity Linking Speaker Attribution
  8. 導入:発話者分類の流れ 9 Poole was asleep, and Bowman was reading on

    the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” BOWMAN POOLE BOWMAN HAL Direct Speech Identification Entity Linking Speaker Attribution Mention Extraction
  9. 導入:発話者分類の流れ 10 Poole was asleep, and Bowman was reading on

    the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” BOWMAN POOLE BOWMAN HAL Direct Speech Identification Speaker Attribution Entity Linking Mention Extraction
  10. 既存手法-1発話毎に処理[1][2] 11 ⚫Rule Based Speaker Matching … “Do you really

    think so?” cried Elizabeth, ... Utterance by Elizabeth Verb Speaker “My dear Mr. Bennet,…” “Is that his … ” Vocative “Aye, so it …” … “Then, my …” … “Is that a …” by speaker A by speaker B by speaker A by Mr. Bennet ⚫Vocative Detection ⚫Conversational Pattern [1] Muzny et al. A Two-stage Sieve Approach for Quote Attribution, 2017, EACL [2] He et al. Identification of Speakers in Novels, 2013, ACL
  11. 3. 小説毎にルールと特徴量の有効性が異なる - ルールと特徴量の網羅性/汎用性の議論も不十分 既存手法の課題 1. 登場人物リストが必要 - 人手で作成するか、とりあえず近くの人物名に紐づけ 12

    小説全体から人物名を抽出⇛クラスタリングで作成 1パラグラフ全体をBERT/GRUの入力に使用 2. 発話文/地の文の中身を見ていない - 前後の文脈も無視 異なる年代/文体の18小説について評価
  12. その他のデータセット ⚫日本語:BCCWJ 2,932小説665,828発話文(Entity付与)[3] ⚫英語[4]: ⇛ ⚫中国語[4]:⇛ データセット ⚫1900~2010年の18小説 ➢うち3つは既存の公開データセット[1] ➢それ以外の小説情報は未公開

    14 [3] Yamazaki et al.小説会話文への話者情報付与, 2022, 国⽴国語研究所「日常会話コーパス」プロジェクト報告書 5 [4] Yu et al. End-to-End Chinese Speaker Identification, 2022, NAACL [1] Muzny et al. A Two-stage Sieve Approach for Quote Attribution, 2017, EACL
  13. 発話文の検出 ダブルクォーテーション””で括られた発話のみを対象 ➢ 95%の発話文は””で括られている[5] ➢ 単なる強調表現も多いのでは? ⇛F1:0.98±0.01の精度で適切に検出できた 17 [5] Steinbach

    et al. Understanding Quotation. Mouton Series in Pragmatics [MSP] , 2012 [6] Lee et al. Keeping Their Words: Direct and Indirect Chinese Quote Attribution from Newspapers, 2020, In Companion of the WWW ⚫日本語:カギ括弧を利用するだけでは不十分[3] ➢「」『』⇛直接発話or強調表現 ➢()⇛心の声or補足説明 ➢ 鉤括弧なしの発話文 [3] Yamazaki et al.小説会話文への話者情報付与, 2022, 国⽴国語研究所「日常会話コーパス」プロジェクト報告書 5 ⚫中国語:新聞の発話文検出での精度は50~60%程度[6]
  14. Mentionの抽出 20 Poole was asleep, and his father was reading

    on the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” Poole was asleep, and his father was reading on the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” 人称代名詞(himやher)は無視、her fatherとかは対象 貴重な性別情報を捨てるのは勿体ないのでは…?
  15. Mentionの抽出 ⚫NER(CoNLL-2003で訓練したTransformer) ⚫Rule-based 21 … “Do you really think so?”

    cried Mr. Elizabeth, ... Utterance Verb Person … “Do you really think so?” cried Mr. Elizabeth, ... B-PER I-PER 0.78±0.1
  16. Mentionの抽出 ⚫NER(CoNLL-2003で訓練したTransformer) ⚫Rule-based 22 … “Do you really think so?”

    cried Mr. Elizabeth, ... Utterance Verb Person … “Do you really think so?” cried Mr. Elizabeth, ... B-PER I-PER 0.78±0.1 Mentionの出現回数で重み付けしている (マイナーキャラが識別できなくても評価性 能が下がりにくくなっている) 評価の公平性的によろしくないのでは?
  17. クラスタリング結果は𝐵3 precision, recall, F1-scoreで評価[7] Mentionのクラスタリング⇛Entityの特定 入力:全パラグラフ&Mention 出力:各パラグラフに登場するEntity 23 Poole was

    asleep, and his father was reading on the control deck, when Hal announced: “Er—Dave, I have a report for you.” “What’s up?” “We have another bad AE-35 unit. My fault predictor indicates failure within twenty-four hours.” Poole his father Hal Dave Poole his father Hal Dave BOWMAN HAL POOLE [7] Amigó et al. A comparison of extrinsic clustering evaluation metrics based on formal constraints, 2009, Information Retrieval
  18. Mentionのクラスタリング⇛Entityの特定 ⚫Out-of-domain Coreference Resolution(Transformer) ➢全パラグラフ中、2つ以上のパラグラフで共参照関係にある Mentionは同一クラスタ 25 ⚫Rule-based ➢First NameかFamily

    Nameが異なれば別クラスタ ➢敬称(Mr. or Mrs.)が異なれば別クラスタ ➢名前と愛称の辞書は事前に用意 0.86±0.08 同一人物を指すMention同士の出現 位置が遠いケースが多かったため (共参照関係の識別に失敗する)
  19. 発話文とMentionの埋め込み表現 28 Poole [CLS] was … his father [SEP] [CLS]

    “Dave … … [SEP] [CLS] … Distil-BERT Poole [CLS] his father [CLS] “Dave [CLS] ⚫入力:1パラグラフ ➢発話文列:𝒖 = 𝑢0 , 𝑢1 , … 𝑢𝑛−1 ➢Mention:𝒎 = {𝑚0 , 𝑚1 , … 𝑚𝑙−1 } ➢Entity:𝒄 = {𝑐0 , 𝑐1 , … 𝑐𝑘−1 } 地の文も含める (発話者は紐付けない) 前述の「発話者候補の検出」の結果
  20. 発話文とMentionの埋め込み表現 29 Poole [CLS] was … his father [SEP] [CLS]

    “Dave … … [SEP] [CLS] … Distil-BERT Poole [CLS] his father [CLS] “Dave [CLS] ⚫出力:各発話文とMentionの埋め込み ➢発話文 𝑢𝑖 の埋め込み:𝜺𝑢𝑖 = 𝜙𝐷𝑖𝑠𝑡𝑖𝑙−𝐵𝐸𝑅𝑇 𝑢𝑖 [𝐶𝐿𝑆] ➢Mention 𝑚𝑗 の埋め込み:𝜺𝑚𝑗 = 1 𝑡 σ𝑇=0 𝑡−1 𝜙𝐷𝑖𝑠𝑡𝑖𝑙−𝐵𝐸𝑅𝑇 𝑢𝑖 𝑚𝑗 𝑇 𝜺𝑢0 𝜺𝑢1 𝜺𝑢2 𝜺𝑚0 𝜺𝑚1 𝜺𝑚2
  21. 文脈を考慮した発話の埋め込み表現 ⚫入力:発話文 𝑢𝑖 のDistil BERTでの埋め込み ⚫出力:GRU(Gated Recurrent Unit)の隠れ層 𝒉𝒊+𝟏 =

    𝜙𝐺𝑅𝑈 (𝜺𝑢+1 , 𝒉𝒊 ) 30 [CLS] [CLS] [CLS] 𝜺𝑢0 𝜺𝑢1 𝜺𝑢2 [CLS] 𝜺𝑢3 𝒉0 GRU 𝒉1 𝒉2 𝒉3 𝑢0 𝑢1 𝑢2 𝑢3
  22. 各発話文に紐づくMentionの確率 ⚫入力:GRUの隠れ層𝒉𝒊 と各Mentionの埋め込み行列𝑴 𝑴 = [𝜺𝑚0 , 𝜺𝑚1 , …

    , 𝜺𝑚𝑙−1 ] ⚫出力:各MentionのLogit 𝒍𝒊 = 𝜙𝐹𝐶𝑁 𝒉𝒊 ∙ 𝑴 [CLS] [CLS] [CLS] [CLS] 𝜙𝐹𝐶𝑁 𝒉0 𝜙𝐹𝐶𝑁 𝒉1 𝜙𝐹𝐶𝑁 𝒉2 𝜙𝐹𝐶𝑁 𝒉3 𝜺𝑚0 Poole 𝜺𝑚1 His Father 𝜺𝑚2 Dave 𝜺𝑚3 Hal Poole His Father Dave Hal Poole His Father Dave Hal Poole His Father Dave Hal Poole His Father Dave Hal 𝑻 𝑻 𝒍𝟎 𝒍𝟏 𝒍𝟐 𝒍𝟑 31
  23. 各発話文に紐づくEntityの確率 32 Poole His Father Dave Hal Poole His Father

    Dave Hal Poole His Father Dave Hal Poole His Father Dave Hal 𝒍𝟎 𝒍𝟏 𝒍𝟐 𝒍𝟑 POOLE BOWMAN HAL POOLE BOWMAN HAL POOLE BOWMAN HAL POOLE BOWMAN HAL 𝒆𝟎 𝒆𝟏 𝒆𝟐 𝒆𝟑 ⚫入力:各MentionのLogit ⚫出力:各EntityのLogit 𝑐𝐵𝑂𝑊𝑀𝐴𝑁 = max(𝑚𝐻𝑖𝑠𝐹𝑎𝑡ℎ𝑒𝑟 , 𝑚𝐷𝑎𝑣𝑒 )
  24. 発話者列の決定 𝑃 𝒚 𝒖 = exp ෍ 𝑛=0 𝑁 𝐸𝑛

    𝑦𝑛 + ෍ 𝑛=0 𝑁−1 𝑉 𝑦𝑛,𝑦𝑛+1 /𝑍 𝑉 𝑦𝑛,𝑦𝑛+1 : 発話者𝑦𝑛 と𝑦𝑛+1 が連続する確率 33 POOLE BOWMAN HAL POOLE BOWMAN HAL HAL POOLE BOWMAN HAL POOLE BOWMAN HAL 𝒍𝟎 𝒍𝟏 𝒍𝟐 𝒍𝟑 CRF HAL BOWMAN ---- 𝒆𝟎 𝒆𝟏 𝒆𝟐 𝒆𝟑 発話文列𝒖の発話者が発話者列𝒚となる確率
  25. 本研究の概要(再) 問題設定:異なる年代/文体に対応可能なEnd-to-End発話者分類 やったこと: ⚫ 発話者分類に深層学習を初めて導入 - Before:ルールベースがSoTA[1] ⚫ 1パラグラフ全体の埋め込みを分類に使用 -

    Before:1発話文単位で処理&発話文と地の文の意味は未使用 ⚫ 異なる年代/文体の15小説のデータセットを新たに構築 - Before:19世紀の3小説[1] 結果:既存のSoTA[1]と比較して平均50%以上の性能改善 - サブタスク毎の性能も詳細に調査 40 [1] Muzny et al. A Two-stage Sieve Approach for Quote Attribution, 2017, EACL