Downloads · 30 days
5
5% of all-time downloads
mr-checker/yt-comments-sentiment-distilbert
yt-comments-sentiment-distilbert is a text classification model from mr-checker. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
- Base model: distilbert - Framework: Hugging Face Transformers (PyTorch backend) - Task: Multi‑class text classification - Classes: - Positive - Negative - Neutral - Off‑topic - Question
Downloads · 30 days
5
5% of all-time downloads
All-time downloads
98
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
title + comment_text for contextimport pandas as pd
from transformers import pipeline
# Load your fine-tuned model
sentiment_pipeline = pipeline(
"text-classification",
model="mr-checker/yt-comments-sentiment-distilbert", # replace with your repo/local path
tokenizer="mr-checker/yt-comments-sentiment-distilbert"
)
# Example dataframe (already merged with titles)
eval_df = pd.DataFrame({
"title": ["I Created a $1.000.000 Beauty Brand Using AI"],
"comment_text": ["This video is amazing, but credits are too expensive!"]
})
# Combine title + comment_text
eval_df["text"] = (
eval_df["title"].astype(str)
+ " [SEP] "
+ eval_df["comment_text"].astype(str)
)
# Run inference
results = sentiment_pipeline(
list(eval_df["text"]),
truncation=True,
max_length=256
)
# Attach predictions back to dataframe
eval_df["predicted_label"] = [r["label"] for r in results]
eval_df["confidence"] = [r["score"] for r in results]
print(eval_df[["title", "comment_text", "predicted_label", "confidence"]])