Sentiment Analysis
Collection
Sentiment classifiers for financial news and product reviews. • 3 items • Updated
How to use AnkitAI/reviews-roberta-base-sentiment-analysis with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="AnkitAI/reviews-roberta-base-sentiment-analysis") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("AnkitAI/reviews-roberta-base-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained("AnkitAI/reviews-roberta-base-sentiment-analysis")This model is a fine-tuned version of cardiffnlp/twitter-roberta-base-sentiment-latest on the Amazon Reviews dataset for sentiment analysis.
AnkitAI/reviews-roberta-base-sentiment-analysiscardiffnlp/twitter-roberta-base-sentiment-latestThe model was trained using the following parameters:
You can use this model directly with the Hugging Face transformers library:
from transformers import RobertaForSequenceClassification, RobertaTokenizer
model_name = "AnkitAI/reviews-roberta-base-sentiment-analysis"
model = RobertaForSequenceClassification.from_pretrained(model_name)
tokenizer = RobertaTokenizer.from_pretrained(model_name)
# Example usage
inputs = tokenizer("This product is great!", return_tensors="pt")
outputs = model(**inputs) # 1 for positive, 0 for negative
This model is licensed under the MIT License.