中文文本分类;bert;Pytorch
模型: bert-chinese-base
机器:window;3070Ti
python3.8
torch==1.13.1+cu116
transformers==4.31.0
今日头条文本分类数据集
地址:https://github.com/aceimnorstuvwxz/toutiao-text-classfication-dataset
-
准备数据
下载数据:https://github.com/aceimnorstuvwxz/toutiao-text-classfication-dataset
处理数据:运行
data\toutiaonews38w\data_processor.py生成train.csv,dev.csv -
配置参数:
请在
config.py中配置参数 -
训练:
python run.py
-
推理:
python predict.py
todo:添加更多模型
https://github.com/649453932/Bert-Chinese-Text-Classification-Pytorch