imdb-sentiment-demo / README.md
voxmenthe's picture
add full app and model initial test
472f1d2
|
raw
history blame
1.74 kB
metadata
language: en
tags:
  - sentiment-analysis
  - modernbert
  - imdb
datasets:
  - imdb
metrics:
  - accuracy
  - f1

ModernBERT IMDb Sentiment Analysis Model

Model Description

Fine-tuned ModernBERT model for sentiment analysis on IMDb movie reviews. Achieves 95.75% accuracy on the test set.

Usage

from transformers import AutoModelForSequenceClassification, AutoTokenizer

model = AutoModelForSequenceClassification.from_pretrained("voxmenthe/modernbert-imdb-sentiment")
tokenizer = AutoTokenizer.from_pretrained("answerdotai/ModernBERT-base")

# Input processing
inputs = tokenizer("This movie was fantastic!", return_tensors="pt")
outputs = model(**inputs)

# Get the predicted class
predicted_class_id = outputs.logits.argmax().item()

# Convert class ID to label
predicted_label = model.config.id2label[predicted_class_id]
print(f"Predicted label: {predicted_label}")

Model Card

Model Details

  • Model Name: ModernBERT IMDb Sentiment Analysis
  • Base Model: answerdotai/ModernBERT-base
  • Task: Sentiment Analysis
  • Dataset: IMDb Movie Reviews
  • Training Epochs: 5

Model Performance

  • Test Accuracy: 95.75%
  • Test F1 Score: 95.75%

Model Architecture

  • Base Model: answerdotai/ModernBERT-base
  • Task-Specific Head: ClassifierHead (from classifiers.py)
  • Number of Labels: 2 (Positive, Negative)

Model Inference

  • Input Format: Text (single review)
  • Output Format: Predicted sentiment label (Positive or Negative)

Model Version

  • Version: 1.0
  • Date: 2025-05-07

Model License

  • License: MIT License

Model Contact

Model Citation

  • Citation: voxmenthe/modernbert-imdb-sentiment