Downloads · 30 days
21
10% of all-time downloads
Steeve2ml/globatrend-sentiment-distilbert
globatrend-sentiment-distilbert is a text classification model from Steeve2ml. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
DistilBERT fine-tuned for binary sentiment classification (positive / negative) on movie reviews. Built as part of my GlobaTrend Insights, a portfolio project covering the full modern NLP pipeline — from classical ML…
Downloads · 30 days
21
10% of all-time downloads
All-time downloads
202
Public
Parameters
67M
536 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
DistilBERT fine-tuned for binary sentiment classification (positive / negative) on movie reviews. Built as part of my GlobaTrend Insights, a portfolio project covering the full modern NLP pipeline — from classical ML to Transformers to multilingual Aspect-Based Sentiment Analysis. This model is the project's first fine-tuned Transformer used as a baseline sentiment classifier before the multilingual ABSA models built in later phases.
distilbert-base-uncasedBinary sentiment classification (positive/negative) of English movie reviews or similarly-styled long-form English text. Suitable for quick sentiment scoring where a coarse positive/negative label is sufficient.
Intended as a baseline / building block for the project's later Aspect-Based Sentiment Analysis work (Phase 9), where sentiment is predicted per aspect rather than for a whole document.
max_length=512 tokens, so
longer reviews are truncated and information near the end of long
reviews may be lost.Users should validate performance on their own domain (e.g. e-commerce reviews) before relying on this model, and should not assume the sentiment label reflects a specific aspect of a review rather than its overall tone.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Steeve2ml/globatrend-sentiment-distilbert",
)
classifier("This movie was absolutely fantastic, a must-see.")
NLTK Movie Reviews corpus (Pang & Lee, 2004): 2,000 movie reviews, 1,000 positive / 1,000 negative, human-labeled by original review rating. Split 1,600 train / 400 test (80/20, stratified).
Tokenized with the distilbert-base-uncased WordPiece tokenizer,
max_length=512, truncation and padding enabled.
Trainer default)Held-out split of the same NLTK Movie Reviews corpus: 400 reviews (200 positive / 200 negative), never seen during training.
Accuracy and F1-score (binary, positive class).
| Configuration | Accuracy |
|---|---|
max_length=256, 2 epochs | 0.757 |
max_length=512, 3 epochs | 0.818 |
For reference, other models trained on the same data split within this project:
| Model | Accuracy |
|---|---|
| Linear SVM (TF-IDF) | 0.835 |
| DistilBERT (this model) | 0.818 |
| CNN + GloVe embeddings | 0.630 |
Increasing max_length from 256 to 512 tokens improved accuracy by
+6.1 points, confirming that truncation (98% of reviews exceed 256
words) was the main limiting factor in the first fine-tuning attempt.
The final model performs close to (within ~2 points of) a simple
linear SVM baseline trained on the same 1,600 examples — a
notable result given the SVM sees the full, untruncated text while
this model still only sees the first 512 tokens.