Text Classification
Transformers
PyTorch
Danish
bert
sentiment
emotion
danish
text-embeddings-inference
Instructions to use NikolajMunch/danish-emotion-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NikolajMunch/danish-emotion-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="NikolajMunch/danish-emotion-classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("NikolajMunch/danish-emotion-classification") model = AutoModelForSequenceClassification.from_pretrained("NikolajMunch/danish-emotion-classification") - Notebooks
- Google Colab
- Kaggle
-- EMODa --
BERT-model for danish multi-class classification of emotions
Classifies a danish sentence into one of 6 different emotions:
| Danish emotion | Ekman's emotion |
|---|---|
| ๐ Afsky | Disgust |
| ๐จ Frygt | Fear |
| ๐ Glรฆde | Joy |
| ๐ฑ Overraskelse | Surprise |
| ๐ข Tristhed | Sadness |
| ๐ Vrede | Anger |
How to use
from transformers import pipeline
model_path = "NikolajMunch/danish-emotion-classification"
classifier = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
prediction = classifier("Jeg er godt nok ked af at mine SMS'er er slettet")
print(prediction)
# [{'label': 'Tristhed', 'score': 0.9725030660629272}]
or
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("NikolajMunch/danish-emotion-classification")
model = AutoModelForSequenceClassification.from_pretrained("NikolajMunch/danish-emotion-classification")
- Downloads last month
- 13