1602353775wzj commited on
Commit
389ea8f
·
verified ·
1 Parent(s): 54c2614

Improve TCCP Dataset Card + schema (poem/label) + dataset_infos.yaml

Browse files
README.md CHANGED
@@ -1,46 +1,157 @@
1
- ---
2
- license: cc-by-4.0
3
- task_categories:
4
- - text-classification
5
- language:
6
- - zh
7
- tags:
8
- - art
9
- pretty_name: TCCP - Tang Chinese Classical Poetry Dataset
10
- size_categories:
11
- - 1K<n<10K
12
- ---
13
-
14
- # TCCP - 唐代中文古典诗歌数据集
15
-
16
- ## 数据概况
17
-
18
- TCCP数据集包含唐代古典诗歌,每首诗歌标注了主题和关键词。
19
-
20
- **总计**: 3206 首诗歌
21
-
22
- ### 数据集统计
23
- | 数据集 | 诗歌数量 | 主题数量 | 关键词数量 |
24
- |-------|----------|----------|------------|
25
- | train | 2804 | 9 | 24529 |
26
- | test | 243 | 9 | 2107 |
27
- | validation | 159 | 9 | 3064 |
28
-
29
-
30
- ### 数据格式
31
- python
32
- {
33
- "text": "诗歌正文",
34
- "title": "诗歌标题",
35
- "theme_label": "诗歌主题",
36
- "keywords": ["关键词1", "关键词2"]
37
- }
38
-
39
- ### 使用示例
40
- python
41
- from datasets import load_dataset
42
- dataset = load_dataset("PoetryMTEB/TCCP")
43
- print(dataset['train'][0])
44
- ## 数据来源
45
- 唐代古典诗歌数据集:https://github.com/shuizhonghaitong/classification_GAT
46
- 刘昱彤,吴斌,白婷.古诗词图谱的构建及分析研究[J].计算机研究与发展,2020,57(06):1252-1268.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - text-classification
5
+ task_ids:
6
+ - multi-class-classification
7
+ language:
8
+ - zh
9
+ multilinguality:
10
+ - monolingual
11
+ size_categories:
12
+ - 1K<n<10K
13
+ pretty_name: TCCP (Tang Chinese Classical Poetry Theme Classification)
14
+ tags:
15
+ - poetry
16
+ - chinese
17
+ - classical-chinese
18
+ - tang-poetry
19
+ - theme-classification
20
+ - multi-class-classification
21
+ - mteb
22
+ - poetrymteb
23
+ - embedding-evaluation
24
+ annotations_creators:
25
+ - expert-generated
26
+ source_datasets:
27
+ - shuizhonghaitong/classification_GAT
28
+ configs:
29
+ - config_name: default
30
+ data_files:
31
+ - split: train
32
+ path: data/train-*
33
+ - split: validation
34
+ path: data/validation-*
35
+ - split: test
36
+ path: data/test-*
37
+ default: true
38
+ dataset_info:
39
+ - config_name: default
40
+ features:
41
+ - name: id
42
+ dtype: string
43
+ - name: title
44
+ dtype: string
45
+ - name: poem
46
+ dtype: string
47
+ - name: label
48
+ dtype: int64
49
+ - name: label_name
50
+ dtype: string
51
+ - name: keywords
52
+ sequence: string
53
+ splits:
54
+ - name: train
55
+ num_examples: 2804
56
+ - name: validation
57
+ num_examples: 159
58
+ - name: test
59
+ num_examples: 243
60
+ ---
61
+
62
+ # TCCP — Tang Chinese Classical Poetry Theme Classification
63
+
64
+ Multi-class **theme classification** of **Tang-dynasty classical Chinese poetry** for PoetryMTEB embedding evaluation.
65
+
66
+ Upstream TCCP provides poem texts with expert/curated **theme** labels and keyword lists, originally used for graph-attention theme classification ([classification_GAT](https://github.com/shuizhonghaitong/classification_GAT)).
67
+
68
+ ## Dataset Card
69
+
70
+ | Item | Description |
71
+ |------|-------------|
72
+ | **Source** | [shuizhonghaitong/classification_GAT](https://github.com/shuizhonghaitong/classification_GAT) (TCCP) |
73
+ | **Paper** | 刘昱彤, 吴斌, 白婷. 古诗词图谱的构建及分析研究[J]. *计算机研究与发展*, 2020, 57(6): 1252-1268 |
74
+ | **Languages** | Classical Chinese / Chinese (`zh`) |
75
+ | **Unit** | Full poem text (`poem`) |
76
+ | **Labels** | Single-label **9** themes (思乡 / 送别 / 战争 / …) |
77
+ | **Size** | train=2804; validation=159; test=243; **total=3206** |
78
+ | **Splits** | Preserved from the previous PoetryMTEB/TCCP release (train / validation / test) |
79
+ | **License** | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (PoetryMTEB redistribution; cite original authors) |
80
+ | **Evaluation metrics** | Embedding classification: **accuracy**, **macro/micro F1**. Upstream GAT paper reports theme-classification accuracy. |
81
+
82
+ > **Note on size:** The upstream GitHub README mentions ~3,247 poems; this Hub packaging contains **3206** labeled poems after cleaning/split alignment of the prior PoetryMTEB release.
83
+
84
+ ## Label taxonomy (9)
85
+
86
+ | id | label_name | name_en | train | validation | test | total |
87
+ |---:|------------|---------|------:|-----------:|-----:|------:|
88
+ | 0 | `思乡` | Homesickness | 596 | 28 | 31 | 655 |
89
+ | 1 | `送别` | Farewell | 565 | 30 | 42 | 637 |
90
+ | 2 | `战争` | War | 546 | 26 | 34 | 606 |
91
+ | 3 | `怀人` | Longing for someone | 447 | 15 | 7 | 469 |
92
+ | 4 | `田园` | Pastoral | 168 | 12 | 19 | 199 |
93
+ | 5 | `山水` | Landscape | 136 | 8 | 14 | 158 |
94
+ | 6 | `咏物` | Object chanting | 119 | 11 | 28 | 158 |
95
+ | 7 | `闺怨` | Boudoir lament | 114 | 12 | 29 | 155 |
96
+ | 8 | `怀古` | Historical reflection | 113 | 17 | 39 | 169 |
97
+
98
+ Codebook: `label_taxonomy.json`.
99
+
100
+ ## Features
101
+
102
+ | Field | Type | Description |
103
+ |-------|------|-------------|
104
+ | `id` | string | Example id (`tccp-{split}-{idx}`) |
105
+ | `title` | string | Poem title |
106
+ | `poem` | string | **Classification input**: full poem body (formerly `text`) |
107
+ | `label` | int64 | Theme class id (0–8) |
108
+ | `label_name` | string | Theme name in Chinese (formerly `theme_label`) |
109
+ | `keywords` | list[string] | Keyword list associated with the poem |
110
+
111
+ Schema aligns with other PoetryMTEB classification datasets (`id`, `poem`, `label`, `label_name`).
112
+
113
+ ## Construction method
114
+
115
+ 1. Load the existing `PoetryMTEB/TCCP` parquet splits.
116
+ 2. Rename/normalize fields: `text`→`poem`, `theme_label`→`label_name` + integer `label`.
117
+ 3. Keep upstream `title` and `keywords`; assign stable ids.
118
+ 4. Write PoetryMTEB parquet shards + `dataset_infos.yaml` + Dataset Card.
119
+
120
+ No re-split was performed in this packaging pass (split sizes preserved for continuity with prior PoetryMTEB experiments).
121
+
122
+ ## How to load
123
+
124
+ ```python
125
+ from datasets import load_dataset
126
+
127
+ ds = load_dataset("PoetryMTEB/TCCP")
128
+ print(ds["train"][0]["poem"][:80])
129
+ print(ds["train"][0]["label_name"], ds["train"][0]["label"])
130
+ ```
131
+
132
+ ## Intended use
133
+
134
+ - PoetryMTEB / MTEB-style **multi-class classification** probing of classical Chinese poem embeddings (theme recognition).
135
+ - Literary / DH analyses of Tang poetry themes.
136
+
137
+ ## Citation
138
+
139
+ ```bibtex
140
+ @article{liu2020gushi,
141
+ title = {古诗词图谱的构建及分析研究},
142
+ author = {刘昱彤 and 吴斌 and 白婷},
143
+ journal = {计算机研究与发展},
144
+ volume = {57},
145
+ number = {6},
146
+ pages = {1252--1268},
147
+ year = {2020}
148
+ }
149
+ ```
150
+
151
+ Upstream code/data release: [https://github.com/shuizhonghaitong/classification_GAT](https://github.com/shuizhonghaitong/classification_GAT)
152
+
153
+ This Hub packaging: `PoetryMTEB/TCCP`
154
+
155
+ ## License
156
+
157
+ Distributed under **CC BY 4.0** for this PoetryMTEB packaging. Please cite the original paper and GitHub repository when using the data.
data/test-00000-of-00001.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:48876c7c985526889841a1a0453477df89e5700d9e640c94b1be05ba2fc90e0e
3
- size 49954
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18d155ba9266dac7154c9e0af9f7bc9f3adf3867eb35b71ca9c15df1dcf63877
3
+ size 52423
data/train-00000-of-00001.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a605bd725d13df890c3f987c1dae054423d1f9cbb1d7f92ab3556c71da4c7ba8
3
- size 1134852
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0829a72fa585cc2bdafcd50e5ffc2cb6f7578e79682e7b7dd8cf53dc471450d
3
+ size 1074015
data/validation-00000-of-00001.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a49d4c0cd7260d449fb963e0b767ab94e50ad9b411833042307062c651fb6aba
3
- size 70605
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89a3443b46170ada457aaf62244a4253681a636cad67b385ce3fdd03390cbd60
3
+ size 72391
dataset_infos.yaml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ configs:
2
+ - config_name: default
3
+ data_files:
4
+ - path: data/train-*.parquet
5
+ split: train
6
+ - path: data/validation-*.parquet
7
+ split: validation
8
+ - path: data/test-*.parquet
9
+ split: test
10
+ default: true
11
+ dataset_info:
12
+ configs:
13
+ - config_name: default
14
+ dataset_size: 1198829
15
+ download_size: 1198829
16
+ features:
17
+ - dtype: string
18
+ name: id
19
+ - dtype: string
20
+ name: title
21
+ - dtype: string
22
+ name: poem
23
+ - dtype: int64
24
+ name: label
25
+ - dtype: string
26
+ name: label_name
27
+ - sequence:
28
+ dtype: string
29
+ name: keywords
30
+ splits:
31
+ - name: train
32
+ num_bytes: 1074015
33
+ num_examples: 2804
34
+ - name: validation
35
+ num_bytes: 72391
36
+ num_examples: 159
37
+ - name: test
38
+ num_bytes: 52423
39
+ num_examples: 243
label_taxonomy.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "n_classes": 9,
3
+ "labels": [
4
+ {
5
+ "id": 0,
6
+ "name": "思乡",
7
+ "name_en": "Homesickness",
8
+ "name_zh": "思乡"
9
+ },
10
+ {
11
+ "id": 1,
12
+ "name": "送别",
13
+ "name_en": "Farewell",
14
+ "name_zh": "送别"
15
+ },
16
+ {
17
+ "id": 2,
18
+ "name": "战争",
19
+ "name_en": "War",
20
+ "name_zh": "战争"
21
+ },
22
+ {
23
+ "id": 3,
24
+ "name": "怀人",
25
+ "name_en": "Longing for someone",
26
+ "name_zh": "怀人"
27
+ },
28
+ {
29
+ "id": 4,
30
+ "name": "田园",
31
+ "name_en": "Pastoral",
32
+ "name_zh": "田园"
33
+ },
34
+ {
35
+ "id": 5,
36
+ "name": "山水",
37
+ "name_en": "Landscape",
38
+ "name_zh": "山水"
39
+ },
40
+ {
41
+ "id": 6,
42
+ "name": "咏物",
43
+ "name_en": "Object chanting",
44
+ "name_zh": "咏物"
45
+ },
46
+ {
47
+ "id": 7,
48
+ "name": "闺怨",
49
+ "name_en": "Boudoir lament",
50
+ "name_zh": "闺怨"
51
+ },
52
+ {
53
+ "id": 8,
54
+ "name": "怀古",
55
+ "name_en": "Historical reflection",
56
+ "name_zh": "怀古"
57
+ }
58
+ ],
59
+ "counts": {
60
+ "train": {
61
+ "战争": 546,
62
+ "怀古": 113,
63
+ "送别": 565,
64
+ "思乡": 596,
65
+ "咏物": 119,
66
+ "怀人": 447,
67
+ "闺怨": 114,
68
+ "田园": 168,
69
+ "山水": 136
70
+ },
71
+ "validation": {
72
+ "战争": 26,
73
+ "送别": 30,
74
+ "闺怨": 12,
75
+ "咏物": 11,
76
+ "怀古": 17,
77
+ "山水": 8,
78
+ "思乡": 28,
79
+ "田园": 12,
80
+ "怀人": 15
81
+ },
82
+ "test": {
83
+ "战争": 34,
84
+ "送别": 42,
85
+ "闺怨": 29,
86
+ "咏物": 28,
87
+ "怀古": 39,
88
+ "山水": 14,
89
+ "思乡": 31,
90
+ "田园": 19,
91
+ "怀人": 7
92
+ }
93
+ },
94
+ "source": {
95
+ "github": "https://github.com/shuizhonghaitong/classification_GAT",
96
+ "paper": "古诗词图谱的构建及分析研究"
97
+ }
98
+ }