Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 604 Bytes

File metadata and controls

39 lines (33 loc) · 604 Bytes

PyTorch BERT 文本分类

预训练模型下载路径

https://huggingface.co/bert-base-chinese/tree/main

下载config.json, pytorch_model.bin, vocab.txt, 存放在pretrained/bert-base-chinese/文件夹中

pretrained
│  
└─bert-base-chinese
        config.json
        pytorch_model.bin
        vocab.txt

环境

torch==1.10.1+cu113
transformers==4.15.0
numpy==1.22.3
sklearn==0.0
scikit-learn==1.0.2
tqdm==4.62.3

使用方法

  1. 安装环境
pip install requirements.txt
  1. 运行代码
python main.py

欢迎star