Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
json
Sub-tasks:
multi-class-classification
Languages:
Catalan
Size:
10K - 100K
License:
Upload 2 files
Browse files- README.md +122 -0
- ca-wiki-tc.py +150 -0
README.md
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
YAML tags:
|
3 |
+
language_creators:
|
4 |
+
- found
|
5 |
+
language:
|
6 |
+
- ca
|
7 |
+
license:
|
8 |
+
- cc-by-nc-nd-4.0
|
9 |
+
multilinguality:
|
10 |
+
- monolingual
|
11 |
+
pretty_name: ca-wiki-tc
|
12 |
+
size_categories:
|
13 |
+
- unknown
|
14 |
+
source_datasets: []
|
15 |
+
task_categories:
|
16 |
+
- text-classification
|
17 |
+
task_ids:
|
18 |
+
- multi-class-classification
|
19 |
+
---
|
20 |
+
|
21 |
+
# Dataset Card for CaWikiTC
|
22 |
+
|
23 |
+
## Dataset Description
|
24 |
+
|
25 |
+
- **Point of Contact:** [Irene Baucells de la Peña](irene.baucells@bsc.es)
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
### Dataset Summary
|
30 |
+
|
31 |
+
CaWikiTC (Catalan Wikipedia Text Classification) is a text classification dataset authomatically created by scraping Catalan Wikipedia article summaries and their associated thematic category. It contains 21002 texts (19952 and 1050 in the train and dev partitions, respectively) classified under 67 exclusive categories.
|
32 |
+
|
33 |
+
For the dataset creation, we selected all the Catalan Wikipedia article summaries from a previously fixed variety of subcategories, most of which are professional disciplines and social sciences-related fields. The texts that were originally associated with more than one category were discarded to avoid class overlappings.
|
34 |
+
|
35 |
+
This dataset was created as part of the experiments from [reference]. Its original purpose was to serve as a task transfer source to train an entailment model, which was then used to perform a different text classification task.
|
36 |
+
|
37 |
+
### Supported Tasks and Leaderboards
|
38 |
+
|
39 |
+
Text classification, Language Model
|
40 |
+
|
41 |
+
### Languages
|
42 |
+
|
43 |
+
The dataset is in Catalan (`ca-CA`).
|
44 |
+
|
45 |
+
## Dataset Structure
|
46 |
+
|
47 |
+
### Data Instances
|
48 |
+
|
49 |
+
Two json files (train and development splits).
|
50 |
+
|
51 |
+
### Data Fields
|
52 |
+
|
53 |
+
Each example contains the following 3 fields:
|
54 |
+
* text: Catalan Wikipedia article summary (string)
|
55 |
+
* label: topic
|
56 |
+
|
57 |
+
#### Example:
|
58 |
+
|
59 |
+
<pre>
|
60 |
+
[
|
61 |
+
{
|
62 |
+
'text': "Novum Organum és el títol de l'obra més important de Francis Bacon, publicada el 1620. Rep el seu nom perquè pretén ser una superació del tractat sobre lògica d'Aristòtil, anomenat Organon. Es basa a trobar la causa de tot fenomen per inducció, observant quan passa i quan no i extrapolant aleshores les condicions que fan que es doni. Aquest raonament va influir decisivament en la formació del mètode científic, especialment en la fase d'elaboració d'hipòtesis. També indica que el prejudici és l'enemic de la ciència, perquè impideix generar noves idees. Els prejudicis més comuns s'expliquen amb la metàfora de l'ídol o allò que és falsament adorat. Existeixen ídols de la tribu (comuns a tots els éssers humans per la seva naturalesa), de la caverna (procedents de l'educació), del fòrum (causats per un ús incorrecte del llenguatge) i del teatre (basats en idees anteriors errònies, notablement en filosofia).",
|
63 |
+
'label': 'Filosofia',
|
64 |
+
},
|
65 |
+
...
|
66 |
+
]
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
</pre>
|
71 |
+
|
72 |
+
#### Labels
|
73 |
+
|
74 |
+
* label: 'Administració', 'Aeronàutica', 'Agricultura', 'Antropologia', 'Arqueologia', 'Arquitectura', 'Art', 'Astronomia', 'Astronàutica', 'Biblioteconomia', 'Biotecnologia', 'Catàstrofes', 'Circ', 'Ciència militar', 'Ciència-ficció', 'Ciències ambientals', 'Ciències de la salut', 'Ciències polítiques', 'Conflictes', 'Cronometria', 'Cultura popular', 'Dansa', 'Dret', 'Ecologia', 'Enginyeria', 'Epidèmies', 'Esoterisme', 'Estris', 'Festivals', 'Filologia', 'Filosofia', 'Fiscalitat', 'Física', 'Geografia', 'Geologia', 'Gestió', 'Heràldica', 'Història', 'Humor', 'Indumentària', 'Informàtica', 'Jaciments paleontològics', 'Jocs', 'Lingüística', 'Llengües', 'Llocs ficticis', 'Matemàtiques', 'Metodologia', 'Mitologia', 'Multimèdia', 'Museologia', 'Nàutica', 'Objectes astronòmics', 'Pedagogia', 'Periodisme', 'Protestes', 'Pseudociència', 'Psicologia', 'Química', 'Robòtica', 'Ràdio', 'Seguretat laboral', 'Sociologia', 'Telecomunicacions', 'Televisió', 'Teologia', 'Ètica'
|
75 |
+
|
76 |
+
### Data Splits
|
77 |
+
|
78 |
+
Train and development splits were created in a stratified fashion, following a 95% and 5% proportion, respectively. The sizes of each split are the following:
|
79 |
+
* train.json: 19952 examples
|
80 |
+
* dev.json: 1050 examples
|
81 |
+
|
82 |
+
### Annotations
|
83 |
+
|
84 |
+
#### Annotation process
|
85 |
+
|
86 |
+
The crawled data contained the categories' annotations, which were then used to create this dataset with the mentioned criteria.
|
87 |
+
|
88 |
+
### Personal and Sensitive Information
|
89 |
+
|
90 |
+
No personal or sensitive information included.
|
91 |
+
|
92 |
+
## Considerations for Using the Data
|
93 |
+
|
94 |
+
### Social Impact of Dataset
|
95 |
+
|
96 |
+
We hope this dataset contributes to the development of language models in Catalan, a low-resource language.
|
97 |
+
|
98 |
+
### Discussion of Biases
|
99 |
+
|
100 |
+
[N/A]
|
101 |
+
|
102 |
+
### Other Known Limitations
|
103 |
+
|
104 |
+
[N/A]
|
105 |
+
|
106 |
+
## Additional Information
|
107 |
+
|
108 |
+
### Dataset Curators
|
109 |
+
|
110 |
+
Irene Baucells (irene.baucells@bsc.es)
|
111 |
+
|
112 |
+
This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
|
113 |
+
|
114 |
+
|
115 |
+
### Licensing Information
|
116 |
+
|
117 |
+
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>.
|
118 |
+
|
119 |
+
### Citation Information
|
120 |
+
|
121 |
+
|
122 |
+
|
ca-wiki-tc.py
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
9 |
+
"""
|
10 |
+
|
11 |
+
_DESCRIPTION = """
|
12 |
+
Dataset automatically created from Catalan Wikipedia articles and the associated categories.
|
13 |
+
"""
|
14 |
+
|
15 |
+
|
16 |
+
_URL = "./"
|
17 |
+
_TRAINING_FILE = "train.json"
|
18 |
+
_DEV_FILE = "dev.json"
|
19 |
+
|
20 |
+
|
21 |
+
class ca_wiki_tcConfig(datasets.BuilderConfig):
|
22 |
+
""" Builder config for the CaWikiTC dataset """
|
23 |
+
|
24 |
+
def __init__(self, **kwargs):
|
25 |
+
"""BuilderConfig for CaWikiTC.
|
26 |
+
Args:
|
27 |
+
**kwargs: keyword arguments forwarded to super.
|
28 |
+
"""
|
29 |
+
super(ca_wiki_tcConfig, self).__init__(**kwargs)
|
30 |
+
|
31 |
+
|
32 |
+
class ca_wiki_tc(datasets.GeneratorBasedBuilder):
|
33 |
+
""" CaWikiTC Dataset """
|
34 |
+
|
35 |
+
BUILDER_CONFIGS = [
|
36 |
+
ca_wiki_tcConfig(
|
37 |
+
name="ca-wiki-tc",
|
38 |
+
version=datasets.Version("1.0.1"),
|
39 |
+
description="CaWikiTC dataset",
|
40 |
+
),
|
41 |
+
]
|
42 |
+
|
43 |
+
def _info(self):
|
44 |
+
return datasets.DatasetInfo(
|
45 |
+
description=_DESCRIPTION,
|
46 |
+
features=datasets.Features(
|
47 |
+
{
|
48 |
+
"text": datasets.Value("string"),
|
49 |
+
"label": datasets.features.ClassLabel
|
50 |
+
(names=
|
51 |
+
[
|
52 |
+
"Administració",
|
53 |
+
"Aeronàutica",
|
54 |
+
"Agricultura",
|
55 |
+
"Antropologia",
|
56 |
+
"Arqueologia",
|
57 |
+
"Arquitectura",
|
58 |
+
"Art",
|
59 |
+
"Astronomia",
|
60 |
+
"Astronàutica",
|
61 |
+
"Biblioteconomia",
|
62 |
+
"Biotecnologia",
|
63 |
+
"Catàstrofes",
|
64 |
+
"Circ",
|
65 |
+
"Ciència militar",
|
66 |
+
"Ciència-ficció",
|
67 |
+
"Ciències ambientals",
|
68 |
+
"Ciències de la salut",
|
69 |
+
"Ciències polítiques",
|
70 |
+
"Conflictes",
|
71 |
+
"Cronometria",
|
72 |
+
"Cultura popular",
|
73 |
+
"Dansa",
|
74 |
+
"Dret",
|
75 |
+
"Ecologia",
|
76 |
+
"Enginyeria",
|
77 |
+
"Epidèmies",
|
78 |
+
"Esoterisme",
|
79 |
+
"Estris",
|
80 |
+
"Festivals",
|
81 |
+
"Filologia",
|
82 |
+
"Filosofia",
|
83 |
+
"Fiscalitat",
|
84 |
+
"Física",
|
85 |
+
"Geografia",
|
86 |
+
"Geologia",
|
87 |
+
"Gestió",
|
88 |
+
"Heràldica",
|
89 |
+
"Història",
|
90 |
+
"Humor",
|
91 |
+
"Indumentària",
|
92 |
+
"Informàtica",
|
93 |
+
"Jaciments paleontològics",
|
94 |
+
"Jocs",
|
95 |
+
"Lingüística",
|
96 |
+
"Llengües",
|
97 |
+
"Llocs ficticis",
|
98 |
+
"Matemàtiques",
|
99 |
+
"Metodologia",
|
100 |
+
"Mitologia",
|
101 |
+
"Multimèdia",
|
102 |
+
"Museologia",
|
103 |
+
"Nàutica",
|
104 |
+
"Objectes astronòmics",
|
105 |
+
"Pedagogia",
|
106 |
+
"Periodisme",
|
107 |
+
"Protestes",
|
108 |
+
"Pseudociència",
|
109 |
+
"Psicologia",
|
110 |
+
"Química",
|
111 |
+
"Robòtica",
|
112 |
+
"Ràdio",
|
113 |
+
"Seguretat laboral",
|
114 |
+
"Sociologia",
|
115 |
+
"Telecomunicacions",
|
116 |
+
"Televisió",
|
117 |
+
"Teologia",
|
118 |
+
"Ètica",
|
119 |
+
]
|
120 |
+
),
|
121 |
+
}
|
122 |
+
),
|
123 |
+
citation=_CITATION,
|
124 |
+
)
|
125 |
+
|
126 |
+
def _split_generators(self, dl_manager):
|
127 |
+
"""Returns SplitGenerators."""
|
128 |
+
urls_to_download = {
|
129 |
+
"train": f"{_URL}{_TRAINING_FILE}",
|
130 |
+
"dev": f"{_URL}{_DEV_FILE}",
|
131 |
+
}
|
132 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
133 |
+
|
134 |
+
return [
|
135 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
136 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]})
|
137 |
+
]
|
138 |
+
|
139 |
+
def _generate_examples(self, filepath):
|
140 |
+
"""This function returns the examples in the raw (text) form."""
|
141 |
+
logger.info("generating examples from = %s", filepath)
|
142 |
+
with open(filepath, encoding="utf-8") as f:
|
143 |
+
data = json.load(f)
|
144 |
+
for id_, article in enumerate(data):
|
145 |
+
text = article["text"]
|
146 |
+
label = article["label"]
|
147 |
+
yield id_, {
|
148 |
+
"text": text,
|
149 |
+
"label": label,
|
150 |
+
}
|