https://github.com/rituyadav92/lightweighted-cnn-for-document-classification
Optimized Text Document Classification
https://github.com/rituyadav92/lightweighted-cnn-for-document-classification
cnn-text-classification document-classification optimization
Last synced: about 1 year ago
JSON representation
Optimized Text Document Classification
- Host: GitHub
- URL: https://github.com/rituyadav92/lightweighted-cnn-for-document-classification
- Owner: RituYadav92
- Created: 2019-04-12T16:21:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T02:27:00.000Z (about 6 years ago)
- Last Synced: 2025-03-31T09:11:15.837Z (about 1 year ago)
- Topics: cnn-text-classification, document-classification, optimization
- Language: Python
- Homepage:
- Size: 4.93 MB
- Stars: 6
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Light-Weighted CNN for Text Classification
### Dataset Used
Tobacco-3482
Categories in the dataset are:
```['ADVE', 'Email', 'Form', 'Letter', 'Memo', 'News', 'Note', 'Report', 'Resume', 'Scientific']```
### Train Model
#### To train on Optimized Text CNN
```python ADAM_optmized_train.py```
#### Lightweight Text CNN
```python singleADAM_LW_train.py```
#### Lightweight TextCNN with Dual Optimizer
Switches from Adam to SGD when a triggering condition is satisfied.
```python SWAT_LW_train.py```
#### Optional arguments:
```python train.py --help```
### Evaluate Model
To evaluate, run below command
```python eval.py --eval_train --checkpoint_dir="./runs/trained_model/checkpoints/"```
To use your own data, change the eval.py script to load your data.
### Test Model
To prediction on new test data, make sure evaluate model is working , Then run below :
```python test.py --out_test --checkpoint_dir="./runs/trained_model/checkpoints/" --test_dir="path to test data"```
### Link to the paper
For more details please go through my paper at link: https://arxiv.org/pdf/2004.07922.pdf
### References :
1. https://github.com/dennybritz/cnn-text-classification-tf