A simple command-line tool for performing sentiment analysis using the pretrained cardiffnlp/twitter-roberta-base-sentiment model from Hugging Face. Optimized for analyzing social media text, short reviews, and comments.
- Utilizes state-of-the-art pretrained RoBERTa transformer
- Handles noisy text with user mentions and URLs
- Predicts sentiment as Positive, Neutral, or Negative
- Outputs probability scores for interpretability
- Input: User provides a comment or review via terminal
- Preprocessing: Cleans mentions and links
- Encoding: Uses RoBERTa tokenizer
- Prediction: Model outputs class scores processed via
softmax - Output: Displays score per sentiment and predicted class
Enter the Comment Or Review : I love this product! Works perfectly.
Negative 0.02
Neutral 0.15
Positive 0.83
The Sentiment of the Comment is : Positive