Downloads · 30 days
7
25% of all-time downloads
Arsalan8/my_multiclass_model
my_multiclass_model is a text classification model from Arsalan8. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This project tackles real-world sentiment analysis by training on user-generated product reviews from Flipkart. By utilizing a top-tier transformer model, DistilBERT, via transfer learning, this project demonstrates h…
Downloads · 30 days
7
25% of all-time downloads
All-time downloads
28
Public
Parameters
67M
2.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This project tackles real-world sentiment analysis by training on user-generated product reviews from Flipkart. By utilizing a top-tier transformer model, DistilBERT, via transfer learning, this project demonstrates how businesses can leverage NLP to extract meaningful insights from customer feedback.
Install the necessary libraries:
pip install datasets transformers evaluate
This project involves sentiment analysis on real user reviews from Flipkart. The data collection and preprocessing phases were crucial for preparing the dataset for effective model training.
For the sentiment analysis task, we employed transfer learning with the DistilBERT model, renowned for its efficiency and performance.
The model achieved an accuracy of approximately 95%, demonstrating its reliability and effectiveness in understanding and classifying sentiments.
The trained model is hosted on Hugging Face Hub for easy accessibility and deployment.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("Arsalan8/my_multiclass_model")
model = AutoModelForSequenceClassification.from_pretrained("Arsalan8/my_multiclass_model")
# Example text
text = "This product is great!"
inputs = tokenizer(text, return_tensors="pt")
# Perform the prediction
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
predicted_label = model.config.id2label[predicted_class_id]
print(f"Predicted sentiment: {predicted_label}")
The project successfully demonstrates how advanced NLP techniques, combined with real user data, can create a robust model applicable in business contexts for sentiment analysis. Its adaptability and accuracy make it a valuable tool for understanding and leveraging customer feedback.