ccasimiro commited on
Commit
a054402
1 Parent(s): 13d7552

upload dataset

Browse files
Files changed (6) hide show
  1. .gitattributes +3 -0
  2. README.md +240 -0
  3. dev.json +3 -0
  4. tecla.py +112 -0
  5. test.json +3 -0
  6. train.json +3 -0
.gitattributes CHANGED
@@ -25,3 +25,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
+ train.json filter=lfs diff=lfs merge=lfs -text
29
+ dev.json filter=lfs diff=lfs merge=lfs -text
30
+ test.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ languages:
3
+ - ca
4
+ ---
5
+ # TeCla (Text Classification) Catalan dataset
6
+
7
+ ## BibTeX citation
8
+
9
+ If you use any of these resources (datasets or models) in your work, please cite our latest paper:
10
+
11
+ ```bibtex
12
+ @inproceedings{armengol-estape-etal-2021-multilingual,
13
+ title = "Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? {A} Comprehensive Assessment for {C}atalan",
14
+ author = "Armengol-Estap{\'e}, Jordi and
15
+ Carrino, Casimiro Pio and
16
+ Rodriguez-Penagos, Carlos and
17
+ de Gibert Bonet, Ona and
18
+ Armentano-Oller, Carme and
19
+ Gonzalez-Agirre, Aitor and
20
+ Melero, Maite and
21
+ Villegas, Marta",
22
+ booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
23
+ month = aug,
24
+ year = "2021",
25
+ address = "Online",
26
+ publisher = "Association for Computational Linguistics",
27
+ url = "https://aclanthology.org/2021.findings-acl.437",
28
+ doi = "10.18653/v1/2021.findings-acl.437",
29
+ pages = "4933--4946",
30
+ }
31
+ ```
32
+
33
+
34
+ ## Digital Object Identifier (DOI) and access to dataset files
35
+
36
+ https://doi.org/10.5281/zenodo.4627198
37
+
38
+
39
+ ## Introduction
40
+
41
+ TeCla is a Catalan News corpus for thematic Text Classification tasks. It contains 153.265 articles classified under 30 different categories.
42
+
43
+ The source data is crawled from the ACN (Catalan News Agency) site: [http://www.acn.cat], and used under CC-BY-NC-ND 4.0 licence. The dataset is released under the same licence, and is intended exclusively for training Machine Learning models.
44
+
45
+ This dataset was developed by BSC TeMU as part of the AINA project, and intended as part of CLUB (Catalan Language Understanding Benchmark). It is part of the Catalan Language Understanding Benchmark (CLUB) as presented in:
46
+
47
+ Armengol-Estapé J., Carrino CP., Rodriguez-Penagos C., de Gibert Bonet O., Armentano-Oller C., Gonzalez-Agirre A., Melero M. and Villegas M.,Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? A Comprehensive Assessment for Catalan". Findings of ACL 2021 (ACL-IJCNLP 2021).
48
+
49
+
50
+ ### Supported Tasks and Leaderboards
51
+
52
+ Text classification, Language Model
53
+
54
+ ### Languages
55
+
56
+ CA- Catalan
57
+
58
+ ### Directory structure
59
+
60
+ * **.gitattributes**
61
+ * **README.md**
62
+ * **dev.json** - json-formatted file with the dev split of the dataset
63
+ * **tecla.py**
64
+ * **test.json** - json-formatted file with the test split of the dataset
65
+ * **train.json** - json-formatted file with the train split of the dataset
66
+
67
+ ## Dataset Structure
68
+
69
+ ### Data Instances
70
+
71
+ Three json files, one for each split.
72
+
73
+ ### Data Fields
74
+
75
+ We used a simple model with the article text and associated labels, without further metadata.
76
+
77
+ ### Example:
78
+
79
+ <pre>
80
+ {"version": "1.0",
81
+ "data":
82
+ [
83
+ {
84
+ 'sentence': 'L\\\\'editorial valenciana Media Vaca, Premi Nacional a la Millor Tasca Editorial Cultural del 2018. El jurat en destaca la cura "exquisida" del catàleg, la qualitat dels llibres i el "respecte" pels lectors. ACN Madrid.-L\\\\'editorial valenciana Media Vaca ha obtingut el Premi Nacional a la Millor Labor Editorial Cultural corresponent a l\\\\'any 2018 que atorga el Ministeri de Cultura i Esports. El guardó pretén distingir la tasca editorial d\\\\'una persona física o jurídica que hagi destacat per l\\\\'aportació a la vida cultural espanyola. El premi és de caràcter honorífic i no té dotació econòmica. En el cas de Media Vaca, fundada pel valencià Vicente Ferrer i la bilbaïna Begoña Lobo, el jurat n\\\\'ha destacat la cura "exquisida" del catàleg, la qualitat dels llibres i el "respecte" pels lectors i per la resta d\\\\'agents de la cadena del llibre. Media Vaca va publicar els primers llibres el desembre del 1998. El catàleg actual el componen 64 títols dividits en sis col·leccions, que barregen ficció i no ficció. Des del Ministeri de Cultura es destaca que la il·lustració té un pes "fonamental" als productes de l\\\\'editorial i que la majoria de projectes solen partir de propostes literàries i textos preexistents. L\\\\'editorial ha rebut quatre vegades el Bologna Ragazzi Award. És l\\\\'única editorial estatal que ha aconseguit el guardó que atorga la Fira del Llibre per a Nens de Bolonya, la més important del sector.',
85
+ 'label': 'Lletres'
86
+ },
87
+ .
88
+ .
89
+ .
90
+ ]
91
+ }
92
+
93
+
94
+ </pre>
95
+
96
+ ### Data Splits
97
+ * train.json: 122587 article-label pairs
98
+ * dev.json: 15339 article-label pairs
99
+ * test.json: 15339 article-label pairs
100
+
101
+ ### Labels
102
+
103
+ 'Societat', 'Política', 'Turisme', 'Salut', 'Economia', 'Successos', 'Partits', 'Educació', 'Policial', 'Medi ambient', 'Parlament', 'Empresa', 'Judicial', 'Unió Europea', 'Comerç', 'Cultura', 'Cinema', 'Govern', 'Lletres', 'Infraestructures', 'Música', 'Festa i cultura popular', 'Teatre', 'Mobilitat', 'Govern espanyol', 'Equipaments i patrimoni', 'Meteorologia', 'Treball', 'Trànsit', 'Món'
104
+
105
+
106
+ ### Labels in the dataset by frequency
107
+
108
+ train.json: 122587 articles
109
+
110
+ | Label | Num art |% art |
111
+ |:-----------------------|--------------:|------: |
112
+ | Societat | 24975 | 20.37% |
113
+ | Política | 18344 | 14.96% |
114
+ | Partits | 10056 | 8.2% |
115
+ | Successos | 7874 | 6.42% |
116
+ | Judicial | 5788 | 4.72% |
117
+ | Policial | 5557 | 4.53% |
118
+ | Salut | 5430 | 4.43% |
119
+ | Economia | 5032 | 4.1% |
120
+ | Parlament | 4176 | 3.41% |
121
+ | Medi_ambient | 3027 | 2.47% |
122
+ | Música | 2872 | 2.34% |
123
+ | Educació | 2757 | 2.25% |
124
+ | Empresa | 2698 | 2.2% |
125
+ | Cultura | 2495 | 2.04% |
126
+ | Unió_Europea | 2064 | 1.68% |
127
+ | Govern | 2039 | 1.66% |
128
+ | Infraestructures | 1740 | 1.42% |
129
+ | Treball | 1655 | 1.35% |
130
+ | Mobilitat | 1624 | 1.32% |
131
+ | Cinema | 1560 | 1.27% |
132
+ | Teatre | 1492 | 1.22% |
133
+ | Turisme | 1232 | 1.01% |
134
+ | Equipaments_i_patrimoni | 1229 | 1.0% |
135
+ | Lletres | 1180 | 0.96% |
136
+ | Meteorologia | 1080 | 0.88% |
137
+ | Comerç | 984 | 0.8% |
138
+ | Govern_espanyol | 983 | 0.8% |
139
+ | Món | 893 | 0.73% |
140
+ | Festa_i_cultura_popular | 888 | 0.72% |
141
+ | Trànsit | 863 | 0.7% |
142
+
143
+ dev.json and test.json: 153265 articles each split
144
+
145
+ | Label | Num art |% art |
146
+ |:----------------------- | --------------:| ------: |
147
+ | Societat | 3122 | 20.35% |
148
+ | Política | 2294 | 14.96% |
149
+ | Partits | 1257 | 8.19% |
150
+ | Successos | 985 | 6.42% |
151
+ | Judicial | 724 | 4.72% |
152
+ | Policial | 695 | 4.53% |
153
+ | Salut | 679 | 4.43% |
154
+ | Economia | 630 | 4.11% |
155
+ | Parlament | 523 | 3.41% |
156
+ | Medi_ambient | 379 | 2.47% |
157
+ | Música | 359 | 2.34% |
158
+ | Educació | 345 | 2.25% |
159
+ | Empresa | 338 | 2.2% |
160
+ | Cultura | 312 | 2.03% |
161
+ | Unió_Europea | 258 | 1.68% |
162
+ | Govern | 256 | 1.67% |
163
+ | Infraestructures | 218 | 1.42% |
164
+ | Treball | 208 | 1.36% |
165
+ | Mobilitat | 204 | 1.33% |
166
+ | Cinema | 195 | 1.27% |
167
+ | Teatre | 187 | 1.22% |
168
+ | Turisme | 154 | 1.0% |
169
+ | Equipaments_i_patrimoni | 154 | 1.0% |
170
+ | Lletres | 148 | 0.96% |
171
+ | Meteorologia | 135 | 0.88% |
172
+ | Govern_espanyol | 124 | 0.81% |
173
+ | Comerç | 123 | 0.8% |
174
+ | Festa_i_cultura_popular | 112 | 0.73% |
175
+ | Món | 112 | 0.73% |
176
+ | Trànsit | 109 | 0.71% |
177
+
178
+
179
+ ## Dataset Creation
180
+
181
+ ### Methodology
182
+
183
+ We crawled 219.586 articles from the Catalan News Agency (www.acn.cat) newswire archive, the latest from October 11, 2020.
184
+ We used the "subsection" category as a classification label, after excluding territorial labels (see territorial_labels.txt file) and labels with less than 2000 occurrences. With this criteria compiled a total of 153.265 articles for this text classification dataset.
185
+
186
+ ### Curation Rationale
187
+
188
+ We used the "subsection" category as a classification label, after excluding territorial labels (see territorial_labels.txt file) and labels with less than 2000 occurrences.
189
+
190
+ ### Source Data
191
+
192
+ #### Initial Data Collection and Normalization
193
+
194
+ The source data are crawled articles from ACN (Catalan News Agency) site: www.acn.cat
195
+
196
+ #### Who are the source language producers?
197
+
198
+ The Catalan News Agency (CNA, in Catalan: Agència Catalana de Notícies (ACN)) is a news agency owned by the Catalan government via the public corporation Intracatalònia, SA. It is one of the first digital news agencies created in Europe and has been operating since 1999 (source: [https://en.wikipedia.org/wiki/Catalan_News_Agency])
199
+
200
+ ### Annotations
201
+
202
+ #### Annotation process
203
+
204
+ We used the "subsection" category as a classification label, after excluding territorial labels (see territorial_labels.txt file) and labels with less than 2000 occurrences.
205
+
206
+ #### Who are the annotators?
207
+
208
+ Editorial staff classified the articles under the different thematic sections, and we extracted these from metadata.
209
+
210
+ ### Dataset Curators
211
+
212
+ Casimiro Pio Carrino, Carlos Rodríguez and Carme Armentano, from BSC-CNS
213
+
214
+ ### Personal and Sensitive Information
215
+
216
+ No personal or sensitive information included.
217
+
218
+ ## Considerations for Using the Data
219
+
220
+ ### Social Impact of Dataset
221
+
222
+ [More Information Needed]
223
+
224
+ ### Discussion of Biases
225
+
226
+ [More Information Needed]
227
+
228
+ ### Other Known Limitations
229
+
230
+ [More Information Needed]
231
+
232
+
233
+ ## Contact
234
+
235
+ Carlos Rodríguez-Penagos (carlos.rodriguez1@bsc.es) and Carme Armentano-Oller (carme.armentano@bsc.es)
236
+
237
+ ## License
238
+
239
+ <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Attribution-NonCommercial-NoDerivatives 4.0 International License" style="border-width:0" src="http://d2klr1ixr44jla.cloudfront.net/306/125/0.5-0.5/assets/images/55132bfeb13b7b027c000041.png" width="100"/></a><br />This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">Attribution-NonCommercial-NoDerivatives 4.0 International License</a>.
240
+
dev.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1222f41063baa63ce8139691ab3e7021c19b8ccab3a6cb60d40c35eb93df81a2
3
+ size 34946188
tecla.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Loading script for the TeCla dataset.
2
+ import json
3
+ import datasets
4
+
5
+ logger = datasets.logging.get_logger(__name__)
6
+
7
+ _CITATION = """
8
+ Carrino, Casimiro Pio, Rodriguez-Penagos, Carlos Gerardo, & Armentano-Oller, Carme. (2021).
9
+ TeCla: Text Classification Catalan dataset (Version 1.0) [Data set].
10
+ Zenodo. http://doi.org/10.5281/zenodo.4627198
11
+ """
12
+
13
+ _DESCRIPTION = """
14
+ TeCla: Text Classification Catalan dataset
15
+ Catalan News corpus for Text classification, crawled from ACN (Catalan News Agency) site: www.acn.cat
16
+ Corpus de notícies en català per a classificació textual, extret del web de l'Agència Catalana de Notícies - www.acn.cat
17
+ """
18
+
19
+ _HOMEPAGE = """https://zenodo.org/record/4761505"""
20
+
21
+ # TODO: upload datasets to github
22
+ _URL = "https://huggingface.co/datasets/bsc/tecla/resolve/main/"
23
+ _TRAINING_FILE = "train.json"
24
+ _DEV_FILE = "dev.json"
25
+ _TEST_FILE = "test.json"
26
+
27
+
28
+ class teclaConfig(datasets.BuilderConfig):
29
+ """ Builder config for the TeCla dataset """
30
+
31
+ def __init__(self, **kwargs):
32
+ """BuilderConfig for TeCla.
33
+ Args:
34
+ **kwargs: keyword arguments forwarded to super.
35
+ """
36
+ super(teclaConfig, self).__init__(**kwargs)
37
+
38
+
39
+ class tecla(datasets.GeneratorBasedBuilder):
40
+ """ TeCla Dataset """
41
+
42
+ BUILDER_CONFIGS = [
43
+ teclaConfig(
44
+ name="tecla",
45
+ version=datasets.Version("1.0.1"),
46
+ description="tecla dataset",
47
+ ),
48
+ ]
49
+
50
+ def _info(self):
51
+ return datasets.DatasetInfo(
52
+ description=_DESCRIPTION,
53
+ features=datasets.Features(
54
+ {
55
+ "text": datasets.Value("string"),
56
+ "label": datasets.features.ClassLabel
57
+ (names=
58
+ [
59
+ "Medi ambient",
60
+ "Societat",
61
+ "Policial",
62
+ "Judicial",
63
+ "Empresa",
64
+ "Partits",
65
+ "Pol\u00edtica",
66
+ "Successos",
67
+ "Salut",
68
+ "Infraestructures",
69
+ "Parlament",
70
+ "M\u00fasica",
71
+ "Govern",
72
+ "Uni\u00f3 Europea",
73
+ "Economia",
74
+ "Mobilitat",
75
+ "Treball",
76
+ "Cultura",
77
+ "Educaci\u00f3"
78
+ ]
79
+ ),
80
+ }
81
+ ),
82
+ homepage=_HOMEPAGE,
83
+ citation=_CITATION,
84
+ )
85
+
86
+ def _split_generators(self, dl_manager):
87
+ """Returns SplitGenerators."""
88
+ urls_to_download = {
89
+ "train": f"{_URL}{_TRAINING_FILE}",
90
+ "dev": f"{_URL}{_DEV_FILE}",
91
+ "test": f"{_URL}{_TEST_FILE}",
92
+ }
93
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
94
+
95
+ return [
96
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
97
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
98
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
99
+ ]
100
+
101
+ def _generate_examples(self, filepath):
102
+ """This function returns the examples in the raw (text) form."""
103
+ logger.info("generating examples from = %s", filepath)
104
+ with open(filepath, encoding="utf-8") as f:
105
+ acn_ca = json.load(f)
106
+ for id_, article in enumerate(acn_ca["data"]):
107
+ text = article["sentence"]
108
+ label = article["label"]
109
+ yield id_, {
110
+ "text": text,
111
+ "label": label,
112
+ }
test.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecd080814ed5e466f33f5a5d64eb85c94c13efe367897174f4546491cade6df8
3
+ size 34997197
train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13501fd5cbb51cdd3bcefaae305ef1e6f9e74209cc7f6255275535e6d374b67d
3
+ size 280571534