Datasets:

Multilinguality:
translation
Size Categories:
100K<n<1M
Language Creators:
found
Annotations Creators:
found
Source Datasets:
original
Tags:
License:
albertvillanova HF staff commited on
Commit
a50cff5
1 Parent(s): cfdad53

Delete loading script

Browse files
Files changed (1) hide show
  1. opus_elhuyar.py +0 -96
opus_elhuyar.py DELETED
@@ -1,96 +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
- """Opus elhuyar : Spanish - Basque """
16
-
17
-
18
- import os
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @InProceedings{opus:Elhuyar,
25
- title = {Parallel Data, Tools and Interfaces in OPUS. In Proceedings of the 8th International \
26
- Conference on Language Resources and Evaluation (LREC 2012)},
27
- authors={J. Tiedemann},
28
- year={2012}
29
- }"""
30
-
31
-
32
- _DESCRIPTION = """\
33
- Dataset provided by the foundation Elhuyar, which is having data in languages Spanish to Basque.
34
- """
35
-
36
-
37
- _HOMEPAGE = "http://opus.nlpl.eu/Elhuyar.php"
38
-
39
-
40
- _LICENSE = ""
41
-
42
-
43
- _URLs = {"train": "https://object.pouta.csc.fi/OPUS-Elhuyar/v1/moses/es-eu.txt.zip"}
44
-
45
-
46
- class OpusElhuyar(datasets.GeneratorBasedBuilder):
47
- """TODO: Short description of my dataset."""
48
-
49
- VERSION = datasets.Version("1.0.0")
50
-
51
- BUILDER_CONFIGS = [datasets.BuilderConfig(name="es-eu", version=VERSION)]
52
-
53
- def _info(self):
54
- return datasets.DatasetInfo(
55
- description=_DESCRIPTION,
56
- features=datasets.Features(
57
- {"translation": datasets.features.Translation(languages=tuple(self.config.name.split("-")))}
58
- ),
59
- supervised_keys=None,
60
- homepage="http://opus.nlpl.eu/Elhuyar.php",
61
- citation=_CITATION,
62
- )
63
-
64
- def _split_generators(self, dl_manager):
65
- """Returns SplitGenerators."""
66
- data_dir = dl_manager.download_and_extract(_URLs)
67
- return [
68
- datasets.SplitGenerator(
69
- name=datasets.Split.TRAIN,
70
- # These kwargs will be passed to _generate_examples
71
- gen_kwargs={
72
- "source_file": os.path.join(data_dir["train"], "Elhuyar.es-eu.es"),
73
- "target_file": os.path.join(data_dir["train"], "Elhuyar.es-eu.eu"),
74
- "split": "train",
75
- },
76
- ),
77
- ]
78
-
79
- def _generate_examples(self, source_file, target_file, split):
80
- """This function returns the examples in the raw (text) form."""
81
- with open(source_file, encoding="utf-8") as f:
82
- source_sentences = f.read().split("\n")
83
- with open(target_file, encoding="utf-8") as f:
84
- target_sentences = f.read().split("\n")
85
-
86
- assert len(target_sentences) == len(source_sentences), "Sizes do not match: %d vs %d for %s vs %s." % (
87
- len(source_sentences),
88
- len(target_sentences),
89
- source_file,
90
- target_file,
91
- )
92
-
93
- source, target = tuple(self.config.name.split("-"))
94
- for idx, (l1, l2) in enumerate(zip(source_sentences, target_sentences)):
95
- result = {"translation": {source: l1, target: l2}}
96
- yield idx, result