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

add neural sequence tagging model for QA #390

Merged
merged 5 commits into from
Oct 26, 2017

Conversation

pengli09
Copy link
Contributor

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.

Copy link
Collaborator

@lcy-seso lcy-seso left a 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.

# dimension of the attention layer
self.latent_chain_dim=64
# dimension of the evidence LSTMs
self.e_lstm_dim=64
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import sys
import argparse

import paddle.v2 as pd
Copy link
Collaborator

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.

Copy link
Contributor Author

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

:rtype: LayerOutput
"""
return pd.layer.embedding(
name=name,
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

```
# Validation and Test

WebQA provoides two versions of validation and test sets. Automatic valiation and test can be lauched by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provoides -> provides, valiation ->validation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


def get_embedding(input, word_vec_dim, wordvecs):
"""
Defined word embedding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defined -> Define

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

:type drop_rate: float
:param wordvecs: word embedding matrix
:type wordvecs: numpy array
:param default_init_std: default initial std
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@lcy-seso lcy-seso left a 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.

Copy link
Collaborator

@lcy-seso lcy-seso left a 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 lcy-seso merged commit ab9bec7 into PaddlePaddle:develop Oct 26, 2017
@pengli09
Copy link
Contributor Author

@lcy-seso This is a good idea. Shall we provide it in another place? Otherwise, this repo will become very large in the future.

@pengli09 pengli09 deleted the neural_seq_qa branch October 26, 2017 11:17
@lcy-seso
Copy link
Collaborator

lcy-seso commented Oct 26, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants