File size: 1,164 Bytes
8e33ca0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""resh.edu.ru lessons dataset"""


import json

import datasets

_DESCRIPTION = """\
This is a dataset of lessons and tests scraped from resh.edu.ru
"""

_HOMEPAGE = "https://huggingface.co./datasets/its5Q/resh-edu"

_LICENSE = "cc0-1.0"

_URLS = [
    "https://huggingface.co./datasets/its5Q/resh-edu/resolve/main/raw.jsonl.gz"
]


class ReshEdu(datasets.GeneratorBasedBuilder):
    VERSION = datasets.Version("0.1.0")

    def _info(self):
        return datasets.DatasetInfo(
            description=_DESCRIPTION,
            homepage=_HOMEPAGE,
            license=_LICENSE
        )

    def _split_generators(self, dl_manager):
        data_dir = dl_manager.download_and_extract(_URLS)
        return [
            datasets.SplitGenerator(
                name=datasets.Split.TRAIN,
                gen_kwargs={
                    "filepath": data_dir[0],
                    "split": "train",
                },
            )
        ]

    def _generate_examples(self, filepath, split):
        with open(filepath, 'r', encoding="utf-8") as f:
            for i, line in enumerate(f):
                data = json.loads(line)
                yield i, data