KBLab / emotional-classification

huggingface.co
Total runs: 1.7K
24-hour runs: 0
7-day runs: 7
30-day runs: 164
Model's Last Updated: June 22 2023
text-classification

Introduction of emotional-classification

Model Details of emotional-classification

gilleti/emotional-classification

This is a SetFit model that can be used for classification of emotions in Swedish text. The model supports seven basic emotions, listed below. The model has been trained using an efficient few-shot learning technique that involves:

  1. Finetuning a KBLab Sentence Transformer in Swedish with contrastive learning.
  2. Training a classification head with features from the finetuned Sentence Transformer.

Accuracy on a number of experiments on a minimal test set (35 examples) can be found in the figure below.

plot

Please note that these results are not a good representation of the model's actual performance. As previously stated, the test set is tiny and the examples in that test set are chosen to be good examples of the categories at hand. This is not the case with real life data. The model will be properly evaluated on real data at a later time.

Id to emotional label schema is as follows:

0 : absence of emotion
1 : happiness (glädje)
2 : love/empathy (kärlek/empati)
3: fear/anxiety (oro/rädsla)
4: sadness/disappointment (sorg/besvikelse)
5: anger/hate (ilska/hat)
6: hope/anticipation (hopp/förväntan)
The data

The model has been trained on news headlines that have been manually annotated at KBLab by the PhD student Nora Hansson Bittár.

Usage

To use this model for inference, first install the SetFit library:

python -m pip install setfit

You can then run inference as follows:

from setfit import SetFitModel

# Download from Hub and run inference
model = SetFitModel.from_pretrained("KBLab/emotional-classification")
# Run inference
preds = model(["Ingen tech-dystopi slår människans inre mörker", "Ina Lundström: Jag har två Bruce-tatueringar"])

This outputs predictions sadness/disappointment and absence of emotion. Keep in mind that these examples are cherrypicked as most headlines (which is what the model is trained on) are rarely as clear.

BibTeX entry and citation info
@article{https://doi.org/10.48550/arxiv.2209.11055,
doi = {10.48550/ARXIV.2209.11055},
url = {https://arxiv.org/abs/2209.11055},
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Efficient Few-Shot Learning Without Prompts},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}

Runs of KBLab emotional-classification on huggingface.co

1.7K
Total runs
0
24-hour runs
0
3-day runs
7
7-day runs
164
30-day runs

More Information About emotional-classification huggingface.co Model

More emotional-classification license Visit here:

https://choosealicense.com/licenses/apache-2.0

emotional-classification huggingface.co

emotional-classification huggingface.co is an AI model on huggingface.co that provides emotional-classification's model effect (), which can be used instantly with this KBLab emotional-classification model. huggingface.co supports a free trial of the emotional-classification model, and also provides paid use of the emotional-classification. Support call emotional-classification model through api, including Node.js, Python, http.

emotional-classification huggingface.co Url

https://huggingface.co/KBLab/emotional-classification

KBLab emotional-classification online free

emotional-classification huggingface.co is an online trial and call api platform, which integrates emotional-classification's modeling effects, including api services, and provides a free online trial of emotional-classification, you can try emotional-classification online for free by clicking the link below.

KBLab emotional-classification online free url in huggingface.co:

https://huggingface.co/KBLab/emotional-classification

emotional-classification install

emotional-classification is an open source model from GitHub that offers a free installation service, and any user can find emotional-classification on GitHub to install. At the same time, huggingface.co provides the effect of emotional-classification install, users can directly use emotional-classification installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

emotional-classification install url in huggingface.co:

https://huggingface.co/KBLab/emotional-classification

Url of emotional-classification

emotional-classification huggingface.co Url

Provider of emotional-classification huggingface.co

KBLab
ORGANIZATIONS

Other API from KBLab

huggingface.co

Total runs: 9.8K
Run Growth: -12.7K
Growth Rate: -129.27%
Updated:August 27 2025
huggingface.co

Total runs: 952
Run Growth: -4.0K
Growth Rate: -422.48%
Updated:August 27 2025