Commit
·
8ca9cd8
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 +169 -0
- autshumato.py +235 -0
- dataset_infos.json +1 -0
- dummy/autshumato-en-tn/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-en-ts-manual/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-en-ts/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-en-tsn/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-en-zu/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-tn/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-ts/1.0.0/dummy_data.zip +3 -0
- dummy/autshumato-tsn/1.0.0/dummy_data.zip +3 -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,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
autshumato-en-ts-manual:
|
8 |
+
- en
|
9 |
+
- ts
|
10 |
+
autshumato-en-tn:
|
11 |
+
- en
|
12 |
+
- tn
|
13 |
+
autshumato-en-ts:
|
14 |
+
- en
|
15 |
+
- ts
|
16 |
+
autshumato-en-zu:
|
17 |
+
- en
|
18 |
+
- zu
|
19 |
+
autshumato-tn:
|
20 |
+
- tn
|
21 |
+
autshumato-ts:
|
22 |
+
- ts
|
23 |
+
licenses:
|
24 |
+
- cc-by-2-5
|
25 |
+
multilinguality:
|
26 |
+
- multilingual
|
27 |
+
size_categories:
|
28 |
+
- 10K<n<100K
|
29 |
+
source_datasets:
|
30 |
+
- original
|
31 |
+
task_categories:
|
32 |
+
- conditional-text-generation
|
33 |
+
task_ids:
|
34 |
+
- machine-translation
|
35 |
+
---
|
36 |
+
|
37 |
+
# Dataset Card Creation Guide
|
38 |
+
|
39 |
+
## Table of Contents
|
40 |
+
- [Dataset Description](#dataset-description)
|
41 |
+
- [Dataset Summary](#dataset-summary)
|
42 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
43 |
+
- [Languages](#languages)
|
44 |
+
- [Dataset Structure](#dataset-structure)
|
45 |
+
- [Data Instances](#data-instances)
|
46 |
+
- [Data Fields](#data-instances)
|
47 |
+
- [Data Splits](#data-instances)
|
48 |
+
- [Dataset Creation](#dataset-creation)
|
49 |
+
- [Curation Rationale](#curation-rationale)
|
50 |
+
- [Source Data](#source-data)
|
51 |
+
- [Annotations](#annotations)
|
52 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
53 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
54 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
55 |
+
- [Discussion of Biases](#discussion-of-biases)
|
56 |
+
- [Other Known Limitations](#other-known-limitations)
|
57 |
+
- [Additional Information](#additional-information)
|
58 |
+
- [Dataset Curators](#dataset-curators)
|
59 |
+
- [Licensing Information](#licensing-information)
|
60 |
+
- [Citation Information](#citation-information)
|
61 |
+
|
62 |
+
## Dataset Description
|
63 |
+
|
64 |
+
- **Homepage:** [https://repo.sadilar.org/handle/20.500.12185/7/discover]()
|
65 |
+
- **Repository:** []()
|
66 |
+
- **Paper:** []()
|
67 |
+
- **Leaderboard:** []()
|
68 |
+
- **Point of Contact:** []()
|
69 |
+
|
70 |
+
### Dataset Summary
|
71 |
+
|
72 |
+
Multilingual information access is stipulated in the South African constitution. In practise, this
|
73 |
+
is hampered by a lack of resources and capacity to perform the large volumes of translation
|
74 |
+
work required to realise multilingual information access. One of the aims of the Autshumato
|
75 |
+
project is to develop machine translation systems for three South African languages pairs.
|
76 |
+
|
77 |
+
### Supported Tasks and Leaderboards
|
78 |
+
|
79 |
+
[More Information Needed]
|
80 |
+
|
81 |
+
### Languages
|
82 |
+
|
83 |
+
[More Information Needed]
|
84 |
+
|
85 |
+
## Dataset Structure
|
86 |
+
|
87 |
+
### Data Instances
|
88 |
+
|
89 |
+
[More Information Needed]
|
90 |
+
|
91 |
+
### Data Fields
|
92 |
+
|
93 |
+
[More Information Needed]
|
94 |
+
|
95 |
+
### Data Splits
|
96 |
+
|
97 |
+
[More Information Needed]
|
98 |
+
|
99 |
+
## Dataset Creation
|
100 |
+
|
101 |
+
### Curation Rationale
|
102 |
+
|
103 |
+
[More Information Needed]
|
104 |
+
|
105 |
+
### Source Data
|
106 |
+
|
107 |
+
[More Information Needed]
|
108 |
+
|
109 |
+
#### Initial Data Collection and Normalization
|
110 |
+
|
111 |
+
[More Information Needed]
|
112 |
+
|
113 |
+
#### Who are the source language producers?
|
114 |
+
|
115 |
+
[More Information Needed]
|
116 |
+
|
117 |
+
### Annotations
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
#### Annotation process
|
122 |
+
|
123 |
+
[More Information Needed]
|
124 |
+
|
125 |
+
#### Who are the annotators?
|
126 |
+
|
127 |
+
[More Information Needed]
|
128 |
+
|
129 |
+
### Personal and Sensitive Information
|
130 |
+
|
131 |
+
[More Information Needed]
|
132 |
+
|
133 |
+
|
134 |
+
## Considerations for Using the Data
|
135 |
+
|
136 |
+
### Social Impact of Dataset
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Discussion of Biases
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Other Known Limitations
|
145 |
+
|
146 |
+
[More Information Needed]
|
147 |
+
|
148 |
+
## Additional Information
|
149 |
+
|
150 |
+
[More Information Needed]
|
151 |
+
|
152 |
+
### Dataset Curators
|
153 |
+
|
154 |
+
[More Information Needed]
|
155 |
+
|
156 |
+
### Licensing Information
|
157 |
+
|
158 |
+
|
159 |
+
### Citation Information
|
160 |
+
|
161 |
+
```
|
162 |
+
@article{groenewald2010processing,
|
163 |
+
title={Processing parallel text corpora for three South African language pairs in the Autshumato project},
|
164 |
+
author={Groenewald, Hendrik J and du Plooy, Liza},
|
165 |
+
journal={AfLaT 2010},
|
166 |
+
pages={27},
|
167 |
+
year={2010}
|
168 |
+
}
|
169 |
+
```
|
autshumato.py
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Autshumato Parallel Corpora"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import os
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@article{groenewald2010processing,
|
26 |
+
title={Processing parallel text corpora for three South African language pairs in the Autshumato project},
|
27 |
+
author={Groenewald, Hendrik J and du Plooy, Liza},
|
28 |
+
journal={AfLaT 2010},
|
29 |
+
pages={27},
|
30 |
+
year={2010}
|
31 |
+
}
|
32 |
+
"""
|
33 |
+
|
34 |
+
_DESCRIPTION = """\
|
35 |
+
Multilingual information access is stipulated in the South African constitution. In practise, this
|
36 |
+
is hampered by a lack of resources and capacity to perform the large volumes of translation
|
37 |
+
work required to realise multilingual information access. One of the aims of the Autshumato
|
38 |
+
project is to develop machine translation systems for three South African languages pairs.
|
39 |
+
"""
|
40 |
+
|
41 |
+
|
42 |
+
class AutshumatoConfig(datasets.BuilderConfig):
|
43 |
+
""" BuilderConfig for NewDataset"""
|
44 |
+
|
45 |
+
def __init__(self, langs, zip_file, **kwargs):
|
46 |
+
"""
|
47 |
+
|
48 |
+
Args:
|
49 |
+
pair: the language pair to consider
|
50 |
+
zip_file: The location of zip file containing original data
|
51 |
+
**kwargs: keyword arguments forwarded to super.
|
52 |
+
"""
|
53 |
+
self.langs = langs
|
54 |
+
self.zip_file = zip_file
|
55 |
+
super().__init__(**kwargs)
|
56 |
+
|
57 |
+
|
58 |
+
class Autshumato(datasets.GeneratorBasedBuilder):
|
59 |
+
"""The IWSLT 2017 Evaluation Campaign includes a multilingual TED Talks MT task."""
|
60 |
+
|
61 |
+
VERSION = datasets.Version("1.0.0")
|
62 |
+
|
63 |
+
# This is an example of a dataset with multiple configurations.
|
64 |
+
# If you don't want/need to define several sub-sets in your dataset,
|
65 |
+
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
66 |
+
BUILDER_CONFIG_CLASS = AutshumatoConfig
|
67 |
+
BUILDER_CONFIGS = [
|
68 |
+
AutshumatoConfig(
|
69 |
+
name="autshumato-en-tn",
|
70 |
+
description="Autshumato English-Setswana Parallel Corpora",
|
71 |
+
version=datasets.Version("1.0.0"),
|
72 |
+
langs=("en", "tn"),
|
73 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/404/autshumato_english-setswana_parallel_corpora.zip",
|
74 |
+
),
|
75 |
+
# This data is protected by a form
|
76 |
+
# AutshumatoConfig(
|
77 |
+
# name="autshumato-en-nso",
|
78 |
+
# description="Autshumato English-Sesotho sa Leboa Parallel Corpora",
|
79 |
+
# version=datasets.Version("1.0.0"),
|
80 |
+
# langs=("en", "nso"),
|
81 |
+
# zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/402/en-nso.release.zip",
|
82 |
+
# ),
|
83 |
+
# This data is protected by a form
|
84 |
+
# AutshumatoConfig(
|
85 |
+
# name="autshumato-en-af",
|
86 |
+
# description="Autshumato English-Afrikaans Parallel Corpora",
|
87 |
+
# version=datasets.Version("1.0.0"),
|
88 |
+
# langs=("en", "af"),
|
89 |
+
# zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/397/en-af.release.zip",
|
90 |
+
# ),
|
91 |
+
AutshumatoConfig(
|
92 |
+
name="autshumato-en-zu",
|
93 |
+
description="Autshumato English-isiZulu Parallel Corpora",
|
94 |
+
version=datasets.Version("1.0.0"),
|
95 |
+
langs=("en", "zu"),
|
96 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/399/en-zu.release.zip",
|
97 |
+
),
|
98 |
+
AutshumatoConfig(
|
99 |
+
name="autshumato-en-ts",
|
100 |
+
description="Autshumato English-Xitsonga Parallel Corpora",
|
101 |
+
version=datasets.Version("1.0.0"),
|
102 |
+
langs=("en", "ts"),
|
103 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/406/en-ts.completebilingualcorpus.zip",
|
104 |
+
),
|
105 |
+
AutshumatoConfig(
|
106 |
+
name="autshumato-en-ts-manual",
|
107 |
+
description="Autshumato English-Xitsonga Manually Translated Parallel Corpora",
|
108 |
+
version=datasets.Version("1.0.0"),
|
109 |
+
langs=("en", "ts"),
|
110 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/405/en-ts.translationsonlycorpus.zip",
|
111 |
+
),
|
112 |
+
AutshumatoConfig(
|
113 |
+
name="autshumato-tn",
|
114 |
+
description="Autshumato Setswana Monolingual Corpora",
|
115 |
+
version=datasets.Version("1.0.0"),
|
116 |
+
langs=["tn"],
|
117 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/413/autshumato_setswana_monolingual_corpora.zip",
|
118 |
+
),
|
119 |
+
AutshumatoConfig(
|
120 |
+
name="autshumato-ts",
|
121 |
+
description="Autshumato Xitsonga Monolingual Corpora",
|
122 |
+
version=datasets.Version("1.0.0"),
|
123 |
+
langs=["ts"],
|
124 |
+
zip_file="https://repo.sadilar.org/bitstream/handle/20.500.12185/418/ts.monolingualcorpus.zip",
|
125 |
+
),
|
126 |
+
]
|
127 |
+
|
128 |
+
def _info(self):
|
129 |
+
if len(self.config.langs) == 2:
|
130 |
+
features = datasets.Features({"translation": datasets.features.Translation(languages=self.config.langs)})
|
131 |
+
else:
|
132 |
+
features = datasets.Features({"text": datasets.Value("string")})
|
133 |
+
|
134 |
+
return datasets.DatasetInfo(
|
135 |
+
# This is the description that will appear on the datasets page.
|
136 |
+
description=_DESCRIPTION,
|
137 |
+
# datasets.features.FeatureConnectors
|
138 |
+
features=features,
|
139 |
+
# If there's a common (input, target) tuple from the features,
|
140 |
+
# specify them here. They'll be used if as_supervised=True in
|
141 |
+
# builder.as_dataset.
|
142 |
+
supervised_keys=None,
|
143 |
+
# Homepage of the dataset for documentation
|
144 |
+
homepage="https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned",
|
145 |
+
citation=_CITATION,
|
146 |
+
)
|
147 |
+
|
148 |
+
def _split_generators(self, dl_manager):
|
149 |
+
"""Returns SplitGenerators."""
|
150 |
+
if len(self.config.langs) == 2:
|
151 |
+
return self._split_generators_translation(dl_manager)
|
152 |
+
if len(self.config.langs) == 1:
|
153 |
+
return self._split_generators_mono(dl_manager)
|
154 |
+
raise NotImplementedError("Can only handle 1 or 2 languages")
|
155 |
+
|
156 |
+
def _split_generators_mono(self, dl_manager):
|
157 |
+
dl_dir = dl_manager.download_and_extract(self.config.zip_file)
|
158 |
+
|
159 |
+
filenames = set()
|
160 |
+
for root, dirs, files in os.walk(dl_dir):
|
161 |
+
for filename in files:
|
162 |
+
if filename == "README.txt":
|
163 |
+
continue
|
164 |
+
filenames.add(os.path.join(dl_dir, root, filename))
|
165 |
+
source_filenames = sorted(os.path.join(dl_dir, f) for f in filenames)
|
166 |
+
|
167 |
+
return [
|
168 |
+
datasets.SplitGenerator(
|
169 |
+
name=datasets.Split.TRAIN,
|
170 |
+
# These kwargs will be passed to _generate_examples
|
171 |
+
gen_kwargs={
|
172 |
+
"source_files": source_filenames,
|
173 |
+
"target_files": [],
|
174 |
+
"split": "train",
|
175 |
+
},
|
176 |
+
),
|
177 |
+
]
|
178 |
+
|
179 |
+
def _split_generators_translation(self, dl_manager):
|
180 |
+
source, target = self.config.langs
|
181 |
+
dl_dir = dl_manager.download_and_extract(self.config.zip_file)
|
182 |
+
|
183 |
+
filenames = set(os.listdir(dl_dir))
|
184 |
+
if len(filenames) == 1:
|
185 |
+
dl_dir = os.path.join(dl_dir, list(filenames)[0])
|
186 |
+
filenames = set(os.listdir(dl_dir))
|
187 |
+
if "README.txt" in filenames:
|
188 |
+
filenames.remove("README.txt")
|
189 |
+
|
190 |
+
source_filenames = sorted(
|
191 |
+
os.path.join(dl_dir, f) for f in filenames if f.endswith(f"{source}.txt") or ".eng." in f
|
192 |
+
)
|
193 |
+
target_filenames = sorted(
|
194 |
+
os.path.join(dl_dir, f) for f in filenames if f.endswith(f"{target}.txt") or ".zul." in f
|
195 |
+
)
|
196 |
+
|
197 |
+
return [
|
198 |
+
datasets.SplitGenerator(
|
199 |
+
name=datasets.Split.TRAIN,
|
200 |
+
# These kwargs will be passed to _generate_examples
|
201 |
+
gen_kwargs={
|
202 |
+
"source_files": source_filenames,
|
203 |
+
"target_files": target_filenames,
|
204 |
+
"split": "train",
|
205 |
+
},
|
206 |
+
),
|
207 |
+
]
|
208 |
+
|
209 |
+
def _generate_examples(self, source_files, target_files, split):
|
210 |
+
""" Yields examples. """
|
211 |
+
if len(self.config.langs) == 2:
|
212 |
+
return self._generate_examples_translation(source_files, target_files, split)
|
213 |
+
elif len(self.config.langs) == 1:
|
214 |
+
return self._generate_examples_mono(source_files, target_files, split)
|
215 |
+
raise NotImplementedError("Can only handle 1 or 2 langages")
|
216 |
+
|
217 |
+
def _generate_examples_mono(self, source_files, target_files, split):
|
218 |
+
for source_file in source_files:
|
219 |
+
with open(source_file, "r", encoding="utf-8") as sf:
|
220 |
+
for id_, source_row in enumerate(sf):
|
221 |
+
source_row = source_row.strip()
|
222 |
+
yield id_, {"text": source_row}
|
223 |
+
|
224 |
+
def _generate_examples_translation(self, source_files, target_files, split):
|
225 |
+
id_ = 0
|
226 |
+
source, target = self.config.langs
|
227 |
+
for source_file, target_file in zip(source_files, target_files):
|
228 |
+
with open(source_file, "r", encoding="utf-8") as sf:
|
229 |
+
with open(target_file, "r", encoding="utf-8") as tf:
|
230 |
+
for source_row, target_row in zip(sf, tf):
|
231 |
+
source_row = source_row.strip()
|
232 |
+
target_row = target_row.strip()
|
233 |
+
|
234 |
+
yield id_, {"translation": {source: source_row, target: target_row}}
|
235 |
+
id_ += 1
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"autshumato-en-tn": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"translation": {"languages": ["en", "tn"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-en-tn", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 28826392, "num_examples": 159000, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/404/autshumato_english-setswana_parallel_corpora.zip": {"num_bytes": 9458762, "checksum": "d065afa02f1896ff68e075ecc4dd9792c8009237179224e485485db7e0cd91c8"}}, "download_size": 9458762, "post_processing_size": null, "dataset_size": 28826392, "size_in_bytes": 38285154}, "autshumato-en-zu": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"translation": {"languages": ["en", "zu"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-en-zu", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7188970, "num_examples": 35489, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/399/en-zu.release.zip": {"num_bytes": 2068891, "checksum": "8dad123acc3f91c539600a26a2120e33a239d77f95e5cd3788ed888eca3fa02b"}}, "download_size": 2068891, "post_processing_size": null, "dataset_size": 7188970, "size_in_bytes": 9257861}, "autshumato-en-ts": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"translation": {"languages": ["en", "ts"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-en-ts", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 50803849, "num_examples": 450000, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/406/en-ts.completebilingualcorpus.zip": {"num_bytes": 15145915, "checksum": "702da4541ba172d61f91b0a244bc1dbe09f104ae308c9e5fddaaee41a3a47213"}}, "download_size": 15145915, "post_processing_size": null, "dataset_size": 50803849, "size_in_bytes": 65949764}, "autshumato-en-ts-manual": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"translation": {"languages": ["en", "ts"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-en-ts-manual", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10408757, "num_examples": 92396, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/405/en-ts.translationsonlycorpus.zip": {"num_bytes": 2876924, "checksum": "4bd526b3f16a6d9b779308822cb58b86477b7cd079c9d47fe98e2b9ce54c47c6"}}, "download_size": 2876924, "post_processing_size": null, "dataset_size": 10408757, "size_in_bytes": 13285681}, "autshumato-tn": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-tn", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5132267, "num_examples": 38206, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/413/autshumato_setswana_monolingual_corpora.zip": {"num_bytes": 1599029, "checksum": "6cf041b9bfb7b20ff3087d4716656746eab9853cc290c106bc59010f9a0e4c9e"}}, "download_size": 1599029, "post_processing_size": null, "dataset_size": 5132267, "size_in_bytes": 6731296}, "autshumato-ts": {"description": "Multilingual information access is stipulated in the South African constitution. In practise, this\nis hampered by a lack of resources and capacity to perform the large volumes of translation\nwork required to realise multilingual information access. One of the aims of the Autshumato\nproject is to develop machine translation systems for three South African languages pairs.\n", "citation": "@article{groenewald2010processing,\n title={Processing parallel text corpora for three South African language pairs in the Autshumato project},\n author={Groenewald, Hendrik J and du Plooy, Liza},\n journal={AfLaT 2010},\n pages={27},\n year={2010}\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/7/discover?filtertype=database&filter_relational_operator=equals&filter=Multilingual+Text+Corpora%3A+Aligned", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "autshumato", "config_name": "autshumato-ts", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3399674, "num_examples": 58398, "dataset_name": "autshumato"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/418/ts.monolingualcorpus.zip": {"num_bytes": 974488, "checksum": "7fa54c2fc3823b5a12bd755de2b422b8422833ea757641fcbcf60f9a5cf9c33b"}}, "download_size": 974488, "post_processing_size": null, "dataset_size": 3399674, "size_in_bytes": 4374162}}
|
dummy/autshumato-en-tn/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:07cd05cd3f07ea050f56e433ea9857eff07e6315f0bb0150736dbd4267959509
|
3 |
+
size 4711
|
dummy/autshumato-en-ts-manual/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6b1311ae83f12653766c359157666302c0b0af90e3b840501f02599efb22b339
|
3 |
+
size 1148
|
dummy/autshumato-en-ts/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:965d2f61ddc74663290a9efc7c5b37a916aa05940de2b01c8514b781a1abd104
|
3 |
+
size 1316
|
dummy/autshumato-en-tsn/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b06804f354317db59966a1b9a8a35a75a1064505fb973146b890f2a2f646f962
|
3 |
+
size 4711
|
dummy/autshumato-en-zu/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ba873baa1118d2b14a0971f2c7acef7dd21ff8fdde2e7be68b81fee4aead2135
|
3 |
+
size 1584
|
dummy/autshumato-tn/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:778a78ec71112016ea529a9c6aa435ed388fc1fcf965385eb9c3db8b15c792f1
|
3 |
+
size 1201
|
dummy/autshumato-ts/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cdda110e74e5a7944283013a205cdfe8daeefe44cf41829ca0895f7883868aae
|
3 |
+
size 705
|
dummy/autshumato-tsn/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c80a4dd414986540bf0e775a082b7baa84ffe10bbcb4f94ab5b13062da539b6
|
3 |
+
size 1201
|