Delete loading script
Browse files- mlnoisy.py +0 -83
mlnoisy.py
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
"""ml.sftwrs x RobotsMaliAI4D: mlgram dataset"""
|
2 |
-
|
3 |
-
import os
|
4 |
-
import json
|
5 |
-
import datasets
|
6 |
-
from datasets import load_dataset, DatasetBuilder
|
7 |
-
|
8 |
-
|
9 |
-
_CITATION = """\n
|
10 |
-
@misc{diarra2025mldatxnoisy,
|
11 |
-
title={Malian Noisy Dataset for LLM Training},
|
12 |
-
author={
|
13 |
-
Sebastien Diarra and
|
14 |
-
Nene Tangara and
|
15 |
-
Seydou Diallo
|
16 |
-
},
|
17 |
-
url={https://mlsftwrs.ml/project/mldatx},
|
18 |
-
year={2025}
|
19 |
-
}
|
20 |
-
"""
|
21 |
-
|
22 |
-
_DESCRIPTION = """
|
23 |
-
ml.Datx Noisy Dataset is a noise based dataset of 6 Malian Languages
|
24 |
-
"""
|
25 |
-
DATA_FILES = {
|
26 |
-
"bam": "bam_output.json",
|
27 |
-
"boz": "boz_output.json",
|
28 |
-
"bom": "bom_output.json",
|
29 |
-
"myk": "myk_output.json",
|
30 |
-
"sgh": "sgh_output.json",
|
31 |
-
"snk": "snk_output.json"
|
32 |
-
}
|
33 |
-
class MlDatxNoisy(datasets.GeneratorBasedBuilder):
|
34 |
-
""" ml.Datx Noisy Dataset """
|
35 |
-
|
36 |
-
VERSION = datasets.Version("0.0.1")
|
37 |
-
|
38 |
-
def _info(self):
|
39 |
-
return datasets.DatasetInfo(
|
40 |
-
description=_DESCRIPTION,
|
41 |
-
features=datasets.Features(
|
42 |
-
{
|
43 |
-
"original": datasets.Value("string"),
|
44 |
-
"cleaned": datasets.Value("string"),
|
45 |
-
"space_insertion": datasets.Value("string"),
|
46 |
-
"char_delete": datasets.Value("string"),
|
47 |
-
"char_swap": datasets.Value("string"),
|
48 |
-
"word_swap": datasets.Value("string"),
|
49 |
-
"word_delete": datasets.Value("string"),
|
50 |
-
"word_blank": datasets.Value("string"),
|
51 |
-
}
|
52 |
-
),
|
53 |
-
citation=_CITATION,
|
54 |
-
supervised_keys=None,
|
55 |
-
homepage="https://mlsftwrs.ml/project/mldatx"
|
56 |
-
)
|
57 |
-
|
58 |
-
def _split_generators(self, dl_manager):
|
59 |
-
data_dir = "data"
|
60 |
-
return [
|
61 |
-
datasets.SplitGenerator(
|
62 |
-
name=i,
|
63 |
-
gen_kwargs={
|
64 |
-
"file_path": os.path.join(data_dir, DATA_FILES[i]),
|
65 |
-
"split": i
|
66 |
-
}) for i in DATA_FILES
|
67 |
-
]
|
68 |
-
|
69 |
-
def _generate_examples(self, file_path, split):
|
70 |
-
with open(file_path, "r") as file:
|
71 |
-
data = json.load(file)
|
72 |
-
|
73 |
-
for id_, example in enumerate(data):
|
74 |
-
yield id_, {
|
75 |
-
"original": example["original"],
|
76 |
-
"cleaned": example["cleaned"],
|
77 |
-
"space_insertion": example["space_insertion"],
|
78 |
-
"char_delete": example["char_delete"],
|
79 |
-
"char_swap": example["char_swap"],
|
80 |
-
"word_swap": example["word_swap"],
|
81 |
-
"word_delete": example["word_delete"],
|
82 |
-
"word_blank": example["word_blank"]
|
83 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|