IlyaGusev commited on
Commit
72fbc09
1 Parent(s): 55ff174

Initial commit

Browse files
.gitattributes CHANGED
@@ -52,3 +52,23 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
52
  *.jpg filter=lfs diff=lfs merge=lfs -text
53
  *.jpeg filter=lfs diff=lfs merge=lfs -text
54
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  *.jpg filter=lfs diff=lfs merge=lfs -text
53
  *.jpeg filter=lfs diff=lfs merge=lfs -text
54
  *.webp filter=lfs diff=lfs merge=lfs -text
55
+ 01.jsonl.zst filter=lfs diff=lfs merge=lfs -text
56
+ 04.jsonl.zst filter=lfs diff=lfs merge=lfs -text
57
+ 06.jsonl.zst filter=lfs diff=lfs merge=lfs -text
58
+ 13.jsonl.zst filter=lfs diff=lfs merge=lfs -text
59
+ 02.jsonl.zst filter=lfs diff=lfs merge=lfs -text
60
+ 03.jsonl.zst filter=lfs diff=lfs merge=lfs -text
61
+ 05.jsonl.zst filter=lfs diff=lfs merge=lfs -text
62
+ 11.jsonl.zst filter=lfs diff=lfs merge=lfs -text
63
+ 16.jsonl.zst filter=lfs diff=lfs merge=lfs -text
64
+ 19.jsonl.zst filter=lfs diff=lfs merge=lfs -text
65
+ 00.jsonl.zst filter=lfs diff=lfs merge=lfs -text
66
+ 07.jsonl.zst filter=lfs diff=lfs merge=lfs -text
67
+ 08.jsonl.zst filter=lfs diff=lfs merge=lfs -text
68
+ 09.jsonl.zst filter=lfs diff=lfs merge=lfs -text
69
+ 10.jsonl.zst filter=lfs diff=lfs merge=lfs -text
70
+ 12.jsonl.zst filter=lfs diff=lfs merge=lfs -text
71
+ 14.jsonl.zst filter=lfs diff=lfs merge=lfs -text
72
+ 15.jsonl.zst filter=lfs diff=lfs merge=lfs -text
73
+ 17.jsonl.zst filter=lfs diff=lfs merge=lfs -text
74
+ 18.jsonl.zst filter=lfs diff=lfs merge=lfs -text
00.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b74aef83756777cfef349eb2d4c8bf7d211cd52311d1b1d44d09c9e7cbe3a61
3
+ size 1749388679
01.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f67ae220d496d83cd2846392972b8137944dfba50e80226c14c849c0370b25a
3
+ size 1739550336
02.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c08e053810bb90a3c63901bab07a96e039b4e1c3fe45dcbb1f2ac0c712871400
3
+ size 1745526313
03.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:163a863b6f768a8c9eff39579daf6dd96f684c61fdceb79bd720ebecd0f44591
3
+ size 1734907316
04.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64ea557cab6094f8885f50e6c97c4d2faa0de6d2b98c7320608a2eb349cb214b
3
+ size 1763440231
05.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53c76e809fe6ef8c9f9b600b0ba91746da4d5823d6bcc053e7fb60a757c7f146
3
+ size 1736544016
06.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8819a3372ace174fbc0a91614001403a7b78cc926b748c580aace4ca783209e0
3
+ size 1747473816
07.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af6d521853264ba9d8f542a8b348cc03b4f9087649edc0f7b14be007b0e530af
3
+ size 1752111864
08.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ad121e3a40cd5ac19796d26456b952795960937e0016757427da92fec46d36a
3
+ size 1748180374
09.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63a623d0ab074927ff3c9a4f324fa97c3b3636a4b008f8df4c3688f7f5cf08f9
3
+ size 1755338385
10.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d545f460cb57c31032a9db9c62ef6b0f04911df0b0d28c5f8388096446e91cb
3
+ size 1752252283
11.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce504a7ed63c31ed53bce42c775b36f66ff8d6f38765743c9e7e252a6aaeef8b
3
+ size 1758828238
12.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05f28e50e3f394a272c21d9bce088aa15920458796f7c7f72d75e43a2cfe8112
3
+ size 1749467099
13.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7130acb4ee4680b862f8ea8d3349e69b9f693c3af6f4503882380193ef7ddef8
3
+ size 1743541964
14.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3531eefc4cdc2ee0621496f8e610a06ac1130510600805f66e95c4a28e2e1ee
3
+ size 1732202751
15.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4053cd567f64b3f66d9253246b6d32714ba04d0699d5f0adcd29cddf69f1f18
3
+ size 1733341096
16.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:328339ae0addc142ed13fc1cd9a9b67e8e089053cc686d4374ce9e27dde810be
3
+ size 1741215455
17.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63c0c6809d585cf77507e998199604b0a47f6b5197633dd84cdc1d620bf0117d
3
+ size 1741210993
18.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:457faf393887a3253d5b9c72daa65250e26fc2ad4c96170ee1245af905c7ba11
3
+ size 1735878356
19.jsonl.zst ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:872b1d8d70bfe01215b5013aadfbfe711c5ae4b10c726c04969f0b4242827ecc
3
+ size 1744999583
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: id
5
+ dtype: uint64
6
+ - name: text
7
+ dtype: string
8
+ splits:
9
+ - name: train
10
+ num_bytes: 125126513109
11
+ num_examples: 223256
12
+ download_size: 34905399148
13
+ dataset_size: 125126513109
14
+ ---
librusec.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2023 The HuggingFace Datasets Authors and Ilya Gusev
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
+
16
+ # Lint as: python3
17
+ import os
18
+ import io
19
+
20
+ import zstandard
21
+ import jsonlines
22
+ import datasets
23
+
24
+ try:
25
+ import simdjson
26
+ parser = simdjson.Parser()
27
+ def parse_json(x):
28
+ try:
29
+ return parser.parse(x).as_dict()
30
+ except ValueError:
31
+ return
32
+ except ImportError:
33
+ import json
34
+ def parse_json(x):
35
+ return json.loads(x)
36
+
37
+ _DESCRIPTION = "Librusec dataset"
38
+ _TRAIN_SPLITS = 20
39
+ _URLS = ["{}.jsonl.zst".format(str(i).zfill(2)) for i in range(_TRAIN_SPLITS)]
40
+
41
+
42
+ class LibrusecDataset(datasets.GeneratorBasedBuilder):
43
+ VERSION = datasets.Version("0.0.1")
44
+
45
+ BUILDER_CONFIGS = [
46
+ datasets.BuilderConfig(name="default", version=VERSION, description=""),
47
+ ]
48
+
49
+ DEFAULT_CONFIG_NAME = "default"
50
+
51
+ def _info(self):
52
+ features = datasets.Features(
53
+ {
54
+ "id": datasets.Value("uint64"),
55
+ "text": datasets.Value("string"),
56
+ }
57
+ )
58
+ return datasets.DatasetInfo(
59
+ description=_DESCRIPTION,
60
+ features=features
61
+ )
62
+
63
+ def _split_generators(self, dl_manager):
64
+ downloaded_files = dl_manager.download(_URLS)
65
+ return [
66
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"paths": downloaded_files}),
67
+ ]
68
+
69
+ def _generate_examples(self, paths):
70
+ for path in paths:
71
+ with open(path, "rb") as f:
72
+ cctx = zstandard.ZstdDecompressor()
73
+ reader_stream = io.BufferedReader(cctx.stream_reader(f))
74
+ reader = jsonlines.Reader(reader_stream, loads=parse_json)
75
+ for id_, item in enumerate(reader):
76
+ yield id_, item