hanxiao.github.io icon indicating copy to clipboard operation
hanxiao.github.io copied to clipboard

Teach Machine to Comprehend Text and Answer Question with Tensorflow - Part I · Han Xiao Tech Blog

Open hanxiao opened this issue 6 years ago • 10 comments

https://hanxiao.github.io/2018/04/21/Teach-Machine-to-Comprehend-Text-and-Answer-Question-with-Tensorflow/

hanxiao avatar Apr 26 '18 16:04 hanxiao

Very nice blog. Looking forward to the next part.

Just a question - When we encode question or passage, are we keeping all the outputs(of Bi Directional GRU RNN) from whole passage and then adding attention over it Or just keeping last output of Bi Directional GRU RNN (This would be king of passage encoding) Below line from "Embedding and Encoding Layers" is not clear. q_encodes, output_dim = tf.concat(q_encodes, 2), 2 * hidden_size

nehaboob avatar Apr 30 '18 10:04 nehaboob

All outputs from the encoder, i.e. if your sequence has length L, batch size is B, LSTM hidden units is D. Then q_encodes should be [B, L, D], or [B, L, 2*D] when using bi-directional LSTM.

The line you are pointing out is a typo, thanks and I will fix it soon!

hanxiao avatar Apr 30 '18 10:04 hanxiao

Got it. Thanks.

nehaboob avatar Apr 30 '18 10:04 nehaboob

This is great! This post really clarifies the core components of question answering systems. Please post part two soon!

iamshang1 avatar May 01 '18 18:05 iamshang1

Thanks for sharing this. please keep posting .

duythvn avatar May 02 '18 03:05 duythvn

Great blog, when is the part two? thanks.

cbqin avatar May 16 '18 01:05 cbqin

Good blog. Now that we tasted the dish, I want more......when you intend to publish part 2?

casakan avatar Aug 14 '18 05:08 casakan

Hey guys, part II of this series is available now!

hanxiao avatar Sep 13 '18 06:09 hanxiao

Hi... i was trying to implement your code for the sake of understanding... I am stuck at start_label used in the loss function.

start_loss = tf.losses.sparse_softmax_cross_entropy(labels=start_label, logit=start_logit)

I am new to this area. Can you please explain what I should put there..

Raman-Raje avatar Jul 27 '19 18:07 Raman-Raje

start labels are the integers representing the positions at which the answer span starts for your batch

iamshang1 avatar Jul 27 '19 18:07 iamshang1