zackhy / TextClassification

Text classification using different neural networks (CNN, LSTM, Bi-LSTM, C-LSTM).
MIT License
194 stars 60 forks source link

Multi-class Text Classification

Implement four neural networks in Tensorflow for multi-class text classification problem.

Models

After the training is done, you can use tensorboard to see the visualizations of the graph, losses and evaluation metrics:

tensorboard --logdir=./runs/1111111111/summaries

Test

Run test.py to evaluate the trained model
Parameters:

optional arguments:
  --test_data_file TEST_DATA_FILE
                        Test data file path
  --run_dir RUN_DIR     Restore the model from this run
  --checkpoint CHECKPOINT
                        Restore the graph from this checkpoint
  --batch_size BATCH_SIZE
                        Test batch size

You could run test.py to start evaluation. For example:

python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --checkpoint=clf-10000