遇见数据集

Traditional Culture Text Sentiment Analysis via Domain Pretraining and Reinforcement Learning

收藏
Zenodo2026-07-15 更新2026-08-01 收录
官方服务:

资源简介:

Traditional Culture Text Sentiment Analysis via Domain Pretraining and Reinforcement Learning [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)][![PyTorch](https://img.shields.io/badge/PyTorch-2.x-red.svg)][![License](https://img.shields.io/badge/License-MIT-green.svg)] Official implementation of the paper: > Traditional Culture Text Sentiment Analysis via Domain Pretraining and Reinforcement Learning Overview Traditional culture texts (e.g., classical poetry, literary Chinese, historical narratives, festival customs, and cultural heritage descriptions) often express emotions implicitly through imagery, symbolism, historical context, and rhetorical devices rather than explicit sentiment words. This project introduces a culture-aware sentiment analysis framework that combines: - Domain-specific pretraining for learning cultural representations- Reinforcement learning alignment for optimizing structured sentiment generation- Large Language Models (LLMs) as the backbone Instead of predicting only a sentiment label, the model generates a structured output including: - Sentiment polarity- Fine-grained emotions- Emotion intensity- Cultural clues- Natural language rationale Framework The overall pipeline consists of three stages: TCT-Pretrain Corpus │ ▼ Domain-Specific Pretraining ┌───────────────┐ │ Cultural Structure Modeling │ │ Sentiment-Oriented Learning │ └───────────────┘ │ ▼ Supervised Fine-Tuning │ ▼ Reinforcement Learning (Task + Quality + Robustness Rewards) │ ▼ Structured Sentiment Generation Features - ✅ Culture-aware domain pretraining- ✅ Structured sentiment analysis- ✅ Reinforcement learning alignment- ✅ Explainable rationale generation- ✅ Cultural clue extraction- ✅ Robust sentiment prediction for implicit emotions Structured Output Given a traditional culture text, the model predicts: json{ "polarity": "Negative", "emotion": [ "Longing", "Nostalgia" ], "intensity": 4, "cultural_clues": [ "Moon", "Autumn", "Festival", "Distance from home" ], "rationale": "The poem conveys homesickness through moon imagery and Mid-Autumn cultural symbolism."} Method 1. Domain Pretraining The model is first adapted using a large-scale corpus of traditional culture texts. Two pretraining objectives are proposed: - Cultural Structure Modeling (CSM)- Sentiment-Oriented Discrimination (SOD) These objectives enable the model to learn: - cultural imagery- historical references- literary allusions- implicit emotional patterns --- 2. Reinforcement Learning Alignment After supervised fine-tuning, reinforcement learning further optimizes structured generation. The reward consists of: - Task Reward - polarity - emotion - intensity - Quality Reward - rationale quality - cultural clue grounding - schema validity - Robustness Reward - hard cases - prompt stability - cross-domain generalization Project Structure .├── data/│ ├── pretrain/│ ├── sentiment/│├── models/│├── scripts/│├── training/│ ├── pretrain.py│ ├── sft.py│ ├── rl.py│├── evaluation/│├── configs/│├── checkpoints/│├── requirements.txt│└── README.md Installation bashgit clone https://github.com/yourname/TCT-SA.git cd TCT-SA pip install -r requirements.txt Training Domain Pretraining bashpython training/pretrain.py Supervised Fine-Tuning bashpython training/sft.py Reinforcement Learning bashpython training/rl.py Evaluation bashpython evaluation/evaluate.py Evaluation metrics include: - Macro-F1- Hard-F1- CMR- BERTScore- Generalization Gap- Robustness Stability Dataset The framework uses two datasets: TCT-Pretrain Corpus For domain adaptation. Includes: - Classical poems- Literary Chinese- Historical texts- Festival customs- Traditional art reviews- Cultural heritage descriptions TCT-Sentiment Dataset Annotated with: - polarity- emotion- intensity- cultural clues- rationale Supported Backbone Models - Qwen2.5- LLaMA 3.1- DeepSeek- InternLM- Baichuan- Yi Citation bibtex@article{fan2025tctsa, title={Traditional Culture Text Sentiment Analysis via Domain Pretraining and Reinforcement Learning}, author={Fan, Yaping and Cui, Jianai and Yang, Huan}, journal={Frontiers}, year={2025}} License MIT License Contact For questions or collaborations, please open an issue or contact the authors.

提供机构:
Zenodo
创建时间:
2026-07-15
二维码
社区交流群
二维码
科研交流群
商业服务