Skip to content

vschiniah/SentimentAnalysis

Repository files navigation

Tweet Sentiment Analyzer (Inference Script)

This project loads a fine-tuned Hugging Face transformer model for 3-class sentiment classification (Negative / Neutral / Positive) and provides a simple Python function to predict sentiment for a given text input.

What the code does

  1. Cleans input text (lowercasing, removing URLs/mentions/hashtags, stripping non-letters).
  2. Loads a locally saved transformer model and tokenizer from sentiment_model/sentiment_model.
  3. Runs inference with PyTorch (no gradients, evaluation mode).
  4. Maps the predicted class index to a human-readable label: Negative, Neutral, or Positive.

Requirements

pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors