Downloads · 30 days
6
6% of all-time downloads
Qndhm/distilled-bert-imdb-lora-merged
distilled-bert-imdb-lora-merged is a text classification model from Qndhm. Use it when you need a label for a piece of text.
- This repository contains a distilbert-base-uncased model that has been fine-tuned for sentiment classification on the IMDB movie review dataset. - The fine-tuning was performed efficiently using the LoRA (Low-Rank A…
Downloads · 30 days
6
6% of all-time downloads
All-time downloads
107
Public
Parameters
67M
268 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
repo_id = "Qndhm/distilled-bert-imdb-lora-merged"
# Load the model and tokenizer from the Hub
model = AutoModelForSequenceClassification.from_pretrained(repo_id)
tokenizer = AutoTokenizer.from_pretrained(repo_id)
# Create a sentiment analysis pipeline
sentiment_classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
# Example 1: Negative review
text_negative = "This movie was not good at all. The acting was terrible and the plot was boring."
result_neg = sentiment_classifier(text_negative)
print(f"Text: '{text_negative}'")
print(f"Prediction: {result_neg[0]['label']}")
# Expected output: LABEL_0 (or NEGATIVE)
# Example 2: Positive review
text_positive = "I loved this movie, it was fantastic! The visuals were stunning and the story was compelling."
result_pos = sentiment_classifier(text_positive)
print(f"\nText: '{text_positive}'")
print(f"Prediction: {result_pos[0]['label']}")
# Expected output: LABEL_1 (or POSITIVE)