A while ago, I implemented a CNN text classification model using MXNet, which can be found here.
This time, I try to implement it in RNN (with attention).
two txt file, the format of each line is: <label> sentence.
- <pos> This is the best movie about troubled teens since 1998's whatever.
- <neg> This 10th film in the series looks and feels tired.
one label a line, the number of labels is equals to total classes.
- pos
- neg
one sentence a line, without <label>
the format of each line is: <label> sentence, like validation file
The data is recommended to be tokenized or segmented(Chinese).
python rnn_model.py --train path/to/train.data --validate /path/to/validate.data --config /path/to/config
python inference.py --test python/to/inference.data --config /path/to/config --checkpoint 1
python inference.py --test python/to/inference-evaluation.data --config /path/to/config --checkpoint 1 --evaluation