Datasets:
Tasks:
Text Generation
Size:
10K - 100K
Commit
•
9e8b8ca
1
Parent(s):
2b65a1d
Update parquet files
Browse files- habr.jsonl.zst → IlyaGusev--habr_ru/json-train-00000-of-00008.parquet +2 -2
- IlyaGusev--habr_ru/json-train-00001-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00002-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00003-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00004-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00005-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00006-of-00008.parquet +3 -0
- IlyaGusev--habr_ru/json-train-00007-of-00008.parquet +3 -0
- README.md +0 -44
- habr.py +0 -93
habr.jsonl.zst → IlyaGusev--habr_ru/json-train-00000-of-00008.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfbae84674007b43461500cb659ff473c18e7ac96d03382a8262645495ffdb39
|
3 |
+
size 246016435
|
IlyaGusev--habr_ru/json-train-00001-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3595c708f464626d83e4dd064a539bbd021e56ac0a9429d4bde6ef87e28f6691
|
3 |
+
size 245815795
|
IlyaGusev--habr_ru/json-train-00002-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e8612e8bbbfaca33ab1679322bddb9696116bfbf0020994926c523108650f562
|
3 |
+
size 245880018
|
IlyaGusev--habr_ru/json-train-00003-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2c44d093bc69452a0c7627453d0ec1d13e724a3369d93e800c16cb5aedd6c20b
|
3 |
+
size 245652796
|
IlyaGusev--habr_ru/json-train-00004-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8e7010ca91c48757cc6910cbaf7d39d9f140af4c83b10efbd04b8b1d36bc438a
|
3 |
+
size 245902072
|
IlyaGusev--habr_ru/json-train-00005-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be7c0b26935cf025e4d35da0065558c0535440cef43544d1c3c263a1e0cd9660
|
3 |
+
size 246265393
|
IlyaGusev--habr_ru/json-train-00006-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aa4c2dc148e47420434525f1c52c8c3b1a7fa258c037eb83505d75fb676bdac3
|
3 |
+
size 245824977
|
IlyaGusev--habr_ru/json-train-00007-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:21abe66a49c077e467d8801748b073b2b87d0cb7b27da2abf0930818ca16e65d
|
3 |
+
size 102454883
|
README.md
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
---
|
2 |
-
dataset_info:
|
3 |
-
features:
|
4 |
-
- name: text
|
5 |
-
dtype: string
|
6 |
-
- name: meta
|
7 |
-
struct:
|
8 |
-
- name: id
|
9 |
-
dtype: uint32
|
10 |
-
- name: time_published
|
11 |
-
dtype: uint64
|
12 |
-
- name: title
|
13 |
-
dtype: string
|
14 |
-
- name: author
|
15 |
-
dtype: string
|
16 |
-
- name: statistics
|
17 |
-
struct:
|
18 |
-
- name: commentsCount
|
19 |
-
dtype: uint32
|
20 |
-
- name: favoritesCount
|
21 |
-
dtype: uint32
|
22 |
-
- name: readingCount
|
23 |
-
dtype: uint32
|
24 |
-
- name: score
|
25 |
-
dtype: int32
|
26 |
-
- name: votesCount
|
27 |
-
dtype: int32
|
28 |
-
- name: votesCountPlus
|
29 |
-
dtype: int32
|
30 |
-
- name: votesCountMinus
|
31 |
-
dtype: int32
|
32 |
-
splits:
|
33 |
-
- name: train
|
34 |
-
num_bytes: 3734746780
|
35 |
-
num_examples: 296802
|
36 |
-
download_size: 1084715944
|
37 |
-
dataset_size: 3734746780
|
38 |
-
task_categories:
|
39 |
-
- text-generation
|
40 |
-
language:
|
41 |
-
- ru
|
42 |
-
---
|
43 |
-
|
44 |
-
# Habrahabr dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
habr.py
DELETED
@@ -1,93 +0,0 @@
|
|
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 |
-
"""Habrahabr dataset"""
|
18 |
-
|
19 |
-
import os
|
20 |
-
import io
|
21 |
-
|
22 |
-
import zstandard
|
23 |
-
import jsonlines
|
24 |
-
import datasets
|
25 |
-
|
26 |
-
try:
|
27 |
-
import simdjson
|
28 |
-
parser = simdjson.Parser()
|
29 |
-
def parse_json(x):
|
30 |
-
try:
|
31 |
-
return parser.parse(x).as_dict()
|
32 |
-
except ValueError:
|
33 |
-
return
|
34 |
-
except ImportError:
|
35 |
-
import json
|
36 |
-
def parse_json(x):
|
37 |
-
return json.loads(x)
|
38 |
-
|
39 |
-
|
40 |
-
_DESCRIPTION = "Habrahabr dataset"
|
41 |
-
_URL = "habr.jsonl.zst"
|
42 |
-
|
43 |
-
|
44 |
-
class RuLMDataset(datasets.GeneratorBasedBuilder):
|
45 |
-
"""Habrahabr dataset"""
|
46 |
-
|
47 |
-
VERSION = datasets.Version("0.0.1")
|
48 |
-
|
49 |
-
BUILDER_CONFIGS = [
|
50 |
-
datasets.BuilderConfig(name="default", version=VERSION, description=""),
|
51 |
-
]
|
52 |
-
|
53 |
-
DEFAULT_CONFIG_NAME = "default"
|
54 |
-
|
55 |
-
def _info(self):
|
56 |
-
features = datasets.Features(
|
57 |
-
{
|
58 |
-
"text": datasets.Value("string"),
|
59 |
-
"meta": {
|
60 |
-
"id": datasets.Value("uint32"),
|
61 |
-
"time_published": datasets.Value("uint64"),
|
62 |
-
"title": datasets.Value("string"),
|
63 |
-
"author": datasets.Value("string"),
|
64 |
-
"statistics": {
|
65 |
-
"commentsCount": datasets.Value("uint32"),
|
66 |
-
"favoritesCount": datasets.Value("uint32"),
|
67 |
-
"readingCount": datasets.Value("uint32"),
|
68 |
-
"score": datasets.Value("int32"),
|
69 |
-
"votesCount": datasets.Value("int32"),
|
70 |
-
"votesCountPlus": datasets.Value("int32"),
|
71 |
-
"votesCountMinus": datasets.Value("int32")
|
72 |
-
}
|
73 |
-
}
|
74 |
-
}
|
75 |
-
)
|
76 |
-
return datasets.DatasetInfo(
|
77 |
-
description=_DESCRIPTION,
|
78 |
-
features=features
|
79 |
-
)
|
80 |
-
|
81 |
-
def _split_generators(self, dl_manager):
|
82 |
-
downloaded_file = dl_manager.download(_URL)
|
83 |
-
return [
|
84 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": downloaded_file}),
|
85 |
-
]
|
86 |
-
|
87 |
-
def _generate_examples(self, path):
|
88 |
-
with open(path, "rb") as f:
|
89 |
-
cctx = zstandard.ZstdDecompressor()
|
90 |
-
reader_stream = io.BufferedReader(cctx.stream_reader(f))
|
91 |
-
reader = jsonlines.Reader(reader_stream, loads=parse_json)
|
92 |
-
for id_, item in enumerate(reader):
|
93 |
-
yield id_, {"text": item["text"], "meta": item["meta"]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|