加载中…
加载中…
SentiLens is a binary sentiment classification model fine-tuned on the IMDB movie review dataset. It predicts whether a movie review expresses positive or negative sentiment.
This project explores transformer fine-tuning, model evaluation, and the comparison of a specialised classifier with large language model prompting.
distilbert/distilbert-base-uncasedstanfordnlp/imdb0 = NEGATIVE, 1 = POSITIVEEvaluation on the 25,000-example IMDB test set produced:
| Metric | Result |
|---|---|
| Accuracy | 90.69% |
| F1 score | 0.9080 |
| Test loss | 0.2544 |
Confusion matrix (rows: actual; columns: predicted):
| Predicted negative | Predicted positive | |
|---|---|---|
| Actual negative | 11,187 | 1,313 |
| Actual positive | 1,015 | 11,485 |
These results apply to the IMDB test set and should not be interpreted as performance guarantees on other types of text.
The model was fine-tuned using Hugging Face Transformers and PyTorch in Google Colab. Evaluation metrics were calculated on the dataset's held-out test split.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="princy-21/sentilens-distilbert"
)
print(classifier("The acting was excellent and the story was moving!"))
Review the original model and dataset licenses and attribution requirements before redistributing this model.
Amal Princy J — student AI/ML project.