Tensorflow implementation of RNN(Recurrent Neural Network) for sentiment analysis, one of the text classification problems. There are three types of RNN models, 1) Vanilla RNN, 2) Long Short-Term Memory RNN and 3) Gated Recurrent Unit RNN.
positive data is located in "data/rt-polaritydata/rt-polarity.pos"
negative data is located in "data/rt-polaritydata/rt-polarity.neg"
"GoogleNews-vectors-negative300" is used as pre-trained word2vec model
Display help message:
$ python train.py --help
Train Example:
$ python train.py --cell_type "vanilla" \
--pos_dir "data/rt-polaritydata/rt-polarity.pos" \
--neg_dir "data/rt-polaritydata/rt-polarity.neg"\
--word2vec "GoogleNews-vectors-negative300.bin"
$ python train.py --cell_type "lstm" \
--pos_dir "data/rt-polaritydata/rt-polarity.pos" \
--neg_dir "data/rt-polaritydata/rt-polarity.neg"\
--word2vec "GoogleNews-vectors-negative300.bin"
$ python train.py --cell_type "gru" \
--pos_dir "data/rt-polaritydata/rt-polarity.pos" \
--neg_dir "data/rt-polaritydata/rt-polarity.neg"\
--word2vec "GoogleNews-vectors-negative300.bin"
Evaluation Example:
$ python eval.py \
--pos_dir "data/rt-polaritydata/rt-polarity.pos" \
--neg_dir "data/rt-polaritydata/rt-polarity.neg" \
--checkpoint_dir "runs/1523902663/checkpoints"