1602353775wzj commited on
Commit
ccd8483
·
verified ·
1 Parent(s): af50689

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,3 +1,156 @@
1
  ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - zh
4
+ license: cc-by-4.0
5
+ task_categories:
6
+ - text-classification
7
+ - multi-label-classification
8
+ task_ids:
9
+ - multi-label-text-classification
10
+ - poetry-analysis
11
+ pretty_name: CCPD - Classical Chinese Poetry Dataset
12
+ size_categories:
13
+ - 1K<n<10K
14
+ dataset_info:
15
+ features:
16
+ - name: text
17
+ dtype: string
18
+ description: 诗歌正文内容
19
+ - name: title
20
+ dtype: string
21
+ description: 诗歌标题
22
+ - name: theme_labels
23
+ sequence: string
24
+ description: 主题标签列表(如思乡、怀人等)
25
+ - name: emotion_labels
26
+ sequence: string
27
+ description: 情感标签列表(如愁绪、哀伤等)
28
+ config_name: ccpd
29
+ version: 1.0.0
30
+ splits:
31
+ - name: train
32
+ num_bytes: 0
33
+ num_examples: 17103
34
+ ---
35
+
36
+ # CCPD - 古典中文诗歌多标签分类数据集
37
+
38
+ ## 数据集描述
39
+
40
+ CCPD (Classical Chinese Poetry Dataset) 是一个包含多标签标注的古典中文诗歌数据集,专门用于诗歌主题和情感的多标签分类研究。
41
+
42
+ ## 数据集详情
43
+
44
+ ### 基本信息
45
+ - **诗歌数量**: 17103 首
46
+ - **主题标签数量**: 10 个
47
+ - **情感标签数量**: 13 个
48
+ - **数据划分**: 全部作为训练集
49
+
50
+ ### 数据格式说明
51
+
52
+ 原始数据格式为:`主题标签#主题标签,情感标签#情感标签,标题,正文`
53
+
54
+ 处理后的数据格式如下:
55
+ python
56
+ {
57
+ "text": "诗歌正文",
58
+ "title": "诗歌标题",
59
+ "theme_labels": ["主题1", "主题2"], # 主题标签列表
60
+ "emotion_labels": ["情感1", "情感2"] # 情感标签列表
61
+ }
62
+ ### 标签统计
63
+
64
+ **前10个最常见主题标签**:
65
+ - 思乡: 9010次
66
+ - 怀人: 2263次
67
+ - 田园: 1213次
68
+ - 战争: 1139次
69
+ - 山水: 1071次
70
+ - 怀古: 689次
71
+ - 闺怨: 650次
72
+ - 悼亡: 576次
73
+ - 咏物: 566次
74
+ - 送别: 314次
75
+
76
+ **前10个最常见情感标签**:
77
+ - 想家: 12327次
78
+ - 哀伤: 3645次
79
+ - 愁绪: 3548次
80
+ - 孤独: 1646次
81
+ - 失意: 1576次
82
+ - 思念: 1468次
83
+ - 流泪: 953次
84
+ - 恐惧: 933次
85
+ - 怨恨: 682次
86
+ - 喜悦: 522次
87
+
88
+ ## 使用示例
89
+
90
+ ### 加载数据集
91
+
92
+ python
93
+ from datasets import load_dataset
94
+ dataset = load_dataset("PoetryMTEB/CCPD")
95
+ print(f"数据集大小: {len(dataset['train'])}")
96
+ print(dataset['train'][0])
97
+
98
+ ### 多标签分类任务
99
+ python
100
+ from sklearn.model_selection import train_test_split
101
+ import pandas as pd
102
+ 转换为DataFrame
103
+ df = pd.DataFrame(dataset['train'])
104
+ 合并所有标签
105
+ df['all_labels'] = df['theme_labels'] + df['emotion_labels']
106
+ 划分数据集
107
+ train_df, test_df = train_test_split(df, test_size=0.2, random_state=42)
108
+ train_df, val_df = train_test_split(train_df, test_size=0.1, random_state=42)
109
+ print(f"训练集: {len(train_df)}, 验证集: {len(val_df)}, 测试集: {len(test_df)}")
110
+ ### 分别处理主题和情感分类
111
+ python
112
+ 主题分类
113
+ def prepare_theme_classification(example):
114
+ return {
115
+ "text": example["text"],
116
+ "labels": example["theme_labels"]
117
+ }
118
+ 情感分类
119
+ def prepare_emotion_classification(example):
120
+ return {
121
+ "text": example["text"],
122
+ "labels": example["emotion_labels"]
123
+ }
124
+ 合并分类
125
+ def prepare_combined_classification(example):
126
+ return {
127
+ "text": example["text"],
128
+ "labels": example["theme_labels"] + example["emotion_labels"]
129
+ }
130
+
131
+ ## 任务应用
132
+
133
+ 本数据集适用于以下NLP任务:
134
+
135
+ 1. **多标签文本分类**
136
+ 2. **诗歌主题分析**
137
+ 3. **情感分析**
138
+ 4. **古典文学研究**
139
+ 5. **跨任务迁移学习**
140
+
141
+ ## 数据划分建议
142
+
143
+ 由于数据集全部作为训练集,建议使用者根据研究需求自行划分:
144
+
145
+ - **传统划分**: 70%训练,15%验证,15%测试
146
+ - **交叉验证**: 使用K折交叉验证
147
+ - **留出法**: 保留部分数据作为测试集
148
+
149
+ ## 引用信息
150
+
151
+ 如果您使用本数据集,请引用相关来源。
152
+
153
+ ## 免责声明
154
+
155
+ 本数据集仅用于学术研究目的。
156
+
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe810874df66f87dc89d6a723eeee43af96b11e3d36e31869b2e9fbdb5400565
3
+ size 3081983
dataset_metadata.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "CCPD - Classical Chinese Poetry Dataset",
3
+ "id": "ccpd-chinese-poetry",
4
+ "description": "A multi-label classical Chinese poetry dataset with theme and emotion annotations",
5
+ "language": [
6
+ "zh"
7
+ ],
8
+ "license": "cc-by-4.0",
9
+ "tags": [
10
+ "text-classification",
11
+ "multi-label-classification",
12
+ "poetry",
13
+ "chinese"
14
+ ],
15
+ "creators": [
16
+ {
17
+ "name": "CCPD Team"
18
+ }
19
+ ],
20
+ "date_created": "2024-01-01"
21
+ }