Update gazeta.py
Browse files
gazeta.py
CHANGED
@@ -36,8 +36,7 @@ _CITATION = """
|
|
36 |
}
|
37 |
"""
|
38 |
|
39 |
-
_DESCRIPTION = """
|
40 |
-
Dataset for automatic summarization of Russian news
|
41 |
"""
|
42 |
|
43 |
_HOMEPAGE = "https://github.com/IlyaGusev/gazeta"
|
@@ -45,20 +44,20 @@ _HOMEPAGE = "https://github.com/IlyaGusev/gazeta"
|
|
45 |
_LICENSE = ""
|
46 |
|
47 |
_URLs = {
|
48 |
-
'
|
49 |
}
|
50 |
|
51 |
|
52 |
class GazetaDataset(datasets.GeneratorBasedBuilder):
|
53 |
"""Dataset for automatic summarization of Russian news"""
|
54 |
|
55 |
-
VERSION = datasets.Version("1.
|
56 |
|
57 |
BUILDER_CONFIGS = [
|
58 |
-
datasets.BuilderConfig(name="
|
59 |
]
|
60 |
|
61 |
-
DEFAULT_CONFIG_NAME = "
|
62 |
|
63 |
def _info(self):
|
64 |
features = datasets.Features(
|
@@ -81,18 +80,11 @@ class GazetaDataset(datasets.GeneratorBasedBuilder):
|
|
81 |
|
82 |
def _split_generators(self, dl_manager):
|
83 |
"""Returns SplitGenerators."""
|
84 |
-
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
85 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
86 |
-
|
87 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
|
88 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
89 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
90 |
my_urls = _URLs[self.config.name]
|
91 |
data_dir = dl_manager.download_and_extract(my_urls)
|
92 |
return [
|
93 |
datasets.SplitGenerator(
|
94 |
name=datasets.Split.TRAIN,
|
95 |
-
# These kwargs will be passed to _generate_examples
|
96 |
gen_kwargs={
|
97 |
"filepath": os.path.join(data_dir, "gazeta_train.jsonl"),
|
98 |
"split": "train",
|
@@ -100,7 +92,6 @@ class GazetaDataset(datasets.GeneratorBasedBuilder):
|
|
100 |
),
|
101 |
datasets.SplitGenerator(
|
102 |
name=datasets.Split.TEST,
|
103 |
-
# These kwargs will be passed to _generate_examples
|
104 |
gen_kwargs={
|
105 |
"filepath": os.path.join(data_dir, "gazeta_test.jsonl"),
|
106 |
"split": "test"
|
@@ -108,7 +99,6 @@ class GazetaDataset(datasets.GeneratorBasedBuilder):
|
|
108 |
),
|
109 |
datasets.SplitGenerator(
|
110 |
name=datasets.Split.VALIDATION,
|
111 |
-
# These kwargs will be passed to _generate_examples
|
112 |
gen_kwargs={
|
113 |
"filepath": os.path.join(data_dir, "gazeta_val.jsonl"),
|
114 |
"split": "dev",
|
|
|
36 |
}
|
37 |
"""
|
38 |
|
39 |
+
_DESCRIPTION = """\\nDataset for automatic summarization of Russian news
|
|
|
40 |
"""
|
41 |
|
42 |
_HOMEPAGE = "https://github.com/IlyaGusev/gazeta"
|
|
|
44 |
_LICENSE = ""
|
45 |
|
46 |
_URLs = {
|
47 |
+
'basic': "https://github.com/IlyaGusev/gazeta/releases/download/1.0/gazeta_jsonl.tar.gz",
|
48 |
}
|
49 |
|
50 |
|
51 |
class GazetaDataset(datasets.GeneratorBasedBuilder):
|
52 |
"""Dataset for automatic summarization of Russian news"""
|
53 |
|
54 |
+
VERSION = datasets.Version("1.0")
|
55 |
|
56 |
BUILDER_CONFIGS = [
|
57 |
+
datasets.BuilderConfig(name="basic", version=VERSION, description=""),
|
58 |
]
|
59 |
|
60 |
+
DEFAULT_CONFIG_NAME = "basic"
|
61 |
|
62 |
def _info(self):
|
63 |
features = datasets.Features(
|
|
|
80 |
|
81 |
def _split_generators(self, dl_manager):
|
82 |
"""Returns SplitGenerators."""
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
my_urls = _URLs[self.config.name]
|
84 |
data_dir = dl_manager.download_and_extract(my_urls)
|
85 |
return [
|
86 |
datasets.SplitGenerator(
|
87 |
name=datasets.Split.TRAIN,
|
|
|
88 |
gen_kwargs={
|
89 |
"filepath": os.path.join(data_dir, "gazeta_train.jsonl"),
|
90 |
"split": "train",
|
|
|
92 |
),
|
93 |
datasets.SplitGenerator(
|
94 |
name=datasets.Split.TEST,
|
|
|
95 |
gen_kwargs={
|
96 |
"filepath": os.path.join(data_dir, "gazeta_test.jsonl"),
|
97 |
"split": "test"
|
|
|
99 |
),
|
100 |
datasets.SplitGenerator(
|
101 |
name=datasets.Split.VALIDATION,
|
|
|
102 |
gen_kwargs={
|
103 |
"filepath": os.path.join(data_dir, "gazeta_val.jsonl"),
|
104 |
"split": "dev",
|