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:
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.
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.
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")
Download all the raw dataset from the Kaggle website.
The following hyperparameters were used during training:
| 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 |
checkpoint-1080/optimizer.pt 1.3 GBcheckpoint-2160/optimizer.pt 1.3 GBcheckpoint-1080/pytorch_model.bin 670 MBcheckpoint-2160/pytorch_model.bin 670 MBpytorch_model.bin 670 MBcheckpoint-1080/rng_state.pth 14.5 kBcheckpoint-2160/rng_state.pth 14.5 kBcheckpoint-1080/training_args.bin 3.1 kBcheckpoint-2160/training_args.bin 3.1 kBtraining_args.bin 3.1 kBcheckpoint-1080/scheduler.pt 0.6 kBcheckpoint-2160/scheduler.pt 0.6 kB