1 Star 0 Fork 0

Hugging Face 模型镜像/amazon-review-sentiment-analysis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
licensetagsmetricsmodel-index
apache-2.0
generated_from_trainer
accuracy
nameresults
distilbert-base-uncased-finetuned-mnli-amazon-query-shopping

distilbert-base-uncased-finetuned-mnli-amazon-query-shopping

This model is a fine-tuned version of nlptown/bert-base-multilingual-uncased-sentiment on an Amazon US Customer Reviews Dataset. The code for the fine-tuning process can be found here. This model is uncased: it does not make a difference between english and English. It achieves the following results on the evaluation set:

  • Loss: 0.5202942490577698
  • Accuracy: 0.8

Model description

This a bert-base-multilingual-uncased model finetuned for sentiment analysis on product reviews in six languages: English, Dutch, German, French, Spanish and Italian. It predicts the sentiment of the review as a number of stars (between 1 and 5).

This model is intended for direct use as a sentiment analysis model for product reviews in any of the six languages above, or for further finetuning on related sentiment analysis tasks.

We replaced its head with our customer reviews to fine-tune it on 17,280 rows of training set while validating it on 4,320 rows of dev set. Finally, we evaluated our model performance on a held-out test set: 2,400 rows.

Intended uses & limitations

Bert-base is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification, or question answering. This fine-tuned version of BERT-base is used to predict review rating star given the review.

The limitations are this trained model is focusing on reviews and products on Amazon. If you apply this model to other domains, it may perform poorly.

How to use

You can use this model directly by downloading the trained weights and configurations like the below code snippet:

from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("LiYuan/amazon-review-sentiment-analysis")

model = AutoModelForSequenceClassification.from_pretrained("LiYuan/amazon-review-sentiment-analysis")

Training and evaluation data

Download all the raw dataset from the Kaggle website.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 2

Training results

Training Loss Epoch Step Validation Loss Accuracy
0.555400 1.0 1080 0.520294 0.800000
0.424300 2.0 1080 0.549649 0.798380

Framework versions

  • Transformers 4.18.0
  • Pytorch 1.11.0+cu113
  • Datasets 2.1.0
  • Tokenizers 0.12.1

空文件

简介

一个用于亚马逊评论情感分析的模型。 展开 收起
取消

发行版

暂无发行版

贡献者 (2)

全部

近期动态

1年多前推送了新的 main 分支
1年多前创建了仓库
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hf-models/amazon-review-sentiment-analysis.git
git@gitee.com:hf-models/amazon-review-sentiment-analysis.git
hf-models
amazon-review-sentiment-analysis
amazon-review-sentiment-analysis
main

搜索帮助