Datasets:
Commit
•
eded5ea
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 +155 -0
- dataset_infos.json +1 -0
- dummy/tmx/0.0.0/dummy_data.zip +3 -0
- opus_dogc.py +102 -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,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- no-annotation
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- ca
|
8 |
+
- es
|
9 |
+
licenses:
|
10 |
+
- cc0-1-0
|
11 |
+
multilinguality:
|
12 |
+
- translation
|
13 |
+
size_categories:
|
14 |
+
- n>1M
|
15 |
+
source_datasets:
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- conditional-text-generation
|
19 |
+
task_ids:
|
20 |
+
- machine-translation
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for OPUS DOGC
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** http://opus.nlpl.eu/DOGC.php
|
51 |
+
- **Repository:**
|
52 |
+
- **Paper:**
|
53 |
+
- **Leaderboard:**
|
54 |
+
- **Point of Contact:**
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
OPUS DOGC is a collection of documents from the Official Journal of the Government of Catalonia, in Catalan and Spanish languages, provided by Antoni Oliver Gonzalez from the Universitat Oberta de Catalunya.
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
Dataset is multilingual with parallel text in:
|
67 |
+
- Catalan
|
68 |
+
- Spanish
|
69 |
+
|
70 |
+
## Dataset Structure
|
71 |
+
|
72 |
+
### Data Instances
|
73 |
+
|
74 |
+
[More Information Needed]
|
75 |
+
|
76 |
+
### Data Fields
|
77 |
+
|
78 |
+
A data instance contains the following fields:
|
79 |
+
- `ca`: the Catalan text
|
80 |
+
- `es`: the aligned Spanish text
|
81 |
+
|
82 |
+
### Data Splits
|
83 |
+
|
84 |
+
[More Information Needed]
|
85 |
+
|
86 |
+
## Dataset Creation
|
87 |
+
|
88 |
+
### Curation Rationale
|
89 |
+
|
90 |
+
[More Information Needed]
|
91 |
+
|
92 |
+
### Source Data
|
93 |
+
|
94 |
+
#### Initial Data Collection and Normalization
|
95 |
+
|
96 |
+
[More Information Needed]
|
97 |
+
|
98 |
+
#### Who are the source language producers?
|
99 |
+
|
100 |
+
[More Information Needed]
|
101 |
+
|
102 |
+
### Annotations
|
103 |
+
|
104 |
+
#### Annotation process
|
105 |
+
|
106 |
+
[More Information Needed]
|
107 |
+
|
108 |
+
#### Who are the annotators?
|
109 |
+
|
110 |
+
[More Information Needed]
|
111 |
+
|
112 |
+
### Personal and Sensitive Information
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
## Considerations for Using the Data
|
117 |
+
|
118 |
+
### Social Impact of Dataset
|
119 |
+
|
120 |
+
[More Information Needed]
|
121 |
+
|
122 |
+
### Discussion of Biases
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
### Other Known Limitations
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
## Additional Information
|
131 |
+
|
132 |
+
### Dataset Curators
|
133 |
+
|
134 |
+
[More Information Needed]
|
135 |
+
|
136 |
+
### Licensing Information
|
137 |
+
|
138 |
+
Dataset is in the Public Domain under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/).
|
139 |
+
|
140 |
+
### Citation Information
|
141 |
+
|
142 |
+
```
|
143 |
+
@inproceedings{tiedemann-2012-parallel,
|
144 |
+
title = "Parallel Data, Tools and Interfaces in {OPUS}",
|
145 |
+
author = {Tiedemann, J{\"o}rg},
|
146 |
+
booktitle = "Proceedings of the Eighth International Conference on Language Resources and Evaluation ({LREC}'12)",
|
147 |
+
month = may,
|
148 |
+
year = "2012",
|
149 |
+
address = "Istanbul, Turkey",
|
150 |
+
publisher = "European Language Resources Association (ELRA)",
|
151 |
+
url = "http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf",
|
152 |
+
pages = "2214--2218",
|
153 |
+
abstract = "This paper presents the current status of OPUS, a growing language resource of parallel corpora and related tools. The focus in OPUS is to provide freely available data sets in various formats together with basic annotation to be useful for applications in computational linguistics, translation studies and cross-linguistic corpus studies. In this paper, we report about new data sets and their features, additional annotation tools and models provided from the website and essential interfaces and on-line services included in the project.",
|
154 |
+
}
|
155 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"tmx": {"description": "This is a collection of documents from the Official Journal of the Government of Catalonia, in Catalan and Spanish languages, provided by Antoni Oliver Gonzalez from the Universitat Oberta de Catalunya.\n", "citation": "@inproceedings{tiedemann-2012-parallel,\n title = \"Parallel Data, Tools and Interfaces in {OPUS}\",\n author = {Tiedemann, J{\"o}rg},\n booktitle = \"Proceedings of the Eighth International Conference on Language Resources and Evaluation ({LREC}'12)\",\n month = may,\n year = \"2012\",\n address = \"Istanbul, Turkey\",\n publisher = \"European Language Resources Association (ELRA)\",\n url = \"http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf\",\n pages = \"2214--2218\",\n abstract = \"This paper presents the current status of OPUS, a growing language resource of parallel corpora and related tools. The focus in OPUS is to provide freely available data sets in various formats together with basic annotation to be useful for applications in computational linguistics, translation studies and cross-linguistic corpus studies. In this paper, we report about new data sets and their features, additional annotation tools and models provided from the website and essential interfaces and on-line services included in the project.\",\n}\n", "homepage": "http://opus.nlpl.eu/DOGC.php", "license": "", "features": {"translation": {"languages": ["ca", "es"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": {"input": "ca", "output": "es"}, "builder_name": "opus_dogc", "config_name": "tmx", "version": "0.0.0", "splits": {"train": {"name": "train", "num_bytes": 1258924464, "num_examples": 4763575, "dataset_name": "opus_dogc"}}, "download_checksums": {"http://opus.nlpl.eu/download.php?f=DOGC/v2/tmx/ca-es.tmx.gz": {"num_bytes": 331724078, "checksum": "838e3972516b3dda6d20ebe403e180b9fb8b7e36574a0f9dceaabf18ed3d322e"}}, "download_size": 331724078, "post_processing_size": null, "dataset_size": 1258924464, "size_in_bytes": 1590648542}}
|
dummy/tmx/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:692398579369c8f73e6aefb6c490943b60752bf6748d29956ebdd9c31b515160
|
3 |
+
size 1309
|
opus_dogc.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""OPUS DOGC dataset."""
|
16 |
+
|
17 |
+
import xml.etree.ElementTree as ET
|
18 |
+
|
19 |
+
import datasets
|
20 |
+
|
21 |
+
|
22 |
+
_DESCRIPTION = """\
|
23 |
+
This is a collection of documents from the Official Journal of the Government of Catalonia, in Catalan and Spanish \
|
24 |
+
languages, provided by Antoni Oliver Gonzalez from the Universitat Oberta de Catalunya.
|
25 |
+
"""
|
26 |
+
|
27 |
+
_CITATION = """\
|
28 |
+
@inproceedings{tiedemann-2012-parallel,
|
29 |
+
title = "Parallel Data, Tools and Interfaces in {OPUS}",
|
30 |
+
author = {Tiedemann, J{\"o}rg},
|
31 |
+
booktitle = "Proceedings of the Eighth International Conference on Language Resources and Evaluation ({LREC}'12)",
|
32 |
+
month = may,
|
33 |
+
year = "2012",
|
34 |
+
address = "Istanbul, Turkey",
|
35 |
+
publisher = "European Language Resources Association (ELRA)",
|
36 |
+
url = "http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf",
|
37 |
+
pages = "2214--2218",
|
38 |
+
abstract = "This paper presents the current status of OPUS, a growing language resource of parallel corpora and related tools. The focus in OPUS is to provide freely available data sets in various formats together with basic annotation to be useful for applications in computational linguistics, translation studies and cross-linguistic corpus studies. In this paper, we report about new data sets and their features, additional annotation tools and models provided from the website and essential interfaces and on-line services included in the project.",
|
39 |
+
}
|
40 |
+
"""
|
41 |
+
|
42 |
+
_URL = "http://opus.nlpl.eu/DOGC.php"
|
43 |
+
_FILE_FORMATS = ["tmx"]
|
44 |
+
_URLS = {"tmx": "http://opus.nlpl.eu/download.php?f=DOGC/v2/tmx/ca-es.tmx.gz"}
|
45 |
+
|
46 |
+
|
47 |
+
class OpusDogcConfig(datasets.BuilderConfig):
|
48 |
+
""" BuilderConfig for OpusDogcConfig."""
|
49 |
+
|
50 |
+
def __init__(self, file_format=None, **kwargs):
|
51 |
+
"""
|
52 |
+
|
53 |
+
Args:
|
54 |
+
file_format: language of the subdataset.
|
55 |
+
**kwargs: keyword arguments forwarded to super.
|
56 |
+
"""
|
57 |
+
super().__init__(
|
58 |
+
name=file_format, description=f"OPUS DOGC dataset from source file format {file_format}.", **kwargs
|
59 |
+
)
|
60 |
+
self.file_format = file_format
|
61 |
+
|
62 |
+
|
63 |
+
class OpusDogc(datasets.GeneratorBasedBuilder):
|
64 |
+
"""OPUS DOGC dataset."""
|
65 |
+
|
66 |
+
BUILDER_CONFIG_CLASS = OpusDogcConfig
|
67 |
+
BUILDER_CONFIGS = [OpusDogcConfig(file_format=file_format) for file_format in _FILE_FORMATS]
|
68 |
+
|
69 |
+
def _info(self):
|
70 |
+
return datasets.DatasetInfo(
|
71 |
+
description=_DESCRIPTION,
|
72 |
+
features=datasets.Features({"translation": datasets.features.Translation(languages=("ca", "es"))}),
|
73 |
+
supervised_keys=("ca", "es"),
|
74 |
+
homepage=_URL,
|
75 |
+
citation=_CITATION,
|
76 |
+
)
|
77 |
+
|
78 |
+
def _split_generators(self, dl_manager):
|
79 |
+
url_to_download = _URLS[self.config.file_format]
|
80 |
+
downloaded_file = dl_manager.download_and_extract(url_to_download)
|
81 |
+
return [
|
82 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_file}),
|
83 |
+
]
|
84 |
+
|
85 |
+
def _generate_examples(self, filepath):
|
86 |
+
xml_lang = "{http://www.w3.org/XML/1998/namespace}lang"
|
87 |
+
with open(filepath, encoding="utf-8") as f:
|
88 |
+
id_ = 0
|
89 |
+
for _, elem in ET.iterparse(f):
|
90 |
+
if elem.tag == "tuv":
|
91 |
+
language = elem.attrib[xml_lang]
|
92 |
+
sentence = elem.find("seg").text
|
93 |
+
if language == "ca":
|
94 |
+
ca_sentence = sentence
|
95 |
+
elif language == "es":
|
96 |
+
es_sentence = sentence
|
97 |
+
elif elem.tag == "tu":
|
98 |
+
yield id_, {
|
99 |
+
"translation": {"ca": ca_sentence, "es": es_sentence},
|
100 |
+
}
|
101 |
+
id_ += 1
|
102 |
+
elem.clear()
|