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

Training Classifiers with Natural Language Explanations

Koji Matsuda
July 27, 2018
280

Training Classifiers with Natural Language Explanations

Koji Matsuda

July 27, 2018
Tweet

Transcript

  1. Training Classifiers with Natural Language Explanations Braden Hancock, Paroma Varma,

    Stephanie Wang, Martin Bringmann, Percy Liang, Christopher Ré Stanford University ACL-2018 ঺հऀ: দాߞ࢙ʢ౦๺େֶʣ 1 ࿦จதͷਤ͸ɼACLൃදεϥΠυ or ࿦จ͔ΒͷҾ༻Ͱ͢ɽ https://www.bradenhancock.com/ 3෼σϞಈը౳΋͋Γ·͢ɽ
  2. ヒューリスティクスがあれば,⼤量の ラベル付きデータを⽣成できます 5 “Barack batted back tears as he thanked

    his wife, Michelle, for all her help.” “Both Bill and his wife Hillary smiled and waved at reporters as they rode by.” “George attended the event with his wife, Laura, and their two daughters.” True True True Label Example େྔͷϥϕϧͳ͠σʔλʹ ώϡʔϦεςΟΫεΛద༻ J େن໛ͳ܇࿅σʔλΛࣗಈతʹੜ੒Ͱ͖Δ
  3. どうやって? • 根拠⽂を Semantic Parser で実⾏可能形式 (ラベリング関数)に変換 • 多数のラベリング関数をラベルなしデータに 適⽤し,「賢い多数決」で訓練データ⽣成

    – 賢い多数決: Data Programming [Ratner+2016] 6 Explanation Because the words “his wife” are right before person 2. Why did you label True? Labeling Function def f(x): return 1 if (“his wife” in left(x.person2, dist==1)) else 0 #abstain
  4. Babble Labble Framework 7 SEMANTIC PARSER FILTER BANK LABEL AGGREGATOR

    DISC. MODEL False,because… e 1 e 2 e 3 UNLABELED EXAMPLES EXPLANATIONS SEMANTIC PRAGMATIC x 1 x 2 x 3 True,because… True,because… x y ˜ y ˜ Ξϊςʔγϣϯ࣌ ʹϥϕϧͷࠜڌΛ ࣗવจͰॻ͍ͯ΋ Β͏ ࠜڌจΛϥϕϦϯ άؔ਺ʹม׵͢Δ
  5. 変換はSemantic Parserで⾏います 8 จ຺ࣗ༝จ๏ϕʔε & ϧʔϧϕʔεͷ Semantic Parser [SippyCup] https://github.com/wcmac/sippycup

    Λ༻͍͍ͯΔͱͷ͜ͱ ࣮ݧ͸3ͭͷؔ܎நग़໰୊͕ͩɼจ๏͸શͯͰڞ௨ͷ΋ͷʢ໿200ϧʔϧʣ
  6. 正しくないパーズ結果も許容 9 True, because… Typical Semantic Parser Our Semantic Parser

    def f(x): return 1 if… 1 Explanation 1 Parse True, because… def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… 1 Explanation Many Parses Goal: produce the correct parse Goal: produce useful parses (whether they’re correct or not)
  7. Babble Labble Framework 10 SEMANTIC PARSER FILTER BANK LABEL AGGREGATOR

    DISC. MODEL False,because… e 1 e 2 e 3 UNLABELED EXAMPLES EXPLANATIONS SEMANTIC PRAGMATIC x 1 x 2 x 3 True,because… True,because… x y ˜ y ˜ Ξϊςʔγϣϯ࣌ ʹϥϕϧͷࠜڌΛ ࣗવจͰॻ͍ͯ΋ Β͏ ࠜڌจΛϥϕϦϯ άؔ਺ʹม׵͢Δ ඍົͳϥϕϦϯά ؔ਺ΛϑΟϧλʔ
  8. 11 Filter Bank False, because… True, because… True, because… Explanations

    Labeling Functions (Filtered) Labeling Functions Semantic Parser def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… Filter Bank def f(x): return 1 if… def f(x): return 1 if… def f(x): return 1 if… Semantic Filter Pragmatic Filter શࣄྫʹରͯ͠ಉ͡ϥϕϧΛฦͨ͠Γɼ ॏෳ͍ͯͨ͠Γ͢ΔϥϕϦϯάؔ਺ΛϑΟϧλʔ
  9. Babble Labble Framework 12 SEMANTIC PARSER FILTER BANK LABEL AGGREGATOR

    DISC. MODEL False,because… e 1 e 2 e 3 UNLABELED EXAMPLES EXPLANATIONS SEMANTIC PRAGMATIC x 1 x 2 x 3 True,because… True,because… x y ˜ y ˜ Ξϊςʔγϣϯ࣌ ʹϥϕϧͷࠜڌΛ ࣗવจͰॻ͍ͯ΋ Β͏ ࠜڌจΛϥϕϦϯ άؔ਺ʹม׵͢Δ ඍົͳϥϕϦϯά ؔ਺ΛϑΟϧλʔ ϥϕϦϯάؔ਺܈Λ unlabeledσʔλʹ ద༻ɼϥϕϧͷ౷߹
  10. ラベルの統合: Data Programming 13 LF 1: LF 2: LF 3:

    LF 4: LF 5: y: ˜ ? ? ? ? ? ? ? ? ? x1 x9 x2 x3 x4 x5 x6 x7 x8 Input: Output: (x1 ,ỹ1 ) (x2 ,ỹ2 ) (x3 ,ỹ3 ) (x4 ,ỹ4 ) Training Data Positive Negative Abstain ૬͕ؔߴ͍ɽ ಠཱͰ͸ͳ͍ʁ ଞͷؔ਺ͱί ϯϑϦΫτɽ ৴པੑ௿͍ʁ ΧόϨοδ͸ ௿͍͚Ͳ৴པੑ ͸ߴͦ͏ Data Programming: (Ratner, et al. NIPS 2016)
  11. Babble Labble Framework 14 SEMANTIC PARSER FILTER BANK LABEL AGGREGATOR

    DISC. MODEL False,because… e 1 e 2 e 3 UNLABELED EXAMPLES EXPLANATIONS SEMANTIC PRAGMATIC x 1 x 2 x 3 True,because… True,because… x y ˜ y ˜ Ξϊςʔγϣϯ࣌ ʹϥϕϧͷࠜڌΛ ࣗવจͰॻ͍ͯ΋ Β͏ ࠜڌจΛϥϕϦϯ άؔ਺ʹม׵͢Δ ඍົͳϥϕϦϯά ؔ਺ΛϑΟϧλʔ ϥϕϦϯάؔ਺܈Λ unlabeledσʔλʹ ద༻ɼϥϕϧͷ౷߹ ෼ྨثΛֶश
  12. ⾃動⽣成した訓練データから識別 モデルを学習 • 得られた (事例,疑似ラベル) ペアから分 類器を学習する • 今回は⼀般的な logistic

    regression モデル – 素性: uni〜trigram, dependency 等 – 個々のラベリング関数の結果は⽤いない(カ バレッジが限られるため,あくまでラベル導 出のため⽤いる) 15
  13. 実験: 関係抽出タスク • 3つの関係抽出タスク – 配偶者(Spouse) – 病気(Disease) – タンパク質(Protein)

    • 各タスク30事例に対して,ラベルの付与 と根拠⽂書きを⾏ってもらう 16 Unlabeled data 22k 6.7k 5.5k ͨͱ͑͹͜ͷΑ͏ͳྫ͕ಘΒΕ͍ͯ·͢
  14. 結果: はるかに効率的 BL:ఏҊख๏ આ໌30݅ TS:ී௨ͷڭࢣ ͋Γֶश ͨͬͨ30ࣄྫ Ͱ3000ࣄྫͷ ৔߹ͷੑೳΛ্ ճΔ

    17 ࠜڌจΛ༻͍Δͱɼϥϕϧ͚ͩͷ৔߹ʹൺ΂ͯ 5ʙ100ഒޮ཰తʹ෼ྨثֶ͕शͰ͖Δ
  15. 参考⽂献 • [Ratner+2016] Data Programming: Creating Large Training Sets, Quickly.

    Alexander J. Ratner, Christopher M. De Sa, Sen Wu, Daniel Selsam, Christopher Ré. NIPS 2016 • [SippyCup] https://github.com/wcmac/sippycup 26