模型:

JiaqiLee/imdb-finetuned-bert-base-uncased

英文

模型描述

这个模型是 bert-base-uncased 模型的微调版本,用于将电影评论的情感分类为两个类别之一:负面(标签0)和正面(标签1)。

如何使用

您可以使用以下代码使用该模型。

from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
model_path = "JiaqiLee/imdb-finetuned-bert-base-uncased"
tokenizer = BertTokenizer.from_pretrained(model_path)
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
print(pipeline("The movie depicted well the psychological battles that Harry Vardon fought within himself, from his childhood trauma of being evicted to his own inability to break that glass ceiling that prevents him from being accepted as an equal in English golf society."))

训练数据

训练数据来自HuggingFace IMDB dataset 。我们使用train.csv数据的90%进行模型训练,剩余的10%用于评估。

评估结果

模型在IMDB测试数据集中实现了0.91的分类准确率。