Emotion Identification for French in Written Texts: Considering their Modes of Expression as a Step Towards Text Complexity Analysis
Paper โข 2405.14385 โข Published
Run TextToKids/CamemBERT-base-EmoTextToKids 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/TextToKids/CamemBERT-base-EmoTextToKids. 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/TextToKids/CamemBERT-base-EmoTextToKids 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 TextToKids/CamemBERT-base-EmoTextToKids with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="TextToKids/CamemBERT-base-EmoTextToKids") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("TextToKids/CamemBERT-base-EmoTextToKids")
model = AutoModelForSequenceClassification.from_pretrained("TextToKids/CamemBERT-base-EmoTextToKids", device_map="auto")# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("TextToKids/CamemBERT-base-EmoTextToKids")
model = AutoModelForSequenceClassification.from_pretrained("TextToKids/CamemBERT-base-EmoTextToKids", device_map="auto")Classification model for
The prompt template is:
before:{previous_sentence}</s>current: {target_sentence}</s>after:{next_sentence}</s>
Labels are returned in the following order: 0. sentence is emotional
See the original paper for details about training.
@inproceedings{etienne2024emotion,
title={Emotion Identification for French in Written Texts: Considering Modes of Emotion Expression as a Step Towards Text Complexity Analysis},
author={{\'E}tienne, Aline and Battistelli, Delphine and Lecorv{\'e}, Gw{\'e}nol{\'e}},
booktitle={Proceedings of the 14th ACL Workshop on Computational Approaches to Subjectivity, Sentiment & Social Media Analysis (WASSA)},
year={2024}
}
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="TextToKids/CamemBERT-base-EmoTextToKids")