Datasets:
Commit
•
68dfc14
1
Parent(s):
b198fc3
Convert dataset to Parquet (#2)
Browse files- Convert dataset to Parquet (b512ea6393f2f27f3189f2d1313c769b04472065)
- Delete loading script (c848ab906ba2b484f47fa1e3d83c2d4e2f2f5402)
README.md
CHANGED
@@ -19,9 +19,9 @@ task_categories:
|
|
19 |
task_ids:
|
20 |
- language-modeling
|
21 |
- masked-language-modeling
|
22 |
-
paperswithcode_id: null
|
23 |
pretty_name: Indonesian Newspapers 2018
|
24 |
dataset_info:
|
|
|
25 |
features:
|
26 |
- name: id
|
27 |
dtype: string
|
@@ -33,13 +33,18 @@ dataset_info:
|
|
33 |
dtype: string
|
34 |
- name: content
|
35 |
dtype: string
|
36 |
-
config_name: id_newspapers_2018
|
37 |
splits:
|
38 |
- name: train
|
39 |
-
num_bytes:
|
40 |
num_examples: 499164
|
41 |
-
download_size:
|
42 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
---
|
44 |
|
45 |
# Dataset Card for Indonesian Newspapers 2018
|
|
|
19 |
task_ids:
|
20 |
- language-modeling
|
21 |
- masked-language-modeling
|
|
|
22 |
pretty_name: Indonesian Newspapers 2018
|
23 |
dataset_info:
|
24 |
+
config_name: id_newspapers_2018
|
25 |
features:
|
26 |
- name: id
|
27 |
dtype: string
|
|
|
33 |
dtype: string
|
34 |
- name: content
|
35 |
dtype: string
|
|
|
36 |
splits:
|
37 |
- name: train
|
38 |
+
num_bytes: 1160553070
|
39 |
num_examples: 499164
|
40 |
+
download_size: 647992433
|
41 |
+
dataset_size: 1160553070
|
42 |
+
configs:
|
43 |
+
- config_name: id_newspapers_2018
|
44 |
+
data_files:
|
45 |
+
- split: train
|
46 |
+
path: id_newspapers_2018/train-*
|
47 |
+
default: true
|
48 |
---
|
49 |
|
50 |
# Dataset Card for Indonesian Newspapers 2018
|
id_newspapers_2018.py
DELETED
@@ -1,115 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
-
"""Indonesian Newspapers 2018"""
|
16 |
-
|
17 |
-
|
18 |
-
import json
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
logger = datasets.logging.get_logger(__name__)
|
24 |
-
|
25 |
-
|
26 |
-
_CITATION = """\
|
27 |
-
@inproceedings{id_newspapers_2018,
|
28 |
-
author = {},
|
29 |
-
title = {Indonesian Newspapers 2018},
|
30 |
-
year = {2019},
|
31 |
-
url = {https://github.com/feryandi/Dataset-Artikel},
|
32 |
-
}
|
33 |
-
"""
|
34 |
-
|
35 |
-
_DESCRIPTION = """\
|
36 |
-
The dataset contains around 500K articles (136M of words) from 7 Indonesian newspapers: Detik, Kompas, Tempo,
|
37 |
-
CNN Indonesia, Sindo, Republika and Poskota. The articles are dated between 1st January 2018 and 20th August 2018
|
38 |
-
(with few exceptions dated earlier). The size of uncompressed 500K json files (newspapers-json.tgz) is around 2.2GB,
|
39 |
-
and the cleaned uncompressed in a big text file (newspapers.txt.gz) is about 1GB. The original source in Google Drive
|
40 |
-
contains also a dataset in html format which include raw data (pictures, css, javascript, ...)
|
41 |
-
from the online news website
|
42 |
-
"""
|
43 |
-
|
44 |
-
_HOMEPAGE = "https://github.com/feryandi/Dataset-Artikel"
|
45 |
-
|
46 |
-
_LICENSE = "Creative Commons Attribution-ShareAlike 4.0 International Public License"
|
47 |
-
|
48 |
-
_URL = "http://cloud.uncool.ai/index.php/s/kF83dQHfGeS2LX2/download"
|
49 |
-
|
50 |
-
|
51 |
-
class IdNewspapers2018Config(datasets.BuilderConfig):
|
52 |
-
"""BuilderConfig for IdNewspapers2018"""
|
53 |
-
|
54 |
-
def __init__(self, **kwargs):
|
55 |
-
"""BuilderConfig for IdNewspapers2018.
|
56 |
-
Args:
|
57 |
-
**kwargs: keyword arguments forwarded to super.
|
58 |
-
"""
|
59 |
-
super(IdNewspapers2018Config, self).__init__(**kwargs)
|
60 |
-
|
61 |
-
|
62 |
-
class IdNewspapers2018(datasets.GeneratorBasedBuilder):
|
63 |
-
VERSION = datasets.Version("1.0.0")
|
64 |
-
|
65 |
-
BUILDER_CONFIGS = [
|
66 |
-
IdNewspapers2018Config(
|
67 |
-
name="id_newspapers_2018",
|
68 |
-
version=VERSION,
|
69 |
-
description="IdNewspapers2018 dataset",
|
70 |
-
),
|
71 |
-
]
|
72 |
-
|
73 |
-
def _info(self):
|
74 |
-
features = datasets.Features(
|
75 |
-
{
|
76 |
-
"id": datasets.Value("string"),
|
77 |
-
"url": datasets.Value("string"),
|
78 |
-
"date": datasets.Value("string"),
|
79 |
-
"title": datasets.Value("string"),
|
80 |
-
"content": datasets.Value("string"),
|
81 |
-
}
|
82 |
-
)
|
83 |
-
return datasets.DatasetInfo(
|
84 |
-
description=_DESCRIPTION,
|
85 |
-
features=features,
|
86 |
-
supervised_keys=None,
|
87 |
-
homepage=_HOMEPAGE,
|
88 |
-
license=_LICENSE,
|
89 |
-
citation=_CITATION,
|
90 |
-
)
|
91 |
-
|
92 |
-
def _split_generators(self, dl_manager):
|
93 |
-
archive = dl_manager.download(_URL)
|
94 |
-
return [
|
95 |
-
datasets.SplitGenerator(
|
96 |
-
name=datasets.Split.TRAIN,
|
97 |
-
gen_kwargs={
|
98 |
-
"files": dl_manager.iter_archive(archive),
|
99 |
-
},
|
100 |
-
)
|
101 |
-
]
|
102 |
-
|
103 |
-
def _generate_examples(self, files):
|
104 |
-
id = 0
|
105 |
-
for path, f in files:
|
106 |
-
if path.startswith("newspapers") and path.endswith(".json"):
|
107 |
-
data = json.loads(f.read().decode("utf-8"))
|
108 |
-
yield id, {
|
109 |
-
"id": str(id),
|
110 |
-
"url": data["url"],
|
111 |
-
"date": data["date"],
|
112 |
-
"title": data["title"],
|
113 |
-
"content": data["content"],
|
114 |
-
}
|
115 |
-
id += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
id_newspapers_2018/train-00000-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8c558af5e81458790ceb7747640a53d012eb49750d85ea764d1491300a40e68b
|
3 |
+
size 213632186
|
id_newspapers_2018/train-00001-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fb98c69c9c0d166087329eaea62b6f517851cdad372b9431932c20df690c45fd
|
3 |
+
size 216256471
|
id_newspapers_2018/train-00002-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0f8a5ac189faffde3527a9794f01b91ec80a2d28a12422702ea4aefc0df18abd
|
3 |
+
size 218103776
|