Downloads · 30 days
18
1% of all-time downloads
syedkhalid0/RoBERTa-Sentimental-Analysis-v1
RoBERTa-Sentimental-Analysis-v1 is a text classification model from syedkhalid0. Use it when you need a label for a piece of text. It is set up for transformers.
This is a fine-tuned RoBERTa model for sentiment analysis, trained on the SST-2 dataset. It classifies text into two sentiment categories: - 0: Negative - 1: Positive
Downloads · 30 days
18
1% of all-time downloads
All-time downloads
2.9K
Public
Parameters
125M
499 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors499 MB · 100%
From the Hugging Face model README
This is a fine-tuned RoBERTa model for sentiment analysis, trained on the SST-2 dataset. It classifies text into two sentiment categories:
The model achieves an accuracy of 91.789% on the SST-2 test set, making it a robust choice for sentiment classification tasks.
stanfordnlp/sst2Ensure you have the necessary libraries installed:
pip install transformers torch safetensors
The model can be loaded from Hugging Face's transformers library as follows:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load the tokenizer and model
model_name = "syedkhalid076/RoBERTa-Sentimental-Analysis-v1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example text
text = "This is an amazing product!"
# Tokenize input
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
# Perform inference
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax().item()
# Map the prediction to sentiment
sentiments = {0: "Negative", 1: "Positive"}
print(f"Sentiment: {sentiments[predicted_class]}")
The model was trained and evaluated on the SST-2 dataset, which is widely used for sentiment analysis tasks.
| Metric | Value |
|---|---|
| Accuracy | 91.789% |
The model is hosted on Hugging Face and can be used directly via their Inference Endpoints.
This model can be used in a variety of applications, such as:
While the model performs well on the SST-2 dataset, consider these limitations:
For fine-tuning on custom datasets or additional labels, refer to the Hugging Face documentation.
| Feature | Details |
|---|---|
| Language | English |
| Model size | 125M parameters |
| File format | SafeTensor |
| Precision | FP32 |
| Dataset | stanfordnlp/sst2 |
| Accuracy | 91.789% |
Contributions to improve the model or extend its capabilities are welcome. Fork this repository, make your changes, and submit a pull request.
Author: Syed Khalid Hussain