dair-ai/emotion
Viewer β’ Updated β’ 437k β’ 33.2k β’ 531
Run aiknowyou/it-emotion-analyzer on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/aiknowyou/it-emotion-analyzer. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/aiknowyou/it-emotion-analyzer on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use aiknowyou/it-emotion-analyzer with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="aiknowyou/it-emotion-analyzer") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("aiknowyou/it-emotion-analyzer")
model = AutoModelForSequenceClassification.from_pretrained("aiknowyou/it-emotion-analyzer", device_map="auto")This is a model for emotion analysis of italian sentences trained on a translated dataset by Google Translator. It maps sentences & paragraphs with 6 emotions which are:
Using this model becomes easy when you have transformers installed:
pip install -U transformers
Then you can use the model like this:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
sentences = ["Questa Γ¨ una frase triste", "Questa Γ¨ una frase felice", "Questa Γ¨ una frase di stupore"]
tokenizer = AutoTokenizer.from_pretrained("aiknowyou/it-emotion-analyzer")
model = AutoModelForSequenceClassification.from_pretrained("aiknowyou/it-emotion-analyzer")
emotion_analysis = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
emotion_analysis(sentences)
Obtaining the following result:
[{'label': '0', 'score': 0.9481984972953796},
{'label': '1', 'score': 0.9299975037574768},
{'label': '5', 'score': 0.9543816447257996}]