This repository implements the C-LSTM for text classification(SST-2) in Tensorflow2 and tested on binary classification and 5-class classification (SST-5) on Stanford Sentiment Treebank dataset.
- Implement with Tensorflow2 and Python3
- Use pretrained Google-News-300 weights on the Embedding layer
- Achieved performance very close to the original paper on SST dataset
conda env create -f environment.yml
conda activate tensorflow
python train.py --dataset SST-2\
--batch_size 48\
--num_epochs 80\
--num_class 2\
--max_len 48\
--learning_rate 1e-4
python train.py --dataset SST-5\
--batch_size 48\
--num_epochs 80\
--num_class 5\
--max_len 48\
--learning_rate 1e-4
Dataset | Accuracy of this implementation | Accuracy of original paper |
---|---|---|
SST-2 | 86.5% | 87.8% |
SST-5 | 48.6% | 49.2% |