This repository is forked from https://github.com/TobiasLee/Text-Classification. It adds a commandline interface for convenient model training, evaluation and prediction and updates the code to be compatible with tensorflow 2. The base_model.py and base_train.py modules have been adapted from https://github.com/MrGemy95/Tensorflow-Project-Template
- python >= 3.7
- tensorflow >= 2.0
- scikit-learn
- click
- pandas
- bunch
- tqdm
The models work with csv files containing the columns "title", "content" and "class". Training a model works like this:
python -m cli [modelname] train [training.csv] --model-dir path/to/model/dir
For evaluation after training a model and specifying "path/to/model/dir" as model directory:
python -m cli [modelname] eval [eval.csv] --model-dir path/to/model/dir
For prediction after training a model and specifying "path/to/model/dir" as model directory:
python -m cli [modelname] predict [predict.csv] --model-dir path/to/model/dir