- Requirements: python3, tensorflow1.10, sklearn, numpy, pandas and jieba
pip install -r requirements.txt
- CNN
python train_cnn.py
- RNN with attention
python train_rnn.py
- evaluation mode:
python test.py --checkpoint_dir=./runs/textcnn/trained_result_1548144557/checkpoints --model_type=CNN
- prediction mode:
python test.py --checkpoint_dir=./runs/textcnn/trained_result_1548144557/checkpoints --model_type=CNN --test_mode=prediction
python inference.py --checkpoint_dir=./runs/textrnn/trained_result_1548145204/checkpoints --model_type=RNN