Datasets:
Tasks:
Token Classification
Sub-tasks:
part-of-speech
Languages:
Portuguese
Size:
10K<n<100K
License:
Commit
•
c20d8a1
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +186 -0
- dataset_infos.json +1 -0
- dummy/3.0.0/dummy_data.zip +3 -0
- mac_morpho.py +170 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz 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
|
README.md
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- pt
|
8 |
+
licenses:
|
9 |
+
- cc-by-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- structure-prediction
|
18 |
+
task_ids:
|
19 |
+
- structure-prediction-other-part-of-speech-tagging
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for Mac-Morpho
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
- [Dataset Description](#dataset-description)
|
26 |
+
- [Dataset Summary](#dataset-summary)
|
27 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
28 |
+
- [Languages](#languages)
|
29 |
+
- [Dataset Structure](#dataset-structure)
|
30 |
+
- [Data Instances](#data-instances)
|
31 |
+
- [Data Fields](#data-fields)
|
32 |
+
- [Data Splits](#data-splits)
|
33 |
+
- [Dataset Creation](#dataset-creation)
|
34 |
+
- [Curation Rationale](#curation-rationale)
|
35 |
+
- [Source Data](#source-data)
|
36 |
+
- [Annotations](#annotations)
|
37 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
38 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
39 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
40 |
+
- [Discussion of Biases](#discussion-of-biases)
|
41 |
+
- [Other Known Limitations](#other-known-limitations)
|
42 |
+
- [Additional Information](#additional-information)
|
43 |
+
- [Dataset Curators](#dataset-curators)
|
44 |
+
- [Licensing Information](#licensing-information)
|
45 |
+
- [Citation Information](#citation-information)
|
46 |
+
|
47 |
+
## Dataset Description
|
48 |
+
|
49 |
+
- **Homepage:** [Mac-Morpho homepage](http://nilc.icmc.usp.br/macmorpho/)
|
50 |
+
- **Repository:** [Mac-Morpho repository](http://nilc.icmc.usp.br/macmorpho/)
|
51 |
+
- **Paper:** [Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese](https://journal-bcs.springeropen.com/articles/10.1186/s13173-014-0020-x)
|
52 |
+
- **Point of Contact:** [Erick R Fonseca](mailto:erickrfonseca@gmail.com)
|
53 |
+
|
54 |
+
### Dataset Summary
|
55 |
+
|
56 |
+
Mac-Morpho is a corpus of Brazilian Portuguese texts annotated with part-of-speech tags.
|
57 |
+
Its first version was released in 2003 [1], and since then, two revisions have been made in order
|
58 |
+
to improve the quality of the resource [2, 3].
|
59 |
+
The corpus is available for download split into train, development and test sections.
|
60 |
+
These are 76%, 4% and 20% of the corpus total, respectively (the reason for the unusual numbers
|
61 |
+
is that the corpus was first split into 80%/20% train/test, and then 5% of the train section was
|
62 |
+
set aside for development). This split was used in [3], and new POS tagging research with Mac-Morpho
|
63 |
+
is encouraged to follow it in order to make consistent comparisons possible.
|
64 |
+
|
65 |
+
|
66 |
+
[1] Aluísio, S., Pelizzoni, J., Marchi, A.R., de Oliveira, L., Manenti, R., Marquiafável, V. 2003.
|
67 |
+
An account of the challenge of tagging a reference corpus for brazilian portuguese.
|
68 |
+
In: Proceedings of the 6th International Conference on Computational Processing of the Portuguese Language. PROPOR 2003
|
69 |
+
|
70 |
+
[2] Fonseca, E.R., Rosa, J.L.G. 2013. Mac-morpho revisited: Towards robust part-of-speech.
|
71 |
+
In: Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology – STIL
|
72 |
+
|
73 |
+
[3] Fonseca, E.R., Aluísio, Sandra Maria, Rosa, J.L.G. 2015.
|
74 |
+
Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese.
|
75 |
+
Journal of the Brazilian Computer Society.
|
76 |
+
|
77 |
+
### Supported Tasks and Leaderboards
|
78 |
+
|
79 |
+
[More Information Needed]
|
80 |
+
|
81 |
+
### Languages
|
82 |
+
|
83 |
+
Portuguese
|
84 |
+
|
85 |
+
## Dataset Structure
|
86 |
+
|
87 |
+
### Data Instances
|
88 |
+
|
89 |
+
An example from the Mac-Morpho dataset looks as follows:
|
90 |
+
|
91 |
+
```
|
92 |
+
{
|
93 |
+
"id": "0",
|
94 |
+
"pos_tags": [14, 19, 14, 15, 22, 7, 14, 9, 14, 9, 3, 15, 3, 3, 24],
|
95 |
+
"tokens": ["Jersei", "atinge", "média", "de", "Cr$", "1,4", "milhão", "na", "venda", "da", "Pinhal", "em", "São", "Paulo", "."]
|
96 |
+
}
|
97 |
+
```
|
98 |
+
|
99 |
+
### Data Fields
|
100 |
+
|
101 |
+
- `id`: id of the sample
|
102 |
+
- `tokens`: the tokens of the example text
|
103 |
+
- `pos`: the PoS tags of each token
|
104 |
+
|
105 |
+
The PoS tags correspond to this list:
|
106 |
+
```
|
107 |
+
"PREP+PROADJ", "IN", "PREP+PRO-KS", "NPROP", "PREP+PROSUB", "KC", "PROPESS", "NUM", "PROADJ", "PREP+ART", "KS",
|
108 |
+
"PRO-KS", "ADJ", "ADV-KS", "N", "PREP", "PROSUB", "PREP+PROPESS", "PDEN", "V", "PREP+ADV", "PCP", "CUR", "ADV", "PU", "ART"
|
109 |
+
```
|
110 |
+
|
111 |
+
### Data Splits
|
112 |
+
|
113 |
+
The data is split into train, validation and test set. The split sizes are as follow:
|
114 |
+
|
115 |
+
| Train | Val | Test |
|
116 |
+
| ------ | ----- | ----- |
|
117 |
+
| 37948 | 1997 | 9987 |
|
118 |
+
|
119 |
+
## Dataset Creation
|
120 |
+
|
121 |
+
### Curation Rationale
|
122 |
+
|
123 |
+
[More Information Needed]
|
124 |
+
|
125 |
+
### Source Data
|
126 |
+
|
127 |
+
#### Initial Data Collection and Normalization
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
#### Who are the source language producers?
|
132 |
+
|
133 |
+
[More Information Needed]
|
134 |
+
|
135 |
+
### Annotations
|
136 |
+
|
137 |
+
#### Annotation process
|
138 |
+
|
139 |
+
[More Information Needed]
|
140 |
+
|
141 |
+
#### Who are the annotators?
|
142 |
+
|
143 |
+
[More Information Needed]
|
144 |
+
|
145 |
+
### Personal and Sensitive Information
|
146 |
+
|
147 |
+
[More Information Needed]
|
148 |
+
|
149 |
+
## Considerations for Using the Data
|
150 |
+
|
151 |
+
### Social Impact of Dataset
|
152 |
+
|
153 |
+
[More Information Needed]
|
154 |
+
|
155 |
+
### Discussion of Biases
|
156 |
+
|
157 |
+
[More Information Needed]
|
158 |
+
|
159 |
+
### Other Known Limitations
|
160 |
+
|
161 |
+
[More Information Needed]
|
162 |
+
|
163 |
+
## Additional Information
|
164 |
+
|
165 |
+
### Dataset Curators
|
166 |
+
|
167 |
+
[More Information Needed]
|
168 |
+
|
169 |
+
### Licensing Information
|
170 |
+
|
171 |
+
[More Information Needed]
|
172 |
+
|
173 |
+
### Citation Information
|
174 |
+
|
175 |
+
```
|
176 |
+
@article{fonseca2015evaluating,
|
177 |
+
title={Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese},
|
178 |
+
author={Fonseca, Erick R and Rosa, Jo{\~a}o Lu{\'\i}s G and Alu{\'\i}sio, Sandra Maria},
|
179 |
+
journal={Journal of the Brazilian Computer Society},
|
180 |
+
volume={21},
|
181 |
+
number={1},
|
182 |
+
pages={2},
|
183 |
+
year={2015},
|
184 |
+
publisher={Springer}
|
185 |
+
}
|
186 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "\nMac-Morpho is a corpus of Brazilian Portuguese texts annotated with part-of-speech tags.\nIts first version was released in 2003 [1], and since then, two revisions have been made in order\nto improve the quality of the resource [2, 3].\nThe corpus is available for download split into train, development and test sections.\nThese are 76%, 4% and 20% of the corpus total, respectively (the reason for the unusual numbers\nis that the corpus was first split into 80%/20% train/test, and then 5% of the train section was\nset aside for development). This split was used in [3], and new POS tagging research with Mac-Morpho\nis encouraged to follow it in order to make consistent comparisons possible.\n\n\n[1] Alu\u00edsio, S., Pelizzoni, J., Marchi, A.R., de Oliveira, L., Manenti, R., Marquiaf\u00e1vel, V. 2003.\nAn account of the challenge of tagging a reference corpus for brazilian portuguese.\nIn: Proceedings of the 6th International Conference on Computational Processing of the Portuguese Language. PROPOR 2003\n\n[2] Fonseca, E.R., Rosa, J.L.G. 2013. Mac-morpho revisited: Towards robust part-of-speech.\nIn: Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology \u2013 STIL\n\n[3] Fonseca, E.R., Alu\u00edsio, Sandra Maria, Rosa, J.L.G. 2015.\nEvaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese.\nJournal of the Brazilian Computer Society.\n", "citation": "\n@article{fonseca2015evaluating,\n title={Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese},\n author={Fonseca, Erick R and Rosa, Joao Luis G and Aluisio, Sandra Maria},\n journal={Journal of the Brazilian Computer Society},\n volume={21},\n number={1},\n pages={2},\n year={2015},\n publisher={Springer}\n}\n", "homepage": "http://www.nilc.icmc.usp.br/macmorpho/", "license": "Creative Commons Attribution 4.0 International License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"num_classes": 26, "names": ["PREP+PROADJ", "IN", "PREP+PRO-KS", "NPROP", "PREP+PROSUB", "KC", "PROPESS", "NUM", "PROADJ", "PREP+ART", "KS", "PRO-KS", "ADJ", "ADV-KS", "N", "PREP", "PROSUB", "PREP+PROPESS", "PDEN", "V", "PREP+ADV", "PCP", "CUR", "ADV", "PU", "ART"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "mac_morpho", "config_name": "default", "version": {"version_str": "3.0.0", "description": null, "major": 3, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 12635011, "num_examples": 37948, "dataset_name": "mac_morpho"}, "test": {"name": "test", "num_bytes": 3095292, "num_examples": 9987, "dataset_name": "mac_morpho"}, "validation": {"name": "validation", "num_bytes": 671356, "num_examples": 1997, "dataset_name": "mac_morpho"}}, "download_checksums": {"http://www.nilc.icmc.usp.br/macmorpho/macmorpho-v3.tgz": {"num_bytes": 2463485, "checksum": "454bd299166ab511547be43bba8b52473f8de2c69894fbb8a62a657a8d7ac52b"}}, "download_size": 2463485, "post_processing_size": null, "dataset_size": 16401659, "size_in_bytes": 18865144}}
|
dummy/3.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ccf8af274c0e9e47016bb7f00d9d1e041ad1f78e3a92b6f7057e68e1c133482f
|
3 |
+
size 2130
|
mac_morpho.py
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""Mac-Morpho dataset"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import logging
|
20 |
+
import os
|
21 |
+
import re
|
22 |
+
|
23 |
+
import datasets
|
24 |
+
|
25 |
+
|
26 |
+
_CITATION = """
|
27 |
+
@article{fonseca2015evaluating,
|
28 |
+
title={Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese},
|
29 |
+
author={Fonseca, Erick R and Rosa, Joao Luis G and Aluisio, Sandra Maria},
|
30 |
+
journal={Journal of the Brazilian Computer Society},
|
31 |
+
volume={21},
|
32 |
+
number={1},
|
33 |
+
pages={2},
|
34 |
+
year={2015},
|
35 |
+
publisher={Springer}
|
36 |
+
}
|
37 |
+
"""
|
38 |
+
|
39 |
+
_DESCRIPTION = """
|
40 |
+
Mac-Morpho is a corpus of Brazilian Portuguese texts annotated with part-of-speech tags.
|
41 |
+
Its first version was released in 2003 [1], and since then, two revisions have been made in order
|
42 |
+
to improve the quality of the resource [2, 3].
|
43 |
+
The corpus is available for download split into train, development and test sections.
|
44 |
+
These are 76%, 4% and 20% of the corpus total, respectively (the reason for the unusual numbers
|
45 |
+
is that the corpus was first split into 80%/20% train/test, and then 5% of the train section was
|
46 |
+
set aside for development). This split was used in [3], and new POS tagging research with Mac-Morpho
|
47 |
+
is encouraged to follow it in order to make consistent comparisons possible.
|
48 |
+
|
49 |
+
|
50 |
+
[1] Aluísio, S., Pelizzoni, J., Marchi, A.R., de Oliveira, L., Manenti, R., Marquiafável, V. 2003.
|
51 |
+
An account of the challenge of tagging a reference corpus for brazilian portuguese.
|
52 |
+
In: Proceedings of the 6th International Conference on Computational Processing of the Portuguese Language. PROPOR 2003
|
53 |
+
|
54 |
+
[2] Fonseca, E.R., Rosa, J.L.G. 2013. Mac-morpho revisited: Towards robust part-of-speech.
|
55 |
+
In: Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology – STIL
|
56 |
+
|
57 |
+
[3] Fonseca, E.R., Aluísio, Sandra Maria, Rosa, J.L.G. 2015.
|
58 |
+
Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese.
|
59 |
+
Journal of the Brazilian Computer Society.
|
60 |
+
"""
|
61 |
+
|
62 |
+
_HOMEPAGE = "http://www.nilc.icmc.usp.br/macmorpho/"
|
63 |
+
|
64 |
+
_LICENSE = "Creative Commons Attribution 4.0 International License"
|
65 |
+
|
66 |
+
_URL = "http://www.nilc.icmc.usp.br/macmorpho/macmorpho-v3.tgz"
|
67 |
+
|
68 |
+
|
69 |
+
class MacMorpho(datasets.GeneratorBasedBuilder):
|
70 |
+
"""Mac-Morpho dataset."""
|
71 |
+
|
72 |
+
VERSION = datasets.Version("3.0.0")
|
73 |
+
|
74 |
+
def _info(self):
|
75 |
+
return datasets.DatasetInfo(
|
76 |
+
description=_DESCRIPTION,
|
77 |
+
features=datasets.Features(
|
78 |
+
{
|
79 |
+
"id": datasets.Value("string"),
|
80 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
81 |
+
"pos_tags": datasets.Sequence(
|
82 |
+
datasets.features.ClassLabel(
|
83 |
+
names=[
|
84 |
+
"PREP+PROADJ",
|
85 |
+
"IN",
|
86 |
+
"PREP+PRO-KS",
|
87 |
+
"NPROP",
|
88 |
+
"PREP+PROSUB",
|
89 |
+
"KC",
|
90 |
+
"PROPESS",
|
91 |
+
"NUM",
|
92 |
+
"PROADJ",
|
93 |
+
"PREP+ART",
|
94 |
+
"KS",
|
95 |
+
"PRO-KS",
|
96 |
+
"ADJ",
|
97 |
+
"ADV-KS",
|
98 |
+
"N",
|
99 |
+
"PREP",
|
100 |
+
"PROSUB",
|
101 |
+
"PREP+PROPESS",
|
102 |
+
"PDEN",
|
103 |
+
"V",
|
104 |
+
"PREP+ADV",
|
105 |
+
"PCP",
|
106 |
+
"CUR",
|
107 |
+
"ADV",
|
108 |
+
"PU",
|
109 |
+
"ART",
|
110 |
+
]
|
111 |
+
)
|
112 |
+
),
|
113 |
+
}
|
114 |
+
),
|
115 |
+
supervised_keys=None,
|
116 |
+
homepage=_HOMEPAGE,
|
117 |
+
license=_LICENSE,
|
118 |
+
citation=_CITATION,
|
119 |
+
)
|
120 |
+
|
121 |
+
def _split_generators(self, dl_manager):
|
122 |
+
"""Returns SplitGenerators."""
|
123 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
124 |
+
return [
|
125 |
+
datasets.SplitGenerator(
|
126 |
+
name=datasets.Split.TRAIN,
|
127 |
+
gen_kwargs={
|
128 |
+
"filepath": os.path.join(data_dir, "macmorpho-train.txt"),
|
129 |
+
"split": "train",
|
130 |
+
},
|
131 |
+
),
|
132 |
+
datasets.SplitGenerator(
|
133 |
+
name=datasets.Split.TEST,
|
134 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "macmorpho-test.txt"), "split": "test"},
|
135 |
+
),
|
136 |
+
datasets.SplitGenerator(
|
137 |
+
name=datasets.Split.VALIDATION,
|
138 |
+
gen_kwargs={
|
139 |
+
"filepath": os.path.join(data_dir, "macmorpho-dev.txt"),
|
140 |
+
"split": "dev",
|
141 |
+
},
|
142 |
+
),
|
143 |
+
]
|
144 |
+
|
145 |
+
def _generate_examples(self, filepath, split):
|
146 |
+
""" Yields examples. """
|
147 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
148 |
+
|
149 |
+
with open(filepath, "r", encoding="utf-8") as f:
|
150 |
+
|
151 |
+
id_ = 0
|
152 |
+
|
153 |
+
for line in f:
|
154 |
+
|
155 |
+
line = line.rstrip()
|
156 |
+
chunks = re.split(r"\s+", line)
|
157 |
+
|
158 |
+
tokens = []
|
159 |
+
pos_tags = []
|
160 |
+
for chunk in chunks:
|
161 |
+
token, tag = chunk.rsplit("_", 1)
|
162 |
+
tokens.append(token)
|
163 |
+
pos_tags.append(tag)
|
164 |
+
|
165 |
+
yield id_, {
|
166 |
+
"id": str(id_),
|
167 |
+
"tokens": tokens,
|
168 |
+
"pos_tags": pos_tags,
|
169 |
+
}
|
170 |
+
id_ += 1
|