This repo contains a PyTorch implementation of a char-level CNN model for text classification.
The model architecture comes from this paper:https://arxiv.org/pdf/1509.01626.pdf
At the root of the project, you will see:
├── pyCharCnn
| └── callback
| | └── lrscheduler.py
| | └── trainingmonitor.py
| | └── ...
| └── config
| | └── basic_config.py #a configuration file for storing model parameters
| └── dataset
| └── io
| | └── dataset.py
| | └── data_transformer.py
| └── model
| | └── nn
| └── output #save the ouput of model
| └── preprocessing #text preprocessing
| └── train #used for training a model
| | └── trainer.py
| | └── ...
| └── utils # a set of utility functions
├── train_cnn.py
- csv
- tqdm
- numpy
- pickle
- scikit-learn
- PyTorch 1.0
- matplotlib
- Download the
AG News Topic Classification Dataset
from coming and place it into the/pyCharCnn/dataset/raW
directory. - Modify configuration information in
pyCharCnn/config/basic_config.py
(the path of data,...). - run
python train_cnn.py
.
coming soon....
coming soon