Instructions to use KBLab/emotional-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use KBLab/emotional-classification with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("KBLab/emotional-classification") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - setfit
How to use KBLab/emotional-classification with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("KBLab/emotional-classification") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
update README with accuracy graph
Browse files
README.md
CHANGED
|
@@ -16,6 +16,10 @@ This is a [SetFit model](https://github.com/huggingface/setfit) that can be used
|
|
| 16 |
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
|
| 17 |
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
## The data
|
| 20 |
The model has been trained on news headlines that have been manually annotated at KBLab by the PhD student Nora Hansson Bittár.
|
| 21 |
|
|
|
|
| 16 |
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
|
| 17 |
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
| 18 |
|
| 19 |
+
Accuracy on a number of experiments can be found in the figure below.
|
| 20 |
+
|
| 21 |
+
<img src="./emotional_accuracy.svg">
|
| 22 |
+
|
| 23 |
## The data
|
| 24 |
The model has been trained on news headlines that have been manually annotated at KBLab by the PhD student Nora Hansson Bittár.
|
| 25 |
|