A Architecture for design answer ranker by seperate the sentence modeling and sequence modeling.
Contained sentence model include:
Simple RNN
GRU
LSTM
GRU with attention
CNN
CNN with attention
Contained sequence model include:
Relevance(two sentence) - S1T ⋅ M ⋅ S2
Multi Relevance - MLP ahead Relevance between answer and each context
MLP beyond concanted
One layer Memory Network with context as Memory
Simple RNN
GRU
LSTM
|── utils
| |── data_loader_utils.py # vocab and padding function.
| |── keras_generic_utils.py # copy the generic_utils from keras/utils.
| |── keras_sequence.py # copy the sequence.py from keras/utils.
| |── utils.py # based class for generate batched data as model input from formated text files.
├── config_local.py # config for model folder.
├── context_lasagne.py # models.
├── experiment_base.py # base class for experiment include train/continue_train/test/test_p@k/test_pr/predict/backup embedding
├── experiment_base_douban.py # data loader for douban corpus
├── experiment_base_ubuntu.py # data loader for Ubuntu corpus
├── experiment_douban.py # example to experiment for douban corpus.
├── experiment_ubuntu.py # example to experiment for Ubuntu corpus.
Run experiment_xxx.py directly.
A sample contained in one line, for each line, the format is:
label[0/1] \t sentence1 \t sentence2 \t ...
If you use any source codes or datasets included in this toolkit in your work, please cite the following paper. The bibtex are listed below:
[Wu et al, 2016]:
@inproceedings{wu2016ranking,
title={Ranking responses oriented to conversational relevance in chat-bots},
author={Wu, Bowen and Wang, Baoxun and Xue, Hui},
booktitle={Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers},
pages={652--662},
year={2016}
}