All Projects → YCG09 → Tf Text Classification

YCG09 / Tf Text Classification

Licence: apache-2.0
CNN and RNN with Attention for Chinese Text Classification in Tensorflow

Programming Languages

python
139335 projects - #7 most used programming language

Environment setup

  • Requirements: python3, tensorflow1.10, sklearn, numpy, pandas and jieba
pip install -r requirements.txt

Training

  • CNN
python train_cnn.py
  • RNN with attention
python train_rnn.py

the data format is as follows: label '\t' text

Testing

  • 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

Inference

python inference.py --checkpoint_dir=./runs/textrnn/trained_result_1548145204/checkpoints --model_type=RNN
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].