Datasets:
Tasks:
Token Classification
Sub-tasks:
part-of-speech
Languages:
Portuguese
Size:
10K<n<100K
License:
Commit ·
ceed018
1
Parent(s): 04eec92
Update parquet files
Browse files- .gitattributes +0 -27
- README.md +0 -241
- dataset_infos.json +0 -1
- default/mac_morpho-test.parquet +3 -0
- default/mac_morpho-train.parquet +3 -0
- default/mac_morpho-validation.parquet +3 -0
- mac_morpho.py +0 -171
.gitattributes
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,241 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
pretty_name: Mac-Morpho
|
| 3 |
-
annotations_creators:
|
| 4 |
-
- expert-generated
|
| 5 |
-
language_creators:
|
| 6 |
-
- found
|
| 7 |
-
language:
|
| 8 |
-
- pt
|
| 9 |
-
license:
|
| 10 |
-
- cc-by-4.0
|
| 11 |
-
multilinguality:
|
| 12 |
-
- monolingual
|
| 13 |
-
size_categories:
|
| 14 |
-
- 10K<n<100K
|
| 15 |
-
source_datasets:
|
| 16 |
-
- original
|
| 17 |
-
task_categories:
|
| 18 |
-
- token-classification
|
| 19 |
-
task_ids:
|
| 20 |
-
- part-of-speech
|
| 21 |
-
paperswithcode_id: null
|
| 22 |
-
dataset_info:
|
| 23 |
-
features:
|
| 24 |
-
- name: id
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: tokens
|
| 27 |
-
sequence: string
|
| 28 |
-
- name: pos_tags
|
| 29 |
-
sequence:
|
| 30 |
-
class_label:
|
| 31 |
-
names:
|
| 32 |
-
0: PREP+PROADJ
|
| 33 |
-
1: IN
|
| 34 |
-
2: PREP+PRO-KS
|
| 35 |
-
3: NPROP
|
| 36 |
-
4: PREP+PROSUB
|
| 37 |
-
5: KC
|
| 38 |
-
6: PROPESS
|
| 39 |
-
7: NUM
|
| 40 |
-
8: PROADJ
|
| 41 |
-
9: PREP+ART
|
| 42 |
-
10: KS
|
| 43 |
-
11: PRO-KS
|
| 44 |
-
12: ADJ
|
| 45 |
-
13: ADV-KS
|
| 46 |
-
14: N
|
| 47 |
-
15: PREP
|
| 48 |
-
16: PROSUB
|
| 49 |
-
17: PREP+PROPESS
|
| 50 |
-
18: PDEN
|
| 51 |
-
19: V
|
| 52 |
-
20: PREP+ADV
|
| 53 |
-
21: PCP
|
| 54 |
-
22: CUR
|
| 55 |
-
23: ADV
|
| 56 |
-
24: PU
|
| 57 |
-
25: ART
|
| 58 |
-
splits:
|
| 59 |
-
- name: train
|
| 60 |
-
num_bytes: 12635011
|
| 61 |
-
num_examples: 37948
|
| 62 |
-
- name: test
|
| 63 |
-
num_bytes: 3095292
|
| 64 |
-
num_examples: 9987
|
| 65 |
-
- name: validation
|
| 66 |
-
num_bytes: 671356
|
| 67 |
-
num_examples: 1997
|
| 68 |
-
download_size: 2463485
|
| 69 |
-
dataset_size: 16401659
|
| 70 |
-
---
|
| 71 |
-
|
| 72 |
-
# Dataset Card for Mac-Morpho
|
| 73 |
-
|
| 74 |
-
## Table of Contents
|
| 75 |
-
- [Dataset Description](#dataset-description)
|
| 76 |
-
- [Dataset Summary](#dataset-summary)
|
| 77 |
-
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
| 78 |
-
- [Languages](#languages)
|
| 79 |
-
- [Dataset Structure](#dataset-structure)
|
| 80 |
-
- [Data Instances](#data-instances)
|
| 81 |
-
- [Data Fields](#data-fields)
|
| 82 |
-
- [Data Splits](#data-splits)
|
| 83 |
-
- [Dataset Creation](#dataset-creation)
|
| 84 |
-
- [Curation Rationale](#curation-rationale)
|
| 85 |
-
- [Source Data](#source-data)
|
| 86 |
-
- [Annotations](#annotations)
|
| 87 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
| 88 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
| 89 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
| 90 |
-
- [Discussion of Biases](#discussion-of-biases)
|
| 91 |
-
- [Other Known Limitations](#other-known-limitations)
|
| 92 |
-
- [Additional Information](#additional-information)
|
| 93 |
-
- [Dataset Curators](#dataset-curators)
|
| 94 |
-
- [Licensing Information](#licensing-information)
|
| 95 |
-
- [Citation Information](#citation-information)
|
| 96 |
-
- [Contributions](#contributions)
|
| 97 |
-
|
| 98 |
-
## Dataset Description
|
| 99 |
-
|
| 100 |
-
- **Homepage:** [Mac-Morpho homepage](http://nilc.icmc.usp.br/macmorpho/)
|
| 101 |
-
- **Repository:** [Mac-Morpho repository](http://nilc.icmc.usp.br/macmorpho/)
|
| 102 |
-
- **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)
|
| 103 |
-
- **Point of Contact:** [Erick R Fonseca](mailto:erickrfonseca@gmail.com)
|
| 104 |
-
|
| 105 |
-
### Dataset Summary
|
| 106 |
-
|
| 107 |
-
Mac-Morpho is a corpus of Brazilian Portuguese texts annotated with part-of-speech tags.
|
| 108 |
-
Its first version was released in 2003 [1], and since then, two revisions have been made in order
|
| 109 |
-
to improve the quality of the resource [2, 3].
|
| 110 |
-
The corpus is available for download split into train, development and test sections.
|
| 111 |
-
These are 76%, 4% and 20% of the corpus total, respectively (the reason for the unusual numbers
|
| 112 |
-
is that the corpus was first split into 80%/20% train/test, and then 5% of the train section was
|
| 113 |
-
set aside for development). This split was used in [3], and new POS tagging research with Mac-Morpho
|
| 114 |
-
is encouraged to follow it in order to make consistent comparisons possible.
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
[1] Aluísio, S., Pelizzoni, J., Marchi, A.R., de Oliveira, L., Manenti, R., Marquiafável, V. 2003.
|
| 118 |
-
An account of the challenge of tagging a reference corpus for brazilian portuguese.
|
| 119 |
-
In: Proceedings of the 6th International Conference on Computational Processing of the Portuguese Language. PROPOR 2003
|
| 120 |
-
|
| 121 |
-
[2] Fonseca, E.R., Rosa, J.L.G. 2013. Mac-morpho revisited: Towards robust part-of-speech.
|
| 122 |
-
In: Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology – STIL
|
| 123 |
-
|
| 124 |
-
[3] Fonseca, E.R., Aluísio, Sandra Maria, Rosa, J.L.G. 2015.
|
| 125 |
-
Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese.
|
| 126 |
-
Journal of the Brazilian Computer Society.
|
| 127 |
-
|
| 128 |
-
### Supported Tasks and Leaderboards
|
| 129 |
-
|
| 130 |
-
[More Information Needed]
|
| 131 |
-
|
| 132 |
-
### Languages
|
| 133 |
-
|
| 134 |
-
Portuguese
|
| 135 |
-
|
| 136 |
-
## Dataset Structure
|
| 137 |
-
|
| 138 |
-
### Data Instances
|
| 139 |
-
|
| 140 |
-
An example from the Mac-Morpho dataset looks as follows:
|
| 141 |
-
|
| 142 |
-
```
|
| 143 |
-
{
|
| 144 |
-
"id": "0",
|
| 145 |
-
"pos_tags": [14, 19, 14, 15, 22, 7, 14, 9, 14, 9, 3, 15, 3, 3, 24],
|
| 146 |
-
"tokens": ["Jersei", "atinge", "média", "de", "Cr$", "1,4", "milhão", "na", "venda", "da", "Pinhal", "em", "São", "Paulo", "."]
|
| 147 |
-
}
|
| 148 |
-
```
|
| 149 |
-
|
| 150 |
-
### Data Fields
|
| 151 |
-
|
| 152 |
-
- `id`: id of the sample
|
| 153 |
-
- `tokens`: the tokens of the example text
|
| 154 |
-
- `pos`: the PoS tags of each token
|
| 155 |
-
|
| 156 |
-
The PoS tags correspond to this list:
|
| 157 |
-
```
|
| 158 |
-
"PREP+PROADJ", "IN", "PREP+PRO-KS", "NPROP", "PREP+PROSUB", "KC", "PROPESS", "NUM", "PROADJ", "PREP+ART", "KS",
|
| 159 |
-
"PRO-KS", "ADJ", "ADV-KS", "N", "PREP", "PROSUB", "PREP+PROPESS", "PDEN", "V", "PREP+ADV", "PCP", "CUR", "ADV", "PU", "ART"
|
| 160 |
-
```
|
| 161 |
-
|
| 162 |
-
### Data Splits
|
| 163 |
-
|
| 164 |
-
The data is split into train, validation and test set. The split sizes are as follow:
|
| 165 |
-
|
| 166 |
-
| Train | Val | Test |
|
| 167 |
-
| ------ | ----- | ----- |
|
| 168 |
-
| 37948 | 1997 | 9987 |
|
| 169 |
-
|
| 170 |
-
## Dataset Creation
|
| 171 |
-
|
| 172 |
-
### Curation Rationale
|
| 173 |
-
|
| 174 |
-
[More Information Needed]
|
| 175 |
-
|
| 176 |
-
### Source Data
|
| 177 |
-
|
| 178 |
-
#### Initial Data Collection and Normalization
|
| 179 |
-
|
| 180 |
-
[More Information Needed]
|
| 181 |
-
|
| 182 |
-
#### Who are the source language producers?
|
| 183 |
-
|
| 184 |
-
[More Information Needed]
|
| 185 |
-
|
| 186 |
-
### Annotations
|
| 187 |
-
|
| 188 |
-
#### Annotation process
|
| 189 |
-
|
| 190 |
-
[More Information Needed]
|
| 191 |
-
|
| 192 |
-
#### Who are the annotators?
|
| 193 |
-
|
| 194 |
-
[More Information Needed]
|
| 195 |
-
|
| 196 |
-
### Personal and Sensitive Information
|
| 197 |
-
|
| 198 |
-
[More Information Needed]
|
| 199 |
-
|
| 200 |
-
## Considerations for Using the Data
|
| 201 |
-
|
| 202 |
-
### Social Impact of Dataset
|
| 203 |
-
|
| 204 |
-
[More Information Needed]
|
| 205 |
-
|
| 206 |
-
### Discussion of Biases
|
| 207 |
-
|
| 208 |
-
[More Information Needed]
|
| 209 |
-
|
| 210 |
-
### Other Known Limitations
|
| 211 |
-
|
| 212 |
-
[More Information Needed]
|
| 213 |
-
|
| 214 |
-
## Additional Information
|
| 215 |
-
|
| 216 |
-
### Dataset Curators
|
| 217 |
-
|
| 218 |
-
[More Information Needed]
|
| 219 |
-
|
| 220 |
-
### Licensing Information
|
| 221 |
-
|
| 222 |
-
[More Information Needed]
|
| 223 |
-
|
| 224 |
-
### Citation Information
|
| 225 |
-
|
| 226 |
-
```
|
| 227 |
-
@article{fonseca2015evaluating,
|
| 228 |
-
title={Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese},
|
| 229 |
-
author={Fonseca, Erick R and Rosa, Jo{\~a}o Lu{\'\i}s G and Alu{\'\i}sio, Sandra Maria},
|
| 230 |
-
journal={Journal of the Brazilian Computer Society},
|
| 231 |
-
volume={21},
|
| 232 |
-
number={1},
|
| 233 |
-
pages={2},
|
| 234 |
-
year={2015},
|
| 235 |
-
publisher={Springer}
|
| 236 |
-
}
|
| 237 |
-
```
|
| 238 |
-
|
| 239 |
-
### Contributions
|
| 240 |
-
|
| 241 |
-
Thanks to [@jonatasgrosman](https://github.com/jonatasgrosman) for adding this dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 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}}
|
|
|
|
|
|
default/mac_morpho-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b9e2676226e792148c9af63a7c5207a5709a663f959fefd7b9fb73afd4eb717
|
| 3 |
+
size 874845
|
default/mac_morpho-train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6373d503c5c9965a1b1ec9b4af38f2195480bb13e7f7417af5d6990551a67682
|
| 3 |
+
size 3366294
|
default/mac_morpho-validation.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ee89cacf3e36ff774fa6baa634be0a8bfef31a663c78cff0a3147c0b15515be4
|
| 3 |
+
size 198184
|
mac_morpho.py
DELETED
|
@@ -1,171 +0,0 @@
|
|
| 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 |
-
import re
|
| 18 |
-
|
| 19 |
-
import datasets
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
logger = datasets.logging.get_logger(__name__)
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
_CITATION = """
|
| 26 |
-
@article{fonseca2015evaluating,
|
| 27 |
-
title={Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese},
|
| 28 |
-
author={Fonseca, Erick R and Rosa, Joao Luis G and Aluisio, Sandra Maria},
|
| 29 |
-
journal={Journal of the Brazilian Computer Society},
|
| 30 |
-
volume={21},
|
| 31 |
-
number={1},
|
| 32 |
-
pages={2},
|
| 33 |
-
year={2015},
|
| 34 |
-
publisher={Springer}
|
| 35 |
-
}
|
| 36 |
-
"""
|
| 37 |
-
|
| 38 |
-
_DESCRIPTION = """
|
| 39 |
-
Mac-Morpho is a corpus of Brazilian Portuguese texts annotated with part-of-speech tags.
|
| 40 |
-
Its first version was released in 2003 [1], and since then, two revisions have been made in order
|
| 41 |
-
to improve the quality of the resource [2, 3].
|
| 42 |
-
The corpus is available for download split into train, development and test sections.
|
| 43 |
-
These are 76%, 4% and 20% of the corpus total, respectively (the reason for the unusual numbers
|
| 44 |
-
is that the corpus was first split into 80%/20% train/test, and then 5% of the train section was
|
| 45 |
-
set aside for development). This split was used in [3], and new POS tagging research with Mac-Morpho
|
| 46 |
-
is encouraged to follow it in order to make consistent comparisons possible.
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
[1] Aluísio, S., Pelizzoni, J., Marchi, A.R., de Oliveira, L., Manenti, R., Marquiafável, V. 2003.
|
| 50 |
-
An account of the challenge of tagging a reference corpus for brazilian portuguese.
|
| 51 |
-
In: Proceedings of the 6th International Conference on Computational Processing of the Portuguese Language. PROPOR 2003
|
| 52 |
-
|
| 53 |
-
[2] Fonseca, E.R., Rosa, J.L.G. 2013. Mac-morpho revisited: Towards robust part-of-speech.
|
| 54 |
-
In: Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology – STIL
|
| 55 |
-
|
| 56 |
-
[3] Fonseca, E.R., Aluísio, Sandra Maria, Rosa, J.L.G. 2015.
|
| 57 |
-
Evaluating word embeddings and a revised corpus for part-of-speech tagging in Portuguese.
|
| 58 |
-
Journal of the Brazilian Computer Society.
|
| 59 |
-
"""
|
| 60 |
-
|
| 61 |
-
_HOMEPAGE = "http://www.nilc.icmc.usp.br/macmorpho/"
|
| 62 |
-
|
| 63 |
-
_LICENSE = "Creative Commons Attribution 4.0 International License"
|
| 64 |
-
|
| 65 |
-
_URL = "http://www.nilc.icmc.usp.br/macmorpho/macmorpho-v3.tgz"
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
class MacMorpho(datasets.GeneratorBasedBuilder):
|
| 69 |
-
"""Mac-Morpho dataset."""
|
| 70 |
-
|
| 71 |
-
VERSION = datasets.Version("3.0.0")
|
| 72 |
-
|
| 73 |
-
def _info(self):
|
| 74 |
-
return datasets.DatasetInfo(
|
| 75 |
-
description=_DESCRIPTION,
|
| 76 |
-
features=datasets.Features(
|
| 77 |
-
{
|
| 78 |
-
"id": datasets.Value("string"),
|
| 79 |
-
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 80 |
-
"pos_tags": datasets.Sequence(
|
| 81 |
-
datasets.features.ClassLabel(
|
| 82 |
-
names=[
|
| 83 |
-
"PREP+PROADJ",
|
| 84 |
-
"IN",
|
| 85 |
-
"PREP+PRO-KS",
|
| 86 |
-
"NPROP",
|
| 87 |
-
"PREP+PROSUB",
|
| 88 |
-
"KC",
|
| 89 |
-
"PROPESS",
|
| 90 |
-
"NUM",
|
| 91 |
-
"PROADJ",
|
| 92 |
-
"PREP+ART",
|
| 93 |
-
"KS",
|
| 94 |
-
"PRO-KS",
|
| 95 |
-
"ADJ",
|
| 96 |
-
"ADV-KS",
|
| 97 |
-
"N",
|
| 98 |
-
"PREP",
|
| 99 |
-
"PROSUB",
|
| 100 |
-
"PREP+PROPESS",
|
| 101 |
-
"PDEN",
|
| 102 |
-
"V",
|
| 103 |
-
"PREP+ADV",
|
| 104 |
-
"PCP",
|
| 105 |
-
"CUR",
|
| 106 |
-
"ADV",
|
| 107 |
-
"PU",
|
| 108 |
-
"ART",
|
| 109 |
-
]
|
| 110 |
-
)
|
| 111 |
-
),
|
| 112 |
-
}
|
| 113 |
-
),
|
| 114 |
-
supervised_keys=None,
|
| 115 |
-
homepage=_HOMEPAGE,
|
| 116 |
-
license=_LICENSE,
|
| 117 |
-
citation=_CITATION,
|
| 118 |
-
)
|
| 119 |
-
|
| 120 |
-
def _split_generators(self, dl_manager):
|
| 121 |
-
"""Returns SplitGenerators."""
|
| 122 |
-
archive = dl_manager.download(_URL)
|
| 123 |
-
return [
|
| 124 |
-
datasets.SplitGenerator(
|
| 125 |
-
name=datasets.Split.TRAIN,
|
| 126 |
-
gen_kwargs={
|
| 127 |
-
"filepath": "macmorpho-train.txt",
|
| 128 |
-
"files": dl_manager.iter_archive(archive),
|
| 129 |
-
},
|
| 130 |
-
),
|
| 131 |
-
datasets.SplitGenerator(
|
| 132 |
-
name=datasets.Split.TEST,
|
| 133 |
-
gen_kwargs={
|
| 134 |
-
"filepath": "macmorpho-test.txt",
|
| 135 |
-
"files": dl_manager.iter_archive(archive),
|
| 136 |
-
},
|
| 137 |
-
),
|
| 138 |
-
datasets.SplitGenerator(
|
| 139 |
-
name=datasets.Split.VALIDATION,
|
| 140 |
-
gen_kwargs={
|
| 141 |
-
"filepath": "macmorpho-dev.txt",
|
| 142 |
-
"files": dl_manager.iter_archive(archive),
|
| 143 |
-
},
|
| 144 |
-
),
|
| 145 |
-
]
|
| 146 |
-
|
| 147 |
-
def _generate_examples(self, filepath, files):
|
| 148 |
-
"""Yields examples."""
|
| 149 |
-
for path, f in files:
|
| 150 |
-
if path == filepath:
|
| 151 |
-
id_ = 0
|
| 152 |
-
|
| 153 |
-
for line in f:
|
| 154 |
-
|
| 155 |
-
line = line.decode("utf-8").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
|
| 171 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|