Model Card for Model ID

This model is a fine-tuned version of distilbert-base-uncased for binary sentiment classification. It was trained on the IMDB movie review dataset to distinguish between positive and negative sentiments. Suitable for sentiment analysis tasks involving short to medium-length English texts.

Model Details

Model Description

This model is a fine-tuned version of distilbert-base-uncased on the IMDB dataset for sentiment analysis. It was trained using Hugging Face's Trainer API on a binary classification task (positive vs. negative sentiment). The model achieves competitive accuracy on a balanced validation split.

  • Task: Sentiment Analysis

  • Dataset: A custom preprocessed version of the IMDB Movie Reviews dataset

  • Labels:

1: Positive

0: Negative

  • Evaluation Metrics: Accuracy

  • Developed by: Selahattin Nazlı

  • Model type: Transformer-based binary text classification model

  • Language(s) (NLP): English

  • License: Apache 2.0

  • Finetuned from model: distilbert-base-uncased

Model Sources

  • Pretrained base model: distilbert-base-uncased

  • Dataset used for fine-tuning: imdb

Uses

This model is fine-tuned for binary sentiment classification on movie reviews (positive vs. negative). It is suitable for:

Researchers and developers working on sentiment analysis tasks.

Educational or experimental purposes involving transformer-based classification.

Applications that require simple text sentiment analysis in English.

The model is optimized for text classification tasks where input is a short or medium-length English sentence or paragraph, such as user reviews, social media posts, or customer feedback.

Important Note: This model is trained on the IMDB dataset and may not generalize well to domains outside movie reviews without further fine-tuning.

Direct Use

The model can be directly used for binary sentiment classification tasks without any additional fine-tuning. Given an English text input such as a movie review, it returns a label:

1 → Positive sentiment

0 → Negative sentiment

You can load and use the model as follows:

from transformers import AutoTokenizer, AutoModelForSequenceClassification from transformers import pipeline

model = AutoModelForSequenceClassification.from_pretrained("SelahattinNazli/fine_tuned_distilbert_imdb") tokenizer = AutoTokenizer.from_pretrained("SelahattinNazli/fine_tuned_distilbert_imdb")

sentiment_pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer) sentiment_pipeline("This movie was amazing!")

This will return the predicted sentiment label and its confidence score.

Out-of-Scope Use

This model is specifically fine-tuned for sentiment analysis on English movie reviews and similar short to medium-length texts. It is not recommended for:

Analyzing texts in languages other than English.

Handling domain-specific jargon or highly technical texts without further fine-tuning.

Detecting sarcasm, irony, or nuanced emotional states beyond simple positive/negative sentiment.

Use in high-stakes applications such as medical, legal, or safety-critical decision making.

Any malicious or harmful purposes, including spreading misinformation or manipulating public opinion.

Users should carefully evaluate the model’s suitability for their specific use case and consider additional training or safeguards where needed.

Training Hyperparameters

  • Training regime: FP32 (32-bit floating point) precision

  • Number of epochs: 3

  • Batch size: 16 (per device, for both training and evaluation)

  • Learning rate: 2e-5

  • Weight decay: 0.01

  • Evaluation strategy: Evaluation and checkpoint saving performed at the end of each epoch

  • Model selection: Best model loaded at the end of training based on accuracy metric

  • Optimizer: AdamW (default in Trainer)

  • Metric used for model selection: Accuracy

Results

The model was trained for 3 epochs on the IMDB sentiment classification task. Validation loss and accuracy after each epoch are summarized in the following table:

Epoch Validation Loss Accuracy

1 0.3575 85.42%

2 0.3737 87.08%

3 0.4176 86.67%

The accuracy improved from the first to the second epoch, reaching its peak at 87.08%. Although validation loss slightly increased after the second epoch, accuracy remained stable, indicating good generalization without severe overfitting. The best model, based on accuracy, was selected at the end of training.

Usage & Limitations

Example Usage

from transformers import pipeline

classifier = pipeline("text-classification", model="SelahattinNazli/fine_tuned_distilbert_imdb")

result = classifier("This movie was fantastic!") print(result)

Output:

[{'label': 'LABEL_1', 'score': 0.97}]

Interpretation of Labels

LABEL_1: Positive sentiment

LABEL_0: Negative sentiment

Known Limitations

The model is trained solely on English movie reviews. Performance may degrade on texts from other domains (e.g., news, legal, or medical).

Does not handle sarcasm, irony, or ambiguous sentiment well.

Not designed for multi-class classification or multilingual text.

Suggested Improvements

Fine-tune on additional datasets for other domains or languages.

Combine with rule-based or prompt-based filters to reduce misclassification in edge cases.

Summary

This fine-tuned DistilBERT model provides effective binary sentiment classification on English movie reviews, achieving over 87% accuracy on the validation set. Trained on the IMDB dataset for three epochs with standard hyperparameters, the model demonstrates solid generalization performance for short to medium-length text inputs. It is suitable for use cases requiring automated sentiment analysis of user-generated content in English.

Model Card Contact

For inquiries or collaboration:

📧 selahattinnazli01@gmail.com

🔗 www.linkedin.com/in/selahattinnazli0106

Downloads last month
13
Safetensors
Model size
67M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SelahattinNazli/fine_tuned_distilbert_imdb

Finetuned
(9214)
this model