Delete dataset_loader
Browse files- dataset_loader +0 -25
dataset_loader
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
from datasets import DatasetInfo, GeneratorBasedBuilder, SplitGenerator, Split, Features, Value
|
| 2 |
-
|
| 3 |
-
class RomanshGerman(GeneratorBasedBuilder):
|
| 4 |
-
def _info(self):
|
| 5 |
-
return DatasetInfo(
|
| 6 |
-
description="Best Matched Parallel Data",
|
| 7 |
-
features=Features({
|
| 8 |
-
"romansh_text": Value("string"),
|
| 9 |
-
"german_text": Value("string"),
|
| 10 |
-
"similarity": Value("float32"),
|
| 11 |
-
"original_similarity": Value("float32"),
|
| 12 |
-
}),
|
| 13 |
-
supervised_keys=None,
|
| 14 |
-
)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
def _split_generators(self, dl_manager):
|
| 18 |
-
data_path = dl_manager.download_and_extract("parallel_data/matched_0.60_0.005.jsonl")
|
| 19 |
-
return [SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": data_path})]
|
| 20 |
-
|
| 21 |
-
def _generate_examples(self, filepath):
|
| 22 |
-
import json
|
| 23 |
-
with open(filepath, encoding="utf-8") as f:
|
| 24 |
-
for idx, line in enumerate(f):
|
| 25 |
-
yield idx, json.loads(line)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|