Krat6s/fitness-youtube-comments
Viewer • Updated • 92.2k • 37
How to use Krat6s/fitness-comment-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Krat6s/fitness-comment-classifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Krat6s/fitness-comment-classifier")
model = AutoModelForSequenceClassification.from_pretrained("Krat6s/fitness-comment-classifier")Fine-tuned distilbert-base-uncased for classifying YouTube comments from fitness
influencer videos into 5 categories: fitness, nutrition, motivational, challenge, product.
| Class | Precision | Recall | F1 |
|---|---|---|---|
| challenge | 0.49 | 0.47 | 0.48 |
| fitness | 0.54 | 0.55 | 0.54 |
| motivational | 0.46 | 0.57 | 0.51 |
| nutrition | 0.67 | 0.57 | 0.62 |
| product | 0.58 | 0.51 | 0.54 |
| overall | 0.54 |
| Baseline | Accuracy |
|---|---|
| Majority class (always predict challenge) | 22.9% |
| Fine-tuned DistilBERT | 53.6% |
| Improvement | +30.7pp |
from transformers import pipeline
classifier = pipeline('text-classification',
model='Krat6s/fitness-comment-classifier')
classifier("This protein shake recipe is amazing with oat milk")
# {'label': 'nutrition', 'score': 0.873}