Downloads · 30 days
5
19% of all-time downloads
znafian/multilabel-text-classifier
multilabel-text-classifier is a machine learning model from znafian. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is fine-tuned from DistilBERT for multilabel text classification.
Downloads · 30 days
5
19% of all-time downloads
All-time downloads
26
Public
Repo size
797 MB
Likes
0
Public
Click a slice to open those files.
.pt266 MB · 50%
From the Hugging Face model README
This model is fine-tuned from DistilBERT for multilabel text classification.
import torch
from transformers import DistilBertTokenizer
# Load model and tokenizer
tokenizer = DistilBertTokenizer.from_pretrained('multilabel-text-classifier')
model = torch.load('multilabel-text-classifier/pytorch_model.bin')
# Example prediction
text = "Your input text here"
inputs = tokenizer(text, return_tensors="pt", max_length=157, truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.sigmoid(outputs).numpy()
['amusement', 'anger', 'annoyance', 'caring', 'confusion', 'disappointment', 'disgust', 'embarrassment', 'excitement', 'fear', 'gratitude', 'joy', 'love', 'sadness']