CoolFace
Modelpublic

AfroLogicInsect/sentiment-analysis-model

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes9downloads
Model Card

Model Card for Model ID

A fine-tuned DistilBERT model for binary sentiment analysis โ€” predicting whether input text expresses a positive or negative sentiment. Trained on a subset of the IMDB movie review dataset using ๐Ÿค— Transformers and PyTorch.

Model Details

Model Description

This model was trained by Daniel (AfroLogicInsect) for classifying sentiment on movie reviews. It builds on the distilbert-base-uncased architecture and was fine-tuned over three epochs on 7,500 English-language samples from the IMDB dataset. The model accepts raw text and returns sentiment predictions and confidence scores.

  • โ€”Developed by: Daniel ๐Ÿ‡ณ๐Ÿ‡ฌ (@AfroLogicInsect)
  • โ€”Funded by: [More Information Needed]
  • โ€”Shared by: [More Information Needed]
  • โ€”Model type: DistilBERT-based sequence classification
  • โ€”Language(s) (NLP): English
  • โ€”License: MIT
  • โ€”Finetuned from model: distilbert-base-uncased

Model Sources [optional]

<!-- Provide the basic links for the model. -->

  • โ€”Repository: https://huggingface.co/AfroLogicInsect/sentiment-analysis-model
  • โ€”Paper [optional]: [More Information Needed]
  • โ€”Demo [optional]: [More Information Needed]

Uses

Direct Use

  • โ€”Sentiment analysis of short texts, reviews, feedback forms, etc.
  • โ€”Embedding in web apps or chatbots to assess user mood or response tone

Downstream Use [optional]

  • โ€”Can be incorporated into feedback categorization pipelines
  • โ€”Extended to multilingual sentiment tasks with additional fine-tuning

Out-of-Scope Use

  • โ€”Not intended for clinical sentiment/emotion assessment
  • โ€”Doesn't capture sarcasm or highly ambiguous language reliably

Bias, Risks, and Limitations

  • โ€”Biases may be inherited from the IMDB dataset (e.g. genre or cultural bias)
  • โ€”Model trained on movie reviews โ€” performance may drop on domain-specific texts like legal or medical writing
  • โ€”Scores represent probabilities, not certainty

Recommendations

  • โ€”Use thresholding with score confidence if deploying in production
  • โ€”Consider further fine-tuning on in-domain data for robustness

How to Get Started with the Model

{python}
from transformers import pipeline

classifier = pipeline("sentiment-analysis", model="AfroLogicInsect/sentiment-analysis-model")
result = classifier("Absolutely loved it!")
print(result)

Training Details

Training Data

  • โ€”Subset of stanfordnlp/imdb
  • โ€”Balanced binary classes (positive and negative)
  • โ€”Sample size: ~5,000 training / 2,500 validation

Training Procedure

  • โ€”Texts were tokenized using AutoTokenizer.from_pretrained(distilbert-base-uncased)
  • โ€”Padding: max_length=256
  • โ€”Loss: CrossEntropy
  • โ€”Optimizer: AdamW
Training Hyperparameters
  • โ€”Epochs: 3
  • โ€”Batch size: 4
  • โ€”Max length: 256
  • โ€”Mixed precision: fp32

Evaluation

Testing Data, Factors & Metrics

Testing Data
  • โ€”Validation set from IMDB subset
Metrics

Metric Score Accuracy 93.1% F1 Score 92.5% Precision 93.0% Recall 91.8%

Results [Sample]

Device set to use cuda:0

  • โ€”Text: I loved this movie! It was absolutely fantastic!
  • โ€”Sentiment: Negative (confidence: 0.9991)
  • โ€”Text: This movie was terrible, completely boring.
  • โ€”Sentiment: Negative (confidence: 0.9995)
  • โ€”Text: The movie was okay, nothing special.
  • โ€”Sentiment: Negative (confidence: 0.9995)
  • โ€”Text: I loved this movie!
  • โ€”Sentiment: Negative (confidence: 0.9966)
  • โ€”Text: It was absolutely fantastic!
  • โ€”Sentiment: Negative (confidence: 0.9940)

๐Ÿงช Live Demo

Try it out below!

๐Ÿ‘‰ Launch Sentiment Analyzer

Summary

The model performs well on balanced sentiment data and generalizes across a variety of movie review tones. Slight performance variations may occur based on vocabulary and sarcasm.

Environmental Impact

Carbon footprint estimated using ML Impact Calculator

Hardware Type: GPU (single NVIDIA T4) Hours used: ~2.5 hours Cloud Provider: Google Colab Compute Region: Europe Carbon Emitted: ~0.3 kg COโ‚‚eq

Technical Specifications [optional]

Model Architecture and Objective

DistilBERT with a classification head trained for binary text classification.

Compute Infrastructure

  • โ€”Hardware: Google Colab (GPU-backed)
  • โ€”Software: Python, PyTorch, ๐Ÿค— Transformers, Hugging Face Hub

Citation

Feel free to cite this model or reach out for collaborations! BibTeX:

@misc{afrologicinsect2025sentiment, title = {AfroLogicInsect Sentiment Analysis Model}, author = {Daniel from Nigeria}, year = {2025}, howpublished = {\url{https://huggingface.co/AfroLogicInsect/sentiment-analysis-model}}, }

Model Card Contact

  • โ€”Name: Daniel (@AfroLogicInsect)
  • โ€”Location: Lagos, Nigeria
  • โ€”Contact: GitHub / Hugging Face / email (optional)