Applying BERT Fine Tuning to Sentiment Classification on Amazon Reviews
Abstract
Sentiment analysis has made great progress in recent years, due to the fact that companies want to have a better understanding of how their products are classified by their consumers. However, despite the great advances that emerge in the field of artificial intelligence to solve this task, the most robust models are found in the English language. In the present work, we compare two Artificial Intelligence models that have monolingual and Multilingual approaches, which are Spanish BERT and Multilingual BERT, models based on BERT's transformer Architecture, to which the fine tuned technique was applied for the task of Sentiment analysis on the Amazon reviews dataset in Spanish using the accuracy and F1 score metrics. Finally, it was found that the Spanish BERT model has the best results for the sentiment analysis task on the Amazon reviews dataset in Spanish.
this paper is available here
Pipeline
Prerequisites
- Linux / Window
- Python3
Clone this Repository
git clone https://github.com/alexliqu09/Sentiment-Analysis-on-Amazon-Reviews.git
Train model
If you want to train the models use the colab Notebooks
Run the work in local
If you want to proof the work , you should run the following commands:
- First , Install requeriments file:
pip install -r requeriments.txt
-
Second , download the Weights of Beto & MBERT and put them in this directory
-
Third , Start Streamlit server:
streamlit run main.py
- Note:
Local host : http://localhost:8501
Network URL: http://192.168.0.5:8501
🐋
Run with Docker
#Bulding docker image
docker build -t bert .
#RUN container
docker run -t -p 5000:5000 --name betocontainer bert
If you find useful our work , please cite this paper:
@inproceedings{@lvrBERT,
title={Applying BERT Fine Tuning to Sentiment Classification on Amazon Reviews},
author={Lique, Alexander and Vásquez, Diego and Rios, Manuel },
year={2021}
}