Skip to content

zhouyongjie/TextClassfication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextClassfication

中文文本分类;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

使用说明

  1. 准备数据

    下载数据:https://github.com/aceimnorstuvwxz/toutiao-text-classfication-dataset

    处理数据:运行data\toutiaonews38w\data_processor.py 生成 train.csvdev.csv

  2. 配置参数:

    请在config.py中配置参数

  3. 训练:

    python run.py
  4. 推理:

    python predict.py
💡 注意,为了快速验证代码是否可以运行,我在`utils/data_utils.py`中加载数据时,只截取了2000条数据

未完待续

todo:添加更多模型

参考

https://github.com/649453932/Bert-Chinese-Text-Classification-Pytorch

About

使用bert进行文本分类

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages