-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
add neural sequence tagging model for QA #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some simple comments first.
neural_seq_qa/config.py
Outdated
# dimension of the attention layer | ||
self.latent_chain_dim=64 | ||
# dimension of the evidence LSTMs | ||
self.e_lstm_dim=64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
neural_seq_qa/infer.py
Outdated
import sys | ||
import argparse | ||
|
||
import paddle.v2 as pd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use import paddle.v2 as paddle
to keep consistent with all the other PaddlePaddle demos in models and book.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All pd
have been changed to paddle
neural_seq_qa/network.py
Outdated
:rtype: LayerOutput | ||
""" | ||
return pd.layer.embedding( | ||
name=name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To follow current PaddlePaddle's style, if the name is not explicitly used, it is set automatically by PaddlePaddle.
Currently, in all the PaddlePaddle's released demos, except the data layer, all the other layers do not need the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names of the layers have been removed.
neural_seq_qa/README.md
Outdated
``` | ||
# Validation and Test | ||
|
||
WebQA provoides two versions of validation and test sets. Automatic valiation and test can be lauched by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provoides -> provides, valiation ->validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
neural_seq_qa/network.py
Outdated
|
||
def get_embedding(input, word_vec_dim, wordvecs): | ||
""" | ||
Defined word embedding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defined -> Define
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
neural_seq_qa/network.py
Outdated
:type drop_rate: float | ||
:param wordvecs: word embedding matrix | ||
:type wordvecs: numpy array | ||
:param default_init_std: default initial std |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the full name of std in all files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just to cancel the misoperation of clicking approve. Please first ignore this request changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A question, can we provide a trained model so that other users can directly download it and try it.
@lcy-seso This is a good idea. Shall we provide it in another place? Otherwise, this repo will become very large in the future. |
Yes~ We do have a place to save the trained model (You can give the model to me, I have the account). We have this example https://github.com/PaddlePaddle/models/blob/develop/image_classification/models/model_download.sh#L29. We can only add the download/evaluation script into the models repo, and update the README. |
Implement model proposed in Peng Li, Wei Li, Zhengyan He, Xuguang Wang, Ying Cao, Jie Zhou, and Wei Xu. Dataset and Neural Recurrent Sequence Labeling Model for Open-Domain Factoid Question Answering. arXiv:1607.06275.