An Open-source Neural Hierarchical Multi-label Text Classification Toolkit
OTHER License
NeuralClassifier is designed for quick implementation of neural models for hierarchical multi-label classification task, which is more challenging and common in real-world scenarios. A salient feature is that NeuralClassifier currently provides a variety of text encoders, such as FastText, TextCNN, TextRNN, RCNN, VDCNN, DPCNN, DRNN, AttentiveConvNet and Transformer encoder, etc. It also supports other text classification scenarios, including binary-class and multi-class classification. It is built on PyTorch. Experiments show that models built in our toolkit achieve comparable performance with reported results in the literature.
python train.py conf/train.json
FastTextTextCNNTextRNNTextRCNNDRNNVDCNNDPCNNAttentiveConvNetTransformer
.python train.py conf/train.hierar.json
FastTextTextCNNTextRNNTextRCNNDRNNVDCNNDPCNNAttentiveConvNetTransformer
python train.py conf/train.hmcn.json
HMCN
Detail configurations and explanations see Configuration.
The training info will be outputted in standard output and log.logger_file.
python eval.py conf/train.json
The evaluation info will be outputed in eval.dir.
python predict.py conf/train.json data/predict.json
The predict info will be outputed in predict.txt.
JSON example:
{
"doc_label": ["Computer--MachineLearning--DeepLearning", "Neuro--ComputationalNeuro"],
"doc_token": ["I", "love", "deep", "learning"],
"doc_keyword": ["deep learning"],
"doc_topic": ["AI", "Machine learning"]
}
"doc_keyword" and "doc_topic" are optional.
Some public codes are referenced by our toolkit: