1602353775wzj commited on
Commit
ee6df5b
·
verified ·
1 Parent(s): 2b8df6f

Add TamilSangamLiteraryDeviceClassification (8 merged devices; stratified train/test)

Browse files
README.md ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ task_categories:
4
+ - text-classification
5
+ task_ids:
6
+ - multi-class-classification
7
+ language:
8
+ - ta
9
+ multilinguality:
10
+ - monolingual
11
+ size_categories:
12
+ - 1K<n<10K
13
+ pretty_name: TamilSangamLiteraryDeviceClassification
14
+ tags:
15
+ - poetry
16
+ - tamil
17
+ - sangam
18
+ - literary-device
19
+ - rhetoric
20
+ - multi-class-classification
21
+ - mteb
22
+ - poetrymteb
23
+ - embedding-evaluation
24
+ annotations_creators:
25
+ - expert-generated
26
+ source_datasets:
27
+ - Tamil-Sangam-Literature-Dataset
28
+ configs:
29
+ - config_name: default
30
+ data_files:
31
+ - split: train
32
+ path: data/train-*
33
+ - split: test
34
+ path: data/test-*
35
+ default: true
36
+ dataset_info:
37
+ - config_name: default
38
+ features:
39
+ - name: id
40
+ dtype: string
41
+ - name: line_number
42
+ dtype: int64
43
+ - name: poem
44
+ dtype: string
45
+ - name: transliteration
46
+ dtype: string
47
+ - name: english
48
+ dtype: string
49
+ - name: label
50
+ dtype: int64
51
+ - name: label_name
52
+ dtype: string
53
+ - name: original_device
54
+ dtype: string
55
+ splits:
56
+ - name: train
57
+ num_examples: 840
58
+ - name: test
59
+ num_examples: 211
60
+ ---
61
+
62
+ # TamilSangamLiteraryDeviceClassification
63
+
64
+ Multi-class **literary device / rhetoric classification** for classical **Tamil Sangam** verse lines (PoetryMTEB), derived from the [Tamil Sangam Literature Dataset](https://github.com/kameshkanna/Tamil-Sangam-Literature-Dataset).
65
+
66
+ Upstream `Literary Devices` strings are noisy (44 free-text labels, heavily skewed to `Imagery`). We **merge** near-duplicates and rare labels into a closed **8-class** taxonomy, then create a stratified train/test split for embedding evaluation.
67
+
68
+ ## Dataset Card
69
+
70
+ | Item | Description |
71
+ |------|-------------|
72
+ | **Source** | [Tamil Sangam Literature Dataset](https://github.com/kameshkanna/Tamil-Sangam-Literature-Dataset) (`Tamil Dangam.csv`) |
73
+ | **Languages** | Tamil (`ta`); English translation & Latin transliteration kept as auxiliaries |
74
+ | **Unit** | Verse **line** (`poem` = Original Tamil Text) |
75
+ | **Labels** | **8** merged literary-device classes |
76
+ | **Size** | train=840; test=211 (dropped empty text/label: 1) |
77
+ | **Splits** | Stratified by merged label ≈ 80% / 20%, seed=42 |
78
+ | **License** | Upstream repository terms (no explicit SPDX; research use — attribute source) |
79
+ | **Evaluation metrics** | Classification on embeddings: **accuracy**, **macro/micro F1** |
80
+
81
+ ## Label taxonomy (8)
82
+
83
+ | id | label_name | zh | gloss | train | test | total |
84
+ |---:|------------|----|-------|------:|-----:|------:|
85
+ | 0 | `Imagery` | 意象描写 | Imagery and related visual/emotional descriptive imagery | 486 | 122 | 608 |
86
+ | 1 | `Simile` | 明喻 | Simile | 102 | 26 | 128 |
87
+ | 2 | `Descriptive` | 描述 | Descriptive / setting description | 91 | 23 | 114 |
88
+ | 3 | `Narrative` | 叙事 | Narrative / narrative reflection | 41 | 10 | 51 |
89
+ | 4 | `DirectAddress` | 直接称呼 | Direct address to a hearer / addressee | 36 | 9 | 45 |
90
+ | 5 | `Metaphor` | 隐喻 | Metaphor | 26 | 6 | 32 |
91
+ | 6 | `RhetoricalQuestion` | 反问/设问 | Rhetorical question / question | 11 | 3 | 14 |
92
+ | 7 | `Other` | 其他修辞 | Merged rare devices (symbolism, personification, hyperbole, etc.) | 47 | 12 | 59 |
93
+
94
+ Codebook: `label_taxonomy.json`.
95
+
96
+ ### Merge rules (upstream → merged)
97
+
98
+ | original_device | merged label |
99
+ |-----------------|--------------|
100
+ | `Description` | `Descriptive` |
101
+ | `Descriptive` | `Descriptive` |
102
+ | `Setting` | `Descriptive` |
103
+ | `Direct Address` | `DirectAddress` |
104
+ | `Direct address` | `DirectAddress` |
105
+ | `Descriptive imagery` | `Imagery` |
106
+ | `Emotional imagery` | `Imagery` |
107
+ | `Imagery` | `Imagery` |
108
+ | `Visual imagery` | `Imagery` |
109
+ | `Metaphor` | `Metaphor` |
110
+ | `Narrative` | `Narrative` |
111
+ | `Narrative Reflection` | `Narrative` |
112
+ | `Admonition` | `Other` |
113
+ | `Conditional` | `Other` |
114
+ | `Conditional Statement` | `Other` |
115
+ | `Conditional statement` | `Other` |
116
+ | `Contrast` | `Other` |
117
+ | `Dialogue` | `Other` |
118
+ | `Direct Speech` | `Other` |
119
+ | `Direct speech` | `Other` |
120
+ | `Direct statement` | `Other` |
121
+ | `Emotional Expression` | `Other` |
122
+ | `Encouragement` | `Other` |
123
+ | `Exclamation` | `Other` |
124
+ | `Expression of Suffering` | `Other` |
125
+ | `Expression of longing` | `Other` |
126
+ | `Expression of well-wishes` | `Other` |
127
+ | `Historical Reference` | `Other` |
128
+ | `Hyperbole` | `Other` |
129
+ | `Hypothetical` | `Other` |
130
+ | `Irony` | `Other` |
131
+ | `Negative statement` | `Other` |
132
+ | `Personification` | `Other` |
133
+ | `Philosophical Reflection` | `Other` |
134
+ | `Quotation` | `Other` |
135
+ | `Reference` | `Other` |
136
+ | `Repetition` | `Other` |
137
+ | `Symbolism` | `Other` |
138
+ | `Theme` | `Other` |
139
+ | `Wish` | `Other` |
140
+ | `Question` | `RhetoricalQuestion` |
141
+ | `Rhetorical Question` | `RhetoricalQuestion` |
142
+ | `Rhetorical question` | `RhetoricalQuestion` |
143
+ | `Simile` | `Simile` |
144
+
145
+ Any upstream string not listed above is mapped to **`Other`**.
146
+
147
+ **Rationale:** `Imagery` alone covers ~57% of rows; many remaining labels have ≤4 examples and cannot support a reliable test split. Merging yields a compact, imbalanced-but-usable 8-way task.
148
+
149
+ ## Features
150
+
151
+ | Field | Type | Description |
152
+ |-------|------|-------------|
153
+ | `id` | string | Example id (`sangam-device-{line_number}`) |
154
+ | `line_number` | int64 | Upstream `Line Number` |
155
+ | `poem` | string | **Classification input**: Original Tamil Text |
156
+ | `transliteration` | string | Latin-script transliteration (auxiliary) |
157
+ | `english` | string | English translation (auxiliary) |
158
+ | `label` | int64 | Merged class id (0–7) |
159
+ | `label_name` | string | Canonical English class name |
160
+ | `original_device` | string | Raw upstream `Literary Devices` string (before merge) |
161
+
162
+ ## Construction method
163
+
164
+ 1. Load `Tamil Dangam.csv` (1052 lines).
165
+ 2. Map `Literary Devices` → 8-way taxonomy via the merge table above.
166
+ 3. Drop rows with empty Tamil text or missing device label.
167
+ 4. Stratified train/test split by `label_name` (seed=42, ≈ 80/19).
168
+
169
+ ## How to load
170
+
171
+ ```python
172
+ from datasets import load_dataset
173
+
174
+ ds = load_dataset("PoetryMTEB/TamilSangamLiteraryDeviceClassification")
175
+ print(ds["train"][0]["poem"])
176
+ print(ds["train"][0]["label_name"], ds["train"][0]["original_device"])
177
+ ```
178
+
179
+ ## Intended use / limitations
180
+
181
+ - PoetryMTEB multi-class probing of **Tamil poetic line** embeddings for rhetorical style.
182
+ - Labels inherit upstream annotation quality; `Imagery` remains dominant after merge.
183
+ - `Other` is a residual bucket — do not over-interpret fine-grained rhetoric inside it.
184
+ - Companion bitext release: `PoetryMTEB/TamilSangamBitextMining`.
185
+
186
+ ## Citation / provenance
187
+
188
+ Please attribute the upstream dataset:
189
+
190
+ - https://github.com/kameshkanna/Tamil-Sangam-Literature-Dataset
191
+ - This Hub packaging: `PoetryMTEB/TamilSangamLiteraryDeviceClassification`
192
+
193
+ ## License
194
+
195
+ Follow the upstream GitHub repository terms. This packaging redistributes line texts and merged device labels for research evaluation under PoetryMTEB.
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44a54c5c210136497322f19e4f51627a9c70e82eb66cdf14a9c94438a7c529e5
3
+ size 32798
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52422e4a6231a87f835eb006abc95ab63955a7e4b6e84f17b4dfbb5d8a5af554
3
+ size 104636
dataset_infos.yaml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ configs:
2
+ - config_name: default
3
+ data_files:
4
+ - path: data/train-*.parquet
5
+ split: train
6
+ - path: data/test-*.parquet
7
+ split: test
8
+ default: true
9
+ dataset_info:
10
+ configs:
11
+ - config_name: default
12
+ dataset_size: 137434
13
+ download_size: 137434
14
+ features:
15
+ - dtype: string
16
+ name: id
17
+ - dtype: int64
18
+ name: line_number
19
+ - dtype: string
20
+ name: poem
21
+ - dtype: string
22
+ name: transliteration
23
+ - dtype: string
24
+ name: english
25
+ - dtype: int64
26
+ name: label
27
+ - dtype: string
28
+ name: label_name
29
+ - dtype: string
30
+ name: original_device
31
+ splits:
32
+ - name: train
33
+ num_bytes: 104636
34
+ num_examples: 840
35
+ - name: test
36
+ num_bytes: 32798
37
+ num_examples: 211
label_taxonomy.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "n_classes": 8,
3
+ "labels": [
4
+ {
5
+ "id": 0,
6
+ "name": "Imagery",
7
+ "name_zh": "意象描写",
8
+ "gloss": "Imagery and related visual/emotional descriptive imagery"
9
+ },
10
+ {
11
+ "id": 1,
12
+ "name": "Simile",
13
+ "name_zh": "明喻",
14
+ "gloss": "Simile"
15
+ },
16
+ {
17
+ "id": 2,
18
+ "name": "Descriptive",
19
+ "name_zh": "描述",
20
+ "gloss": "Descriptive / setting description"
21
+ },
22
+ {
23
+ "id": 3,
24
+ "name": "Narrative",
25
+ "name_zh": "叙事",
26
+ "gloss": "Narrative / narrative reflection"
27
+ },
28
+ {
29
+ "id": 4,
30
+ "name": "DirectAddress",
31
+ "name_zh": "直接称呼",
32
+ "gloss": "Direct address to a hearer / addressee"
33
+ },
34
+ {
35
+ "id": 5,
36
+ "name": "Metaphor",
37
+ "name_zh": "隐喻",
38
+ "gloss": "Metaphor"
39
+ },
40
+ {
41
+ "id": 6,
42
+ "name": "RhetoricalQuestion",
43
+ "name_zh": "反问/设问",
44
+ "gloss": "Rhetorical question / question"
45
+ },
46
+ {
47
+ "id": 7,
48
+ "name": "Other",
49
+ "name_zh": "其他修辞",
50
+ "gloss": "Merged rare devices (symbolism, personification, hyperbole, etc.)"
51
+ }
52
+ ],
53
+ "merge_map": {
54
+ "Imagery": "Imagery",
55
+ "Visual imagery": "Imagery",
56
+ "Emotional imagery": "Imagery",
57
+ "Descriptive imagery": "Imagery",
58
+ "Simile": "Simile",
59
+ "Descriptive": "Descriptive",
60
+ "Description": "Descriptive",
61
+ "Setting": "Descriptive",
62
+ "Narrative": "Narrative",
63
+ "Narrative Reflection": "Narrative",
64
+ "Direct Address": "DirectAddress",
65
+ "Direct address": "DirectAddress",
66
+ "Metaphor": "Metaphor",
67
+ "Rhetorical Question": "RhetoricalQuestion",
68
+ "Rhetorical question": "RhetoricalQuestion",
69
+ "Question": "RhetoricalQuestion",
70
+ "Symbolism": "Other",
71
+ "Direct statement": "Other",
72
+ "Personification": "Other",
73
+ "Hyperbole": "Other",
74
+ "Emotional Expression": "Other",
75
+ "Conditional": "Other",
76
+ "Contrast": "Other",
77
+ "Direct Speech": "Other",
78
+ "Direct speech": "Other",
79
+ "Dialogue": "Other",
80
+ "Negative statement": "Other",
81
+ "Reference": "Other",
82
+ "Historical Reference": "Other",
83
+ "Quotation": "Other",
84
+ "Theme": "Other",
85
+ "Philosophical Reflection": "Other",
86
+ "Repetition": "Other",
87
+ "Conditional Statement": "Other",
88
+ "Conditional statement": "Other",
89
+ "Hypothetical": "Other",
90
+ "Expression of well-wishes": "Other",
91
+ "Expression of longing": "Other",
92
+ "Expression of Suffering": "Other",
93
+ "Wish": "Other",
94
+ "Encouragement": "Other",
95
+ "Admonition": "Other",
96
+ "Irony": "Other",
97
+ "Exclamation": "Other"
98
+ },
99
+ "default_unmapped": "Other",
100
+ "counts": {
101
+ "train": {
102
+ "Imagery": 486,
103
+ "Simile": 102,
104
+ "Descriptive": 91,
105
+ "Narrative": 41,
106
+ "Other": 47,
107
+ "Metaphor": 26,
108
+ "DirectAddress": 36,
109
+ "RhetoricalQuestion": 11
110
+ },
111
+ "test": {
112
+ "Imagery": 122,
113
+ "DirectAddress": 9,
114
+ "Narrative": 10,
115
+ "Descriptive": 23,
116
+ "Simile": 26,
117
+ "Other": 12,
118
+ "RhetoricalQuestion": 3,
119
+ "Metaphor": 6
120
+ },
121
+ "all": {
122
+ "Other": 59,
123
+ "Descriptive": 114,
124
+ "Metaphor": 32,
125
+ "Imagery": 608,
126
+ "Simile": 128,
127
+ "DirectAddress": 45,
128
+ "Narrative": 51,
129
+ "RhetoricalQuestion": 14
130
+ }
131
+ },
132
+ "split": {
133
+ "train_ratio": 0.8,
134
+ "seed": 42,
135
+ "stratify": "label_name"
136
+ }
137
+ }