Instructions to use bardsai/twitter-emotion-pl-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bardsai/twitter-emotion-pl-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="bardsai/twitter-emotion-pl-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("bardsai/twitter-emotion-pl-base") model = AutoModelForSequenceClassification.from_pretrained("bardsai/twitter-emotion-pl-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download README.md from bardsai/twitter-emotion-pl-base: direct link, hf CLI and curl.
- Browser
- Download file 3.27 kB
-
https://huggingface.co/bardsai/twitter-emotion-pl-base/resolve/main/README.md
- Command line
-
hf download hf://bardsai/twitter-emotion-pl-base/README.md
-
curl -L -o README.md https://huggingface.co/bardsai/twitter-emotion-pl-base/resolve/main/README.md
language:
- pl
license: cc-by-4.0
library_name: transformers
pipeline_tag: text-classification
tags:
- text-classification
- twitter
- emotion
- polish
- herbert
base_model: allegro/herbert-base-cased
datasets:
- tweet_eval
metrics:
- f1
- accuracy
- precision
- recall
widget:
- text: >-
Nigdy przegrana nie sprawiła mi takiej radości. Szczęście i Opatrzność
mają znaczenie Gratuluje @pzpn_pl
example_title: Example 1
- text: >-
Osoby z Ukrainy zapłacą za życie w centrach pomocy? Sprzeczne prawem UE,
niehumanitarne, okrutne.
example_title: Example 2
model-index:
- name: twitter-emotion-pl-base
results:
- task:
type: text-classification
name: Emotion Classification
dataset:
name: TweetEval (translated to Polish)
type: tweet_eval
metrics:
- type: f1
value: 0.756
name: F1 (macro)
- type: precision
value: 0.767
name: Precision (macro)
- type: recall
value: 0.75
name: Recall (macro)
- type: accuracy
value: 0.789
name: Accuracy
Twitter emotion PL (base)
Twitter emotion PL (base) is a model based on herbert-base for analyzing emotion of Polish twitter posts. It was trained on the translated version of TweetEval by Barbieri et al., 2020 for 10 epochs on single RTX3090 gpu.
The model will give you a four labels: joy, optimism, sadness and anger.
How to use
You can use this model directly with a pipeline for text classification:
from transformers import pipeline
nlp = pipeline("text-classification", model="bardsai/twitter-emotion-pl-base")
nlp("Nigdy przegrana nie sprawiła mi takiej radości. Szczęście i Opatrzność mają znaczenie Gratuluje @pzpn_pl")
[{'label': 'joy', 'score': 0.5163766145706177}]
Performance
| Metric | Value |
|---|---|
| f1 macro | 0.756 |
| precision macro | 0.767 |
| recall macro | 0.750 |
| accuracy | 0.789 |
| samples per second | 131.6 |
(The performance was evaluated on RTX 3090 gpu)
Changelog
- 2023-07-19: Initial release
License
This model is released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license, inherited from the base model allegro/herbert-base-cased (also CC BY 4.0).
Attribution: HerBERT — Allegro ML Research and the Linguistic Engineering Group at the Institute of Computer Science, Polish Academy of Sciences; Twitter emotion PL (base) — bards.ai.
About bards.ai
At bards.ai, we focus on providing machine learning expertise and skills to our partners, particularly in the areas of nlp, machine vision and time series analysis. Our team is located in Wroclaw, Poland. Please visit our website for more information: bards.ai
Let us know if you use our model :). Also, if you need any help, feel free to contact us at info@bards.ai