Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 1 new columns ({'token_length'}) and 1 missing columns ({'length'}).

This happened while the json dataset builder was generating data using

hf://datasets/LongEmotion/LongEmotion/Emotion Classification/Emotion_Classification_Finentity.jsonl (at revision 3ba39fc800a370b1dc47214ea75ef6b030f4c4a4)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 714, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              id: int64
              content: string
              subject: string
              label: string
              source: string
              token_length: int64
              choices: list<item: string>
                child 0, item: string
              to
              {'id': Value('int64'), 'content': Value('string'), 'subject': Value('string'), 'label': Value('string'), 'source': Value('string'), 'choices': List(Value('string')), 'length': Value('int64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1339, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 972, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 894, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 970, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 1 new columns ({'token_length'}) and 1 missing columns ({'length'}).
              
              This happened while the json dataset builder was generating data using
              
              hf://datasets/LongEmotion/LongEmotion/Emotion Classification/Emotion_Classification_Finentity.jsonl (at revision 3ba39fc800a370b1dc47214ea75ef6b030f4c4a4)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

id
int64
content
string
subject
string
label
string
source
string
choices
list
length
int64
0
i had thought tarvik would come to the courtyard as he often did , but i guessed wrong . instead he sent lor back to us with instructions for lor to bring me alone to the castle after dark , and in secret . i do n't care much for that idea , i told nance . are you afraid to meet alone with tarvik ? she teased . no . th...
Dorea
Delight
Bookcorpus_305.txt
[ "Delight", "Anger", "Embarrassment", "Hopeless", "Pride", "Disappointment" ]
12,100
1
he could accept personal danger , but not for rachael . his day was tedious and he was distracted , imagining her working in a different time zone in a dangerous location . it was late at his apartment when she called . hey , dya miss me ? he smiled to himself . yeah , you know i do . whats going on down there ? you kn...
Simon
Delight
Bookcorpus_538.txt
[ "Delight", "Anger", "Embarrassment", "Hopeless", "Pride", "Disappointment" ]
24,110
2
"elaina did , judging by the astonished fury he could see in her eyes , even from this far .\nhe did(...TRUNCATED)
Andy
Gratitude & Joy
Bookcorpus_463.txt
["Gratitude & Anger","Embarrassment & Joy","Sadness & Anger","Gratitude & Joy","Embarrassment & Sadn(...TRUNCATED)
24,583
3
"brazen finally sent a rider to locate the county exec who he thought was on his way back from visit(...TRUNCATED)
Albert
Delight
Bookcorpus_438.txt
[ "Jealousy", "Embarrassment", "Nervousness", "Delight", "Disapproval", "Guilt" ]
21,790
4
"that is the last straw !\nan image with abby , and me came into my head .\nan image of me holding h(...TRUNCATED)
Momo
Relief
Bookcorpus_317.txt
[ "Relief", "Sadness", "Anger", "Hopeless", "Amusement", "Guilt" ]
20,156
5
"i walked most of the way , working for my bed and supper when i could , sleeping under hedges when (...TRUNCATED)
Andre
Amusement
Bookcorpus_456.txt
[ "Disapproval", "Amusement", "Annoyance", "Nervousness", "Fear", "Unbothered" ]
15,608
6
"brians face contorted in a way that i cant accurately describe , the way a young boy might watch a (...TRUNCATED)
Mike
Anger
Bookcorpus_659.txt
[ "Anger", "Disappointment", "Jealousy", "Nervousness", "Annoyance", "Gratitude" ]
26,700
7
"then the thing stepped out to fill the last three feet between the house and the fence .\nit was a (...TRUNCATED)
Julius
Hopeful
Bookcorpus_240.txt
[ "Hopeful", "Fear", "Hopeless", "Disapproval", "Remorse", "Embarrassment" ]
12,268
8
"valiente had supplied plentiful information on the targets security , so there would hopefully be n(...TRUNCATED)
Liam
Delight
Bookcorpus_14.txt
[ "Pride", "Jealousy", "Sadness", "Disappointment", "Embarrassment", "Delight" ]
26,325
9
"lancereaux passed away a few years back but he knew my wife pretty well before we were married .\ni(...TRUNCATED)
Joe
Delight
Bookcorpus_302.txt
[ "Delight", "Disappointment", "Anger", "Pessimism", "Remorse", "Anticipation" ]
20,082
End of preview.

YAML Metadata Warning:The task_categories "conversational" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

LongEmotion Logo

LongEmotion: Measuring Emotional Intelligence of LLMs in Long-Context Interaction

Paper Dataset


Dataset Description

LongEmotion is a comprehensive benchmark designed to evaluate the Emotional Intelligence (EI) of Large Language Models (LLMs) in long-context scenarios. It includes six carefully constructed tasks that test emotion recognition, psychological knowledge application, and empathetic generation — areas crucial for emotionally coherent and human-aligned AI systems.

Key Features

  • 🎯 Long-Context Evaluation: Average context length exceeds 15,000 tokens, with the longest reaching 43,588 tokens
  • 📊 Comprehensive Coverage: 1,156+ samples across 6 task types covering 3 EI dimensions
  • 🧠 Multi-Faceted Tasks: Emotion recognition, knowledge application, and empathetic generation
  • 🌐 Real-World Data: Sourced from psychological counseling cases, academic literature, and financial documents

Dataset Statistics

Task Type Samples Avg Length Metric
EC-Emobench Classification 200 19,345 tokens Accuracy
EC-Finentity Classification 200 43,588 tokens Accuracy
Emotion Detection Detection 136 4,592 tokens Accuracy
Emotion QA QA 120 - F1 Score
Emotion Conversation Dialogue 100 (400 turns) - LLM-Judge
Emotion Summary Summarization 150 - LLM-Judge
Emotion Expression Generation 8 types + 1 questionnaire - LLM-Judge

Dataset Structure

Data Fields

Emotion Classification (Emobench)

  • id: Sample identifier
  • content: Long-form text content
  • subject: Target entity for emotion classification
  • label: Emotion label (84 emotion categories including compound emotions)
  • source: Source of the text
  • choices: List of emotion choices
  • length: Token length of the content

Emotion Classification (Finentity)

  • id: Sample identifier
  • content: Long-form financial text
  • subject: Target entity
  • label: Sentiment label (Positive/Neutral/Negative)
  • source: Source document
  • token_length: Token length
  • choices: Sentiment choices

Emotion Detection

  • text: Text segments for comparison
  • label: Labels for each segment
  • length: Token length
  • ground_truth: Correct answer indicating the different segment

Emotion QA

  • number: Question identifier
  • problem: Question text
  • answer: Answer text
  • source: Source academic paper
  • context: Long-form context from psychology literature

Emotion Conversation

  • id: Conversation identifier
  • stages: List of dialogue stages
  • description: Scenario description

Emotion Summary

  • id: Case identifier
  • case_description: Case description
  • consultation_process: Consultation process
  • experience_and_reflection: Therapist's reflection
  • causes: Identified causes
  • symptoms: Symptoms
  • treatment_process: Treatment process
  • treatment_effect: Treatment outcomes

Emotion Expression

  • Situations: Emotion types with associated scenarios
  • Questionnaires: Standardized psychological questionnaires (e.g., PANAS)

Usage

Loading the Dataset

from datasets import load_dataset

# Note: Due to schema inconsistencies, direct loading may fail
# Recommended approach: Download and load manually

from huggingface_hub import snapshot_download
import json

# Download the dataset
local_dir = snapshot_download(
    repo_id="LongEmotion/LongEmotion",
    repo_type="dataset",
    local_dir="./LongEmotion_data"
)

# Load individual task data
def load_jsonl(file_path):
    with open(file_path, 'r', encoding='utf-8') as f:
        return [json.loads(line) for line in f]

# Example: Load Emotion Classification data
ec_data = load_jsonl('./LongEmotion_data/Emotion Classification/Emotion_Classification_Emobench.jsonl')
print(f"Loaded {len(ec_data)} samples")

# Example: Access a sample
sample = ec_data[0]
print(f"Subject: {sample['subject']}")
print(f"Label: {sample['label']}")
print(f"Content length: {sample['length']} tokens")

Example Usage for Different Tasks

1. Emotion Classification

import json

# Load Emobench data
with open('./LongEmotion_data/Emotion Classification/Emotion_Classification_Emobench.jsonl', 'r') as f:
    data = [json.loads(line) for line in f]

# Process a sample
sample = data[0]
prompt = f"""
Given the following text, identify the emotion of {sample['subject']}.

Text: {sample['content']}

Choices: {', '.join(sample['choices'])}

Answer:"""

# Use your LLM to generate response
# response = your_llm(prompt)

2. Emotion QA

# Load QA data
with open('./LongEmotion_data/Emotion QA/Emotion_QA.jsonl', 'r') as f:
    qa_data = [json.loads(line) for line in f]

sample = qa_data[0]
prompt = f"""
Context: {sample['context']}

Question: {sample['problem']}

Answer:"""

# Evaluate with F1 score against sample['answer']

3. Emotion Conversation

# Load conversation data
with open('./LongEmotion_data/Emotion Conversation/Emotion_Conversations.jsonl', 'r') as f:
    conv_data = [json.loads(line) for line in f]

sample = conv_data[0]
# Multi-turn dialogue simulation
for stage in sample['stages']:
    print(f"Stage: {stage['stage']}")
    # Generate empathetic response

Evaluation Methods

LongEmotion supports multiple evaluation approaches:

  1. Baseline: Direct processing of full text
  2. RAG: Retrieval-Augmented Generation
  3. CoEM: Collaborative Emotional Modeling (multi-agent RAG)
  4. Self-RAG: Adaptive retrieval
  5. Search-O1: Search-based optimization

CoEM Framework

The Collaborative Emotional Modeling (CoEM) framework integrates RAG with multi-agent emotional reasoning:

Input → Chunking → Initial Retrieval → Multi-Agent Enrichment → Re-Ranking → Generation → Output

Citation

If you use this dataset in your research, please cite:

@article{liu2025longemotion,
  title={LongEmotion: Measuring Emotional Intelligence of Large Language Models in Long-Context Interaction},
  author={Liu, Weichu and Xiong, Jing and Hu, Yuxuan and Li, Zixuan and Tan, Minghuan and Mao, Ningning and Zhao, Chenyang and Wan, Zhongwei and Tao, Chaofan and Xu, Wendong and others},
  journal={arXiv preprint arXiv:2509.07403},
  year={2025}
}

Paper

📄 ArXiv: https://arxiv.org/abs/2509.07403

Dataset Creation

Source Data

  • Emotion Classification (Emobench): BookCorpus novels with fine-grained emotion annotations
  • Emotion Classification (Finentity): Financial documents with entity-level sentiment
  • Emotion Detection: Mixed sources for emotion anomaly detection
  • Emotion QA: 30 academic papers on psychology and mental health
  • Emotion Conversation: Simulated psychological counseling dialogues
  • Emotion Summary: Real-world psychological counseling case reports
  • Emotion Expression: Emotion generation scenarios and standardized questionnaires

Annotation Process

The dataset combines automated extraction, expert annotation, and quality validation to ensure high-quality emotion labels and psychological accuracy.

Considerations for Using the Data

Social Impact

This dataset is designed to advance research in:

  • Emotionally intelligent AI systems
  • Mental health support applications
  • Human-AI interaction in sensitive contexts

Limitations

  • English-only content
  • Potential cultural biases in emotion categorization
  • Long-context processing may require significant computational resources

Additional Information

Licensing

Please refer to the repository for licensing information.

Contact

For questions or feedback, please open an issue on the dataset repository or contact the authors through the paper.

Acknowledgments

We thank all researchers and data providers who contributed to building the LongEmotion dataset.


Dataset Version: 1.0
Last Updated: 2026-01-17

Downloads last month
141

Paper for LongEmotion/LongEmotion