Sentence representations and question answering (YerevaNN)
-
Upload
yerevann-research-lab -
Category
Science
-
view
1.962 -
download
0
Transcript of Sentence representations and question answering (YerevaNN)
![Page 1: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/1.jpg)
Sentence
RepresentationsMichael Manukyan and Hrayr Harutyunyan
YerevaNN
![Page 2: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/2.jpg)
Where it is used?
• Machine Translation
• Text classification
• Text clustering
• Machine Comprehension
![Page 3: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/3.jpg)
Unsupervised solutions
• Bag of Words (multiset of words)
• Based on Word Embeddings (word2vec, GloVe):
• sum of word vectors
• weighted sum
• positional encoding
• max-pooling
• Recurrent Neural Networks (RNN)
![Page 4: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/4.jpg)
Sum of the word vectors
![Page 5: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/5.jpg)
* color shades indicate weights
Weighted sum of the word vectors
![Page 6: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/6.jpg)
* color shades indicate weights
Positional encoding (Sukhbaatar et al. 2015)
![Page 7: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/7.jpg)
* color shades indicate values
Max-pooling
![Page 8: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/8.jpg)
here is the sentence representation
RNN: encoder-decoder(J. Li et al., 2015)
![Page 9: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/9.jpg)
Supervised
(task dependent) solutions
![Page 10: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/10.jpg)
Recursive NN
learnable parameters
here is the
sentence
representation
![Page 11: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/11.jpg)
Convolutional NN
learnable parameters
here is the
sentence
representation
![Page 12: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/12.jpg)
Machine Comprehension:
Question Answering
![Page 13: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/13.jpg)
• Set of triples (𝑃, 𝑄, 𝐴)
• 𝑃 - passage (the text that computer should
read and comprehend)
• 𝑄 - question asked on that passage
• 𝐴 - answer for the question
Datasets
![Page 14: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/14.jpg)
Facebook bAbI
• Passage:
1. Mary moved to the bathroom.
2. John went to the hallway.
• Question: Where is Mary?
• Answer: bathroom
20 tasks, 10k examples per task
![Page 17: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/17.jpg)
MCTestJames the Turtle was always getting in trouble. Sometimes he'd reach into the
freezer and empty out all the food. Other times he'd sled on the deck and get a splinter.
His aunt Jane tried as hard as she could to keep him out of trouble, but he was sneaky
and got into lots of trouble behind her back.
One day, James thought he would go into town and see what kind of trouble he could
get into. He went to the grocery store and pulled all the pudding off the shelves and ate
two jars. Then he walked to the fast food restaurant and ordered 15 bags of fries. He
didn't pay, and instead headed home.
His aunt was waiting for him in his room. She told James that she loved him, but he
would have to start acting like a well-behaved turtle.After about a month, and after
getting into lots of trouble, James finally made up his mind to be a better turtle.
What is the name of the trouble making turtle?
A) Fries
B) Pudding
C) James
D) Jane 600 examples
![Page 18: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/18.jpg)
SQuAD
• The Stanford Question Answering Dataset
• questions a set of Wikipedia articles
• the answer to every question is a segment of
text, or span, from the corresponding reading
passage
• 100,000+ question-answer pairs on 500+ articles
![Page 20: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/20.jpg)
SQuAD scoring
• Exact match
• the percentage of predictions that exactly
match one of the ground truth answers
• F1 score
• F1 score over common word tokens between
the predicted answer and the ground truth
![Page 21: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/21.jpg)
SQuAD Leaderboard
![Page 22: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/22.jpg)
Best published model for SQuAD so far:
Match-LSTM with Answer-Pointer
(Boundary)
Singapore Management University
(Wang & Jiang '16)
![Page 23: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/23.jpg)
Model
• LSTM-preprocessing
• Match-LSTM
• Answer module
![Page 24: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/24.jpg)
LSTM Preprocessing
• incorporate contextual information into the
representation of each token in the passage and
the question
![Page 25: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/25.jpg)
Match-LSTM
• It has been used to predict whether the premise
entails the hypothesis
• In this model the question is considered as premise
and the passage as hypothesis
• For each word we get one vector which contains its
word vector and the question representation that
depends on that word
• Bidirectional LSTM is applied on those vectors to
encode the sequence
![Page 26: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/26.jpg)
Answer Module
• Vocabulary is huge and answer is always
present in the passage (it’s a substring of it)
• Models
• Sequence: predict each word one by one and
guess where to stop
• Boundary: predict two indices indicating the
beginning and the end of the answer
![Page 27: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/27.jpg)
![Page 28: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/28.jpg)
![Page 29: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/29.jpg)
Results
![Page 30: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/30.jpg)
Results
![Page 31: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/31.jpg)
Results
![Page 32: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/32.jpg)
Attention
![Page 33: Sentence representations and question answering (YerevaNN)](https://reader033.fdocuments.us/reader033/viewer/2022052117/5877acec1a28ab826e8b72eb/html5/thumbnails/33.jpg)
Thanks