Downloads · 30 days
22
6% of all-time downloads
MESSItom/BERT-review-sentiment-analysis
BERT-review-sentiment-analysis is a text classification model from MESSItom. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is fine-tuned from BERT to perform sentiment analysis on a custom dataset containing student reviews about campus events or amenities. The objective is to classify the sentiments (positive, negative, neutra…
Downloads · 30 days
22
6% of all-time downloads
All-time downloads
372
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is fine-tuned from BERT to perform sentiment analysis on a custom dataset containing student reviews about campus events or amenities. The objective is to classify the sentiments (positive, negative, neutral) while maintaining high performance metrics like accuracy.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
The model can be used directly for sentiment classification of student reviews about campus events or amenities.
The model can be fine-tuned further for other sentiment analysis tasks or integrated into larger applications for sentiment classification.
The model is not suitable for tasks outside sentiment analysis, such as language translation or text generation.
The model may inherit biases from the pre-trained BERT model and the custom dataset used for fine-tuning. It may not perform well on reviews that are significantly different from the training data.
Users should be aware of the potential biases and limitations of the model. It is recommended to evaluate the model on a diverse set of reviews to understand its performance and limitations.
Use the code below to get started with the model:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "MESSItom/BERT-review-sentiment-analysis"
model = AutoModelForSequenceClassification.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
def predict_sentiment(text):
inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=-1).item()
class_names = ['positive', 'neutral', 'negative']
sentiment = class_names[predicted_class]
return sentiment