Instructions to use nanaaaa/BilingualChildEmo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nanaaaa/BilingualChildEmo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="nanaaaa/BilingualChildEmo")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("nanaaaa/BilingualChildEmo") model = AutoModelForSequenceClassification.from_pretrained("nanaaaa/BilingualChildEmo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
BilingualChildEmo — XLM-RoBERTa for Bilingual Emotion Detection in Children's Literature
Model Details
Model Description
This model is a fine-tuned version of XLM-RoBERTa for bilingual (Chinese–English) sentence-level emotion classification in children's literature. It classifies text into five basic emotion categories adapted from Parrott (2001): JOY, SADNESS, ANGER, FEAR, and LOVE.
The model was developed as part of the study "Examining emotions in English and translated Chinese children's literature: a bilingual emotion detection model based on LLMs", published in Language Resources and Evaluation (Springer, 2025).
- Developed by: Yanjin Liu, Sophia Yat Mei Lee, Dechao Li
- Funded by: Hong Kong Research Grants Council (RGC) General Research Fund (GRF), Project No. 15611021
- Shared by: Department of Chinese and Bilingual Studies, The Hong Kong Polytechnic University; Faculty of Humanities and Social Sciences, City University of Macau
- Model type: Text Classification (Transformer-based, fine-tuned XLM-RoBERTa)
- Language(s): Chinese (zh), English (en)
- License: Apache-2.0
- Fine-tuned from:
xlm-roberta-base
Model Sources
- Repository: nanaaaa/BilingualChildEmo — DOI: https://doi.org/10.57967/hf/1912
- Paper: Liu, Y., Lee, S. Y. M., & Li, D. (2025). Examining emotions in English and translated Chinese children's literature: a bilingual emotion detection model based on LLMs. Language Resources and Evaluation. https://doi.org/10.1007/s10579-025-09846-z
- Dataset: nanaaaa/BilingualChildEmo Dataset — DOI: https://doi.org/10.57967/hf/4379
Uses
Direct Use
This model is designed for sentence-level bilingual emotion classification in Chinese and English literary texts, particularly children's literature. Given a sentence in either language, the model predicts one of five emotion labels:
| Label | Description |
|---|---|
| JOY | Happiness, delight, celebration |
| SADNESS | Sorrow, grief, disappointment |
| ANGER | Annoyance, hostility, frustration with blame |
| FEAR | Anxiety about a real or perceived threat or danger |
| LOVE | Deep affection, attachment, or care for someone/something |
Downstream Use
The model can be applied to:
- Cross-linguistic emotion analysis in translated literary texts
- Computational translation studies examining emotional shifts between source and target texts
- Educational NLP tools analyzing affective content in reading materials for children
- Cross-cultural studies of emotional expression differences between Chinese and English
How to Get Started with the Model
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="nanaaaa/BilingualChildEmo"
)
# English example
result = classifier("So overjoyed were they at their deliverance that they laughed aloud.")
print(result) # Expected label: JOY
# Chinese example
result = classifier("可怜的人儿, 失去了他们唯一的儿子!")
print(result) # Expected label: SADNESS
- Downloads last month
- 19