项目运行参考:基于贵州景区评论数据的bert bert_wwm的评论文本情感分析 完整代码+数据 评论区自取_哔哩哔哩_bilibili
#coding:utf-8
import torch
from torch import nn
from torch import optim
import transformers as tfs
from transformers import BertTokenizer, BertModel
from transformers import BertConfig
# 基于贵州景区评论数据的bert bert_wwm的评论文本情感分析 完整代码+数据
# 环境 本地环境 3.6
# pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html 成功
# pip install transformers==4.13.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 成功
# pip install --upgrade nni --ignore-installed -i https://pypi.tuna.tsinghua.edu.cn/simple 成功
# pip install tkinter -i https://pypi.tuna.tsinghua.edu.cn/simple
# pip install transformers=