IlyaGusev commited on
Commit
ebdb8f6
1 Parent(s): 5acd3b4
Files changed (2) hide show
  1. dataset_infos.json +1 -1
  2. gazeta.py +9 -29
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"github.com": {"description": "Dataset for automatic summarization of Russian news\n", "citation": "\n@InProceedings{10.1007/978-3-030-59082-6_9,\n author=\"Gusev, Ilya\",\n editor=\"Filchenkov, Andrey and Kauttonen, Janne and Pivovarova, Lidia\",\n title=\"Dataset for Automatic Summarization of Russian News\",\n booktitle=\"Artificial Intelligence and Natural Language\",\n year=\"2020\",\n publisher=\"Springer International Publishing\",\n address=\"Cham\",\n pages=\"122--134\",\n isbn=\"978-3-030-59082-6\"\n}\n", "homepage": "https://github.com/IlyaGusev/gazeta", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "summary": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "date": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "gazeta_dataset", "config_name": "github.com", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 468510447, "num_examples": 52400, "dataset_name": "gazeta_dataset"}, "test": {"name": "test", "num_bytes": 51888697, "num_examples": 5770, "dataset_name": "gazeta_dataset"}, "validation": {"name": "validation", "num_bytes": 48394731, "num_examples": 5265, "dataset_name": "gazeta_dataset"}}, "download_checksums": {"https://github.com/IlyaGusev/gazeta/releases/download/0.1/gazeta_jsonl.tar.gz": {"num_bytes": 158907783, "checksum": "43787350a7690803f6a50b99976c1884abf2d3a0246cea2a68e394b2b7d7fa66"}}, "download_size": 158907783, "post_processing_size": null, "dataset_size": 568793875, "size_in_bytes": 727701658}}
 
1
+ {"github.com": {"description": "Dataset for automatic summarization of Russian news\n", "citation": "\n@InProceedings{10.1007/978-3-030-59082-6_9,\n author=\"Gusev, Ilya\",\n editor=\"Filchenkov, Andrey and Kauttonen, Janne and Pivovarova, Lidia\",\n title=\"Dataset for Automatic Summarization of Russian News\",\n booktitle=\"Artificial Intelligence and Natural Language\",\n year=\"2020\",\n publisher=\"Springer International Publishing\",\n address=\"Cham\",\n pages=\"122--134\",\n isbn=\"978-3-030-59082-6\"\n}\n", "homepage": "https://github.com/IlyaGusev/gazeta", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "summary": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "date": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "gazeta_dataset", "config_name": "github.com", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 468510447, "num_examples": 52400, "dataset_name": "gazeta_dataset"}, "test": {"name": "test", "num_bytes": 51888697, "num_examples": 5770, "dataset_name": "gazeta_dataset"}, "validation": {"name": "validation", "num_bytes": 48394731, "num_examples": 5265, "dataset_name": "gazeta_dataset"}}, "download_checksums": {"https://github.com/IlyaGusev/gazeta/releases/download/0.1/gazeta_jsonl.tar.gz": {"num_bytes": 158907783, "checksum": "43787350a7690803f6a50b99976c1884abf2d3a0246cea2a68e394b2b7d7fa66"}}, "download_size": 158907783, "post_processing_size": null, "dataset_size": 568793875, "size_in_bytes": 727701658}, "default": {"description": "Dataset for automatic summarization of Russian news", "citation": "\n@InProceedings{10.1007/978-3-030-59082-6_9,\n author=\"Gusev, Ilya\",\n editor=\"Filchenkov, Andrey and Kauttonen, Janne and Pivovarova, Lidia\",\n title=\"Dataset for Automatic Summarization of Russian News\",\n booktitle=\"Artificial Intelligence and Natural Language\",\n year=\"2020\",\n publisher=\"Springer International Publishing\",\n address=\"Cham\",\n pages=\"122--134\",\n isbn=\"978-3-030-59082-6\"\n}\n", "homepage": "https://github.com/IlyaGusev/gazeta", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "summary": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "date": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "text", "output": "summary"}, "task_templates": null, "builder_name": "gazeta_dataset", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 468510447, "num_examples": 52400, "dataset_name": "gazeta_dataset"}, "test": {"name": "test", "num_bytes": 51888697, "num_examples": 5770, "dataset_name": "gazeta_dataset"}, "validation": {"name": "validation", "num_bytes": 48394731, "num_examples": 5265, "dataset_name": "gazeta_dataset"}}, "download_checksums": {"gazeta_train.jsonl": {"num_bytes": 470816510, "checksum": "32a9bd05e2f0aa0ff8bfac4e4c945e03dbf82d61fd36a47ad9894c84d8a6f8ee"}, "gazeta_val.jsonl": {"num_bytes": 48626461, "checksum": "415c466f0f1a38bffc575b8af01d735049ab7194f18737646d09a9faf960569e"}, "gazeta_test.jsonl": {"num_bytes": 52142626, "checksum": "a1b18970198cfa88d2f956c98787062028c5dc72456b62578fc72c4b7ec52d9d"}}, "download_size": 571585597, "post_processing_size": null, "dataset_size": 568793875, "size_in_bytes": 1140379472}}
gazeta.py CHANGED
@@ -39,8 +39,10 @@ _DESCRIPTION = "Dataset for automatic summarization of Russian news"
39
 
40
  _HOMEPAGE = "https://github.com/IlyaGusev/gazeta"
41
 
42
- _URLs = {
43
- "default": "https://github.com/IlyaGusev/gazeta/releases/download/1.0/gazeta_jsonl.tar.gz",
 
 
44
  }
45
 
46
  _DOCUMENT = "text"
@@ -77,36 +79,14 @@ class GazetaDataset(datasets.GeneratorBasedBuilder):
77
  )
78
 
79
  def _split_generators(self, dl_manager):
80
- """Returns SplitGenerators."""
81
- my_urls = _URLs[self.config.name]
82
- data_dir = dl_manager.download_and_extract(my_urls)
83
  return [
84
- datasets.SplitGenerator(
85
- name=datasets.Split.TRAIN,
86
- gen_kwargs={
87
- "filepath": os.path.join(data_dir, "gazeta_train.jsonl"),
88
- "split": "train",
89
- },
90
- ),
91
- datasets.SplitGenerator(
92
- name=datasets.Split.TEST,
93
- gen_kwargs={
94
- "filepath": os.path.join(data_dir, "gazeta_test.jsonl"),
95
- "split": "test"
96
- },
97
- ),
98
- datasets.SplitGenerator(
99
- name=datasets.Split.VALIDATION,
100
- gen_kwargs={
101
- "filepath": os.path.join(data_dir, "gazeta_val.jsonl"),
102
- "split": "dev",
103
- },
104
- ),
105
  ]
106
 
107
- def _generate_examples(
108
- self, filepath, split
109
- ):
110
  with open(filepath, encoding="utf-8") as f:
111
  for id_, row in enumerate(f):
112
  data = json.loads(row)
 
39
 
40
  _HOMEPAGE = "https://github.com/IlyaGusev/gazeta"
41
 
42
+ _URLS = {
43
+ "train": "gazeta_train.jsonl",
44
+ "val": "gazeta_val.jsonl",
45
+ "test": "gazeta_test.jsonl"
46
  }
47
 
48
  _DOCUMENT = "text"
 
79
  )
80
 
81
  def _split_generators(self, dl_manager):
82
+ downloaded_files = dl_manager.download_and_extract(_URLS)
 
 
83
  return [
84
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
85
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
86
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["val"]}),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  ]
88
 
89
+ def _generate_examples(self, filepath):
 
 
90
  with open(filepath, encoding="utf-8") as f:
91
  for id_, row in enumerate(f):
92
  data = json.loads(row)