Datasets:

Modalities:
Text
Formats:
parquet
Libraries:
Datasets
pandas
License:
albertvillanova HF staff commited on
Commit
ac9fb28
1 Parent(s): 8725ff0

Convert dataset to Parquet (#2)

Browse files

- Convert dataset to Parquet (cfdad5384780fb29b6dd70b943c4c06466609bd7)
- Delete loading script (a50cff57cb2fdef92846bd6e617e4db16e2486e4)

Files changed (3) hide show
  1. README.md +10 -5
  2. es-eu/train-00000-of-00001.parquet +3 -0
  3. opus_elhuyar.py +0 -96
README.md CHANGED
@@ -17,9 +17,9 @@ source_datasets:
17
  task_categories:
18
  - translation
19
  task_ids: []
20
- paperswithcode_id: null
21
  pretty_name: OpusElhuyar
22
  dataset_info:
 
23
  features:
24
  - name: translation
25
  dtype:
@@ -27,13 +27,18 @@ dataset_info:
27
  languages:
28
  - es
29
  - eu
30
- config_name: es-eu
31
  splits:
32
  - name: train
33
- num_bytes: 127833939
34
  num_examples: 642348
35
- download_size: 44468751
36
- dataset_size: 127833939
 
 
 
 
 
 
37
  ---
38
 
39
  # Dataset Card for [opus_elhuyar]
 
17
  task_categories:
18
  - translation
19
  task_ids: []
 
20
  pretty_name: OpusElhuyar
21
  dataset_info:
22
+ config_name: es-eu
23
  features:
24
  - name: translation
25
  dtype:
 
27
  languages:
28
  - es
29
  - eu
 
30
  splits:
31
  - name: train
32
+ num_bytes: 127833419
33
  num_examples: 642348
34
+ download_size: 74270872
35
+ dataset_size: 127833419
36
+ configs:
37
+ - config_name: es-eu
38
+ data_files:
39
+ - split: train
40
+ path: es-eu/train-*
41
+ default: true
42
  ---
43
 
44
  # Dataset Card for [opus_elhuyar]
es-eu/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:911fb9c17dd8f7db612ae9ef11e55c9f74582c1eebd8f8c7a7520a3322c30f28
3
+ size 74270872
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