create first draft of ceil
Browse files- .gitattributes +2 -0
- README.md +168 -1
- ceil.py +217 -0
- dev.conll +3 -0
- train.conll +3 -0
.gitattributes
CHANGED
@@ -53,3 +53,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
56 |
+
dev.conll filter=lfs diff=lfs merge=lfs -text
|
57 |
+
train.conll filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,170 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
language:
|
7 |
+
- ca
|
8 |
+
license:
|
9 |
+
- cc-by-4.0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
pretty_name: ancora-ca-ner
|
13 |
+
size_categories:
|
14 |
+
- unknown
|
15 |
+
source_datasets: []
|
16 |
+
task_categories: []
|
17 |
+
task_ids: []
|
18 |
---
|
19 |
+
|
20 |
+
# Dataset Card for AnCora-Ca-NER
|
21 |
+
|
22 |
+
## Dataset Description
|
23 |
+
|
24 |
+
- **Website:** https://zenodo.org/record/5036651
|
25 |
+
- **Paper:** [Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? A Comprehensive Assessment for Catalan](https://arxiv.org/abs/2107.07903)
|
26 |
+
- **Paper:** [AnCora: Multilevel Annotated Corpora for Catalan and Spanish](http://www.lrec-conf.org/proceedings/lrec2008/pdf/35_paper.pdf)
|
27 |
+
- **Point of Contact:** [Carlos Rodríguez-Penagos](carlos.rodriguez1@bsc.es) and [Carme Armentano-Oller](carme.armentano@bsc.es)
|
28 |
+
|
29 |
+
### Dataset Summary
|
30 |
+
|
31 |
+
This is a dataset for Named Entity Recognition (NER) in Catalan. It adapts <a href="http://clic.ub.edu/corpus/">AnCora corpus</a> for Machine Learning and Language Model evaluation purposes.
|
32 |
+
|
33 |
+
[AnCora corpus](http://clic.ub.edu/corpus/) is used under [CC-by](https://creativecommons.org/licenses/by/4.0/) licence.
|
34 |
+
|
35 |
+
This dataset was developed by [BSC TeMU](https://temu.bsc.es/) as part of the [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina/), to enrich the [Catalan Language Understanding Benchmark (CLUB)](https://club.aina.bsc.es/).
|
36 |
+
|
37 |
+
|
38 |
+
### Supported Tasks and Leaderboards
|
39 |
+
|
40 |
+
Named Entities Recognition, Language Model
|
41 |
+
|
42 |
+
### Languages
|
43 |
+
|
44 |
+
The dataset is in Catalan (`ca-CA`).
|
45 |
+
|
46 |
+
## Dataset Structure
|
47 |
+
|
48 |
+
### Data Instances
|
49 |
+
|
50 |
+
Three two-column files, one for each split.
|
51 |
+
|
52 |
+
<pre>
|
53 |
+
Fundació B-ORG
|
54 |
+
Privada I-ORG
|
55 |
+
Fira I-ORG
|
56 |
+
de I-ORG
|
57 |
+
Manresa I-ORG
|
58 |
+
ha O
|
59 |
+
fet O
|
60 |
+
un O
|
61 |
+
balanç O
|
62 |
+
de O
|
63 |
+
l' O
|
64 |
+
activitat O
|
65 |
+
del O
|
66 |
+
Palau B-LOC
|
67 |
+
Firal I-LOC
|
68 |
+
</pre>
|
69 |
+
|
70 |
+
### Data Fields
|
71 |
+
|
72 |
+
Every file has two columns, with the word form or punctuation symbol in the first one and the corresponding IOB tag in the second one.
|
73 |
+
|
74 |
+
### Data Splits
|
75 |
+
|
76 |
+
We took the original train, dev and test splits from the [UD version of the corpus](https://huggingface.co/datasets/universal_dependencies)
|
77 |
+
|
78 |
+
- train: 10,630 examples
|
79 |
+
- validation: 1,429 examples
|
80 |
+
- test: 1,528 examples
|
81 |
+
|
82 |
+
|
83 |
+
## Dataset Creation
|
84 |
+
|
85 |
+
### Curation Rationale
|
86 |
+
|
87 |
+
We created this corpus to contribute to the development of language models in Catalan, a low-resource language.
|
88 |
+
|
89 |
+
### Source Data
|
90 |
+
|
91 |
+
#### Initial Data Collection and Normalization
|
92 |
+
|
93 |
+
[AnCora](http://clic.ub.edu/corpus/) consists of a Catalan corpus (AnCora-CA) and a Spanish corpus (AnCora-ES), each of them of 500,000 tokens (some multi-word). The corpora are annotated for linguistic phenomena at different levels.
|
94 |
+
AnCora corpus is mainly based on newswire texts. For more information, refer to Taulé, M., M.A. Martí, M. Recasens (2009): <a href="http://www.lrec-conf.org/proceedings/lrec2008/pdf/35_paper.pdf">"AnCora: Multilevel Annotated Corpora for Catalan and Spanish”</a>, Proceedings of 6th International Conference on language Resources and Evaluation.
|
95 |
+
|
96 |
+
#### Who are the source language producers?
|
97 |
+
|
98 |
+
Catalan [AnCora corpus](http://clic.ub.edu/corpus/) is compiled from articles from the following news outlets: <a href="https://www.efe.com">EFE</a>, <a href="https://www.acn.cat">ACN</a>, <a href="https://www.elperiodico.cat/ca/">El Periodico</a>.
|
99 |
+
|
100 |
+
### Annotations
|
101 |
+
|
102 |
+
#### Annotation process
|
103 |
+
|
104 |
+
We adapted the NER labels from [AnCora corpus](http://clic.ub.edu/corpus/) to a token-per-line, multi-column format.
|
105 |
+
|
106 |
+
#### Who are the annotators?
|
107 |
+
|
108 |
+
Original annotators from [AnCora corpus](http://clic.ub.edu/corpus/).
|
109 |
+
|
110 |
+
### Personal and Sensitive Information
|
111 |
+
|
112 |
+
No personal or sensitive information included.
|
113 |
+
|
114 |
+
## Considerations for Using the Data
|
115 |
+
|
116 |
+
### Social Impact of Dataset
|
117 |
+
|
118 |
+
We hope this corpus contributes to the development of language models in Catalan, a low-resource language.
|
119 |
+
|
120 |
+
### Discussion of Biases
|
121 |
+
|
122 |
+
[N/A]
|
123 |
+
|
124 |
+
### Other Known Limitations
|
125 |
+
|
126 |
+
[N/A]
|
127 |
+
|
128 |
+
## Additional Information
|
129 |
+
### Dataset Curators
|
130 |
+
|
131 |
+
Text Mining Unit (TeMU) at the Barcelona Supercomputing Center (bsc-temu@bsc.es)
|
132 |
+
|
133 |
+
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/en/inici/index.html) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina/).
|
134 |
+
|
135 |
+
### Licensing information
|
136 |
+
|
137 |
+
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Attribution 4.0 International License</a>.
|
138 |
+
|
139 |
+
### Citation Information
|
140 |
+
|
141 |
+
```
|
142 |
+
@inproceedings{armengol-estape-etal-2021-multilingual,
|
143 |
+
title = "Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? {A} Comprehensive Assessment for {C}atalan",
|
144 |
+
author = "Armengol-Estap{\'e}, Jordi and
|
145 |
+
Carrino, Casimiro Pio and
|
146 |
+
Rodriguez-Penagos, Carlos and
|
147 |
+
de Gibert Bonet, Ona and
|
148 |
+
Armentano-Oller, Carme and
|
149 |
+
Gonzalez-Agirre, Aitor and
|
150 |
+
Melero, Maite and
|
151 |
+
Villegas, Marta",
|
152 |
+
booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
|
153 |
+
month = aug,
|
154 |
+
year = "2021",
|
155 |
+
address = "Online",
|
156 |
+
publisher = "Association for Computational Linguistics",
|
157 |
+
url = "https://aclanthology.org/2021.findings-acl.437",
|
158 |
+
doi = "10.18653/v1/2021.findings-acl.437",
|
159 |
+
pages = "4933--4946",
|
160 |
+
}
|
161 |
+
|
162 |
+
```
|
163 |
+
|
164 |
+
|
165 |
+
[DOI](https://doi.org/10.5281/zenodo.4529299)
|
166 |
+
|
167 |
+
|
168 |
+
### Contributions
|
169 |
+
|
170 |
+
[N/A]
|
ceil.py
ADDED
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Loading script for the Ancora NER dataset.
|
2 |
+
import datasets
|
3 |
+
|
4 |
+
logger = datasets.logging.get_logger(__name__)
|
5 |
+
|
6 |
+
_CITATION = """ """
|
7 |
+
|
8 |
+
_DESCRIPTION = """CEIL (Catalan Entity Identification and Linking).
|
9 |
+
This is a dataset for complex Named Eentity Reacognition (NER) created by the AINA project in the BSC for
|
10 |
+
Machine Learning and Language Model evaluation purposes.
|
11 |
+
|
12 |
+
CEIL corpus is used under [CC-by] (https://creativecommons.org/licenses/by/4.0/) licence.
|
13 |
+
This dataset was developed by BSC as part of the AINA project, and to enrich the Catalan Language Understanding Benchmark (CLUB).
|
14 |
+
"""
|
15 |
+
|
16 |
+
_HOMEPAGE = """https://aina.bsc.es"""
|
17 |
+
|
18 |
+
_URL = "https://huggingface.co/datasets/projecte-aina/ceil/resolve/main/"
|
19 |
+
_TRAINING_FILE = "train.conll"
|
20 |
+
_DEV_FILE = "dev.conll"
|
21 |
+
#_TEST_FILE = "test.conll"
|
22 |
+
|
23 |
+
|
24 |
+
class CEILConfig(datasets.BuilderConfig):
|
25 |
+
""" Builder config for the CEIL dataset """
|
26 |
+
|
27 |
+
def __init__(self, **kwargs):
|
28 |
+
"""BuilderConfig for CEIL.
|
29 |
+
Args:
|
30 |
+
**kwargs: keyword arguments forwarded to super.
|
31 |
+
"""
|
32 |
+
super(CEILConfig, self).__init__(**kwargs)
|
33 |
+
|
34 |
+
|
35 |
+
class CEIL(datasets.GeneratorBasedBuilder):
|
36 |
+
""" CEIL dataset."""
|
37 |
+
|
38 |
+
BUILDER_CONFIGS = [
|
39 |
+
CEILConfig(
|
40 |
+
name="CEIL",
|
41 |
+
version=datasets.Version("2.0.0"),
|
42 |
+
description="CEIL dataset"
|
43 |
+
),
|
44 |
+
]
|
45 |
+
|
46 |
+
def _info(self):
|
47 |
+
return datasets.DatasetInfo(
|
48 |
+
description=_DESCRIPTION,
|
49 |
+
features=datasets.Features(
|
50 |
+
{
|
51 |
+
"id": datasets.Value("string"),
|
52 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
53 |
+
"ner_tags": datasets.Sequence(
|
54 |
+
datasets.features.ClassLabel(
|
55 |
+
names=[
|
56 |
+
'I-product-vehicle',
|
57 |
+
'I-organization-sportsteam',
|
58 |
+
'B-location-road/railway/highway/transit',
|
59 |
+
'I-CW-other',
|
60 |
+
'B-event-other',
|
61 |
+
'I-CW-painting',
|
62 |
+
'I-person-group',
|
63 |
+
'B-CW-music',
|
64 |
+
'I-location-other',
|
65 |
+
'B-organization-religious',
|
66 |
+
'I-product-E-device',
|
67 |
+
'B-product-software',
|
68 |
+
'B-event-attack/terrorism/militaryconflict',
|
69 |
+
'B-Person',
|
70 |
+
'B-organization-politicalparty',
|
71 |
+
'B-person-scholar/scientist',
|
72 |
+
'I-person-artist/author',
|
73 |
+
'B-CW-other',
|
74 |
+
'I-person-influencer',
|
75 |
+
'B-event-protest',
|
76 |
+
'I-building-other',
|
77 |
+
'I-organization-other',
|
78 |
+
'B-organization-sportsteam',
|
79 |
+
'B-organization-media',
|
80 |
+
'I-event-disaster',
|
81 |
+
'I-organization-privatecompany',
|
82 |
+
'I-event-other',
|
83 |
+
'B-location-other',
|
84 |
+
'B-product-clothing',
|
85 |
+
'B-organization-education',
|
86 |
+
'B-building-sportsfacility',
|
87 |
+
'I-building-shops',
|
88 |
+
'I-location-park',
|
89 |
+
'B-organization-government',
|
90 |
+
'I-person-politician',
|
91 |
+
'B-building-airport',
|
92 |
+
'B-CW-writtenart',
|
93 |
+
'I-Person',
|
94 |
+
'B-location-park',
|
95 |
+
'B-location-island',
|
96 |
+
'I-building-hotel',
|
97 |
+
'B-Other',
|
98 |
+
'B-organization-other',
|
99 |
+
'B-person-group',
|
100 |
+
'I-Building',
|
101 |
+
'B-event-disaster',
|
102 |
+
'I-organization-onlinebusiness',
|
103 |
+
'B-Building',
|
104 |
+
'B-product-consumer_good',
|
105 |
+
'I-CW-broadcastprogram',
|
106 |
+
'I-person-other',
|
107 |
+
'B-building-hotel',
|
108 |
+
'B-product-vehicle',
|
109 |
+
'I-organization-politicalparty',
|
110 |
+
'B-event-political',
|
111 |
+
'B-location-mountain',
|
112 |
+
'I-organization-religious',
|
113 |
+
'B-GPE',
|
114 |
+
'I-location-mountain',
|
115 |
+
'I-CW-film',
|
116 |
+
'I-CW-music',
|
117 |
+
'B-location-bodiesofwater',
|
118 |
+
'I-location-road/railway/highway/transit',
|
119 |
+
'I-event-sportsevent',
|
120 |
+
'B-organization-onlinebusiness',
|
121 |
+
'I-organization-government',
|
122 |
+
'I-person-actor/director',
|
123 |
+
'B-person-athlete',
|
124 |
+
'I-organization-education',
|
125 |
+
'I-event-attack/terrorism/militaryconflict',
|
126 |
+
'I-product-consumer_good',
|
127 |
+
'I-building-hospital',
|
128 |
+
'B-building-shops',
|
129 |
+
'I-event-political',
|
130 |
+
'I-building-religious',
|
131 |
+
'B-CW-painting',
|
132 |
+
'I-building-sportsfacility',
|
133 |
+
'I-event-protest',
|
134 |
+
'B-building-restaurant',
|
135 |
+
'B-person-politician',
|
136 |
+
'O',
|
137 |
+
'B-product-other',
|
138 |
+
'I-CW-writtenart',
|
139 |
+
'I-product-other',
|
140 |
+
'I-product-food',
|
141 |
+
'B-event-sportsevent',
|
142 |
+
'B-CW-film',
|
143 |
+
'I-product-clothing',
|
144 |
+
'B-CW-broadcastprogram',
|
145 |
+
'I-product-software',
|
146 |
+
'I-person-athlete',
|
147 |
+
'B-product-E-device',
|
148 |
+
'B-person-actor/director',
|
149 |
+
'B-building-religious',
|
150 |
+
'I-GPE',
|
151 |
+
'B-person-artist/author',
|
152 |
+
'B-organization-privatecompany',
|
153 |
+
'I-building-restaurant',
|
154 |
+
'B-building-hospital',
|
155 |
+
'I-Other',
|
156 |
+
'I-person-scholar/scientist',
|
157 |
+
'B-person-influencer',
|
158 |
+
'B-person-other',
|
159 |
+
'I-location-bodiesofwater',
|
160 |
+
'I-building-airport',
|
161 |
+
'I-organization-media',
|
162 |
+
'B-product-food',
|
163 |
+
'B-building-other',
|
164 |
+
'B-building-governmentfacility',
|
165 |
+
'I-building-governmentfacility',
|
166 |
+
'I-location-island'
|
167 |
+
]
|
168 |
+
)
|
169 |
+
),
|
170 |
+
}
|
171 |
+
),
|
172 |
+
supervised_keys=None,
|
173 |
+
homepage=_HOMEPAGE,
|
174 |
+
citation=_CITATION,
|
175 |
+
)
|
176 |
+
|
177 |
+
def _split_generators(self, dl_manager):
|
178 |
+
"""Returns SplitGenerators."""
|
179 |
+
urls_to_download = {
|
180 |
+
"train": f"{_URL}{_TRAINING_FILE}",
|
181 |
+
"dev": f"{_URL}{_DEV_FILE}",
|
182 |
+
}
|
183 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
184 |
+
|
185 |
+
return [
|
186 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
187 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
188 |
+
]
|
189 |
+
|
190 |
+
def _generate_examples(self, filepath):
|
191 |
+
logger.info("⏳ Generating examples from = %s", filepath)
|
192 |
+
with open(filepath, encoding="utf-8") as f:
|
193 |
+
guid = 0
|
194 |
+
tokens = []
|
195 |
+
ner_tags = []
|
196 |
+
for line in f:
|
197 |
+
if line.startswith("-DOCSTART-") or line == "" or line == "\n":
|
198 |
+
if tokens:
|
199 |
+
yield guid, {
|
200 |
+
"id": str(guid),
|
201 |
+
"tokens": tokens,
|
202 |
+
"ner_tags": ner_tags,
|
203 |
+
}
|
204 |
+
guid += 1
|
205 |
+
tokens = []
|
206 |
+
ner_tags = []
|
207 |
+
else:
|
208 |
+
# CEIL tokens are space separated
|
209 |
+
splits = line.split('\t')
|
210 |
+
tokens.append(splits[0])
|
211 |
+
ner_tags.append(splits[1].rstrip())
|
212 |
+
# last example
|
213 |
+
yield guid, {
|
214 |
+
"id": str(guid),
|
215 |
+
"tokens": tokens,
|
216 |
+
"ner_tags": ner_tags,
|
217 |
+
}
|
dev.conll
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:50d9e9d6642ef8917305fa84ba5a797d722c18476068441a1ab6784133a9ea19
|
3 |
+
size 11185791
|
train.conll
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ccc9ee58c4512c22e0e4a41f00176ce2209d2a55cd0c83614899959d2bdd289
|
3 |
+
size 44393617
|