Downloads · 30 days
6
14% of all-time downloads
teglad/DistilRoBERTaEmotionClassifier
DistilRoBERTaEmotionClassifier is a text classification model from teglad. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model was created to demonstrate several MLOps practices and was for education purposes only. Please see the following GitHub repo covering the material
Downloads · 30 days
6
14% of all-time downloads
All-time downloads
44
Public
Parameters
82.1M
329 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors329 MB · 99%
From the Hugging Face model README
This model was created to demonstrate several MLOps practices and was for education purposes only. Please see the following GitHub repo covering the material
This model was trained on the Kaggle Emotions dataset, which has 6 classes.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# Load the model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("teglad/DistilRoBERTaEmotionClassifier")
tokenizer = AutoTokenizer.from_pretrained("teglad/DistilRoBERTaEmotionClassifier")
# Tokenize the input text, returning PyTorch tensors.
input_ids = tokenizer("Deep Learning models can be so difficult to understand, how do they even work?", return_tensors="pt")
# Pass the input_ids and attention_masks into the model
output = model(**input_ids)
# Get the position of the largest logit, this is the predicted class
prediction = torch.argmax(output.logits, dim=1).tolist()