Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016: Machine Comprehension Using Match-LSTM and Answer Pointer #22

Open
jojonki opened this issue Nov 23, 2017 · 1 comment
Open

2016: Machine Comprehension Using Match-LSTM and Answer Pointer #22

jojonki opened this issue Nov 23, 2017 · 1 comment

Comments

@jojonki
Copy link
Owner

jojonki commented Nov 23, 2017

Machine Comprehension Using Match-LSTM and Answer Pointer
Shuohang Wang, Jing Jiang, https://arxiv.org/abs/1608.07905

screen shot 2017-11-22 at 9 58 57 pm

処理ステップ

  1. PassageとQueryは何らかのEmbeddingをする(GloveとかWord2vecとか)
  2. LSTM Preprocessing Layer
    PassageとQueryはそれぞれLSTM(単方向)に入れ,HpとHqを得る

screen shot 2017-11-26 at 6 25 52 pm

  1. Match-LSTM Layer
    アテンションを計算する.Query全体とi番目のPassageの単語で下記のようなGを作り,affine変換+softmaxでi番目のPassageの単語に対するアテンションαiを計算する.第2項のカッコの中の第2項であるhr_i-1は次に説明.⊗ eQはテンソル積で,Query長になるよう第2項の値を繰り返して,第1項と第2項で足し算できるようにしている.

screen shot 2017-11-26 at 6 25 57 pm

i番目のPassageのトークンと,i番目に対するQueryへのアテンションαiをQuery全体のhidden representationsにかけたもの,のconcatしたziを得る
screen shot 2017-11-26 at 6 32 52 pm

これをLSTMに入れる
screen shot 2017-11-26 at 6 32 58 pm
パッセージの逆方向からも同様の処理をする.
screen shot 2017-11-26 at 6 38 10 pm

両方向の長さP(Passage長)の隠れ状態をcocatしてHrを手に入れる
screen shot 2017-11-26 at 6 40 37 pm
screen shot 2017-11-26 at 6 40 43 pm

  1. Answer Pointer Layer
    Pointer Networks(入力シーケンスに対してのインデックスが出力となる構造)で答えを予測する.SQuADはPassageの中のどこが答えか?という問題なので適用できる.Sequence ModelとBoundary Modelがあり,前者は答えのシーケンス(単語idのシーケンス)を出力する(閾値長を超えるか,特殊文字を出力するまでが答え,Passage中の連続する単語を答えるとは限らない).後者は答えのシーケンスの頭とお尻の2つのインデックスを答えるモデル.こちらの方がうまくいった

結果

screen shot 2017-11-26 at 6 46 46 pm

screen shot 2017-11-26 at 6 46 58 pm

@jojonki
Copy link
Owner Author

jojonki commented Nov 23, 2017

@jojonki jojonki changed the title 2017: Machine Comprehension Using Match-LSTM and Answer Pointer 2016: Machine Comprehension Using Match-LSTM and Answer Pointer Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant