Datasets:
Convert dataset to Parquet (#4)
Browse files- Convert dataset to Parquet (a5b5596dd729018a649d622060fd4661d223ff82)
- Delete loading script (2bc4c749be3ed9562d979df68c281c4d7f72cf88)
- Delete data file (79a10361cd7684688aff13958cad92b1e3798133)
- Delete data file (e64a8ab398851bc9c9b2b7cc8e95ce4e10eae96a)
- Delete data file (e6d88c5d1c479c7482e6811396616770d035efbd)
README.md
CHANGED
|
@@ -11,6 +11,35 @@ task_categories:
|
|
| 11 |
task_ids: []
|
| 12 |
tags:
|
| 13 |
- conditional-text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
# GovReport dataset for summarization
|
|
|
|
| 11 |
task_ids: []
|
| 12 |
tags:
|
| 13 |
- conditional-text-generation
|
| 14 |
+
dataset_info:
|
| 15 |
+
config_name: document
|
| 16 |
+
features:
|
| 17 |
+
- name: report
|
| 18 |
+
dtype: string
|
| 19 |
+
- name: summary
|
| 20 |
+
dtype: string
|
| 21 |
+
splits:
|
| 22 |
+
- name: train
|
| 23 |
+
num_bytes: 953321013
|
| 24 |
+
num_examples: 17517
|
| 25 |
+
- name: validation
|
| 26 |
+
num_bytes: 55820431
|
| 27 |
+
num_examples: 973
|
| 28 |
+
- name: test
|
| 29 |
+
num_bytes: 51591123
|
| 30 |
+
num_examples: 973
|
| 31 |
+
download_size: 506610432
|
| 32 |
+
dataset_size: 1060732567
|
| 33 |
+
configs:
|
| 34 |
+
- config_name: document
|
| 35 |
+
data_files:
|
| 36 |
+
- split: train
|
| 37 |
+
path: document/train-*
|
| 38 |
+
- split: validation
|
| 39 |
+
path: document/validation-*
|
| 40 |
+
- split: test
|
| 41 |
+
path: document/test-*
|
| 42 |
+
default: true
|
| 43 |
---
|
| 44 |
|
| 45 |
# GovReport dataset for summarization
|
test.zip → document/test-00000-of-00001.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:d4f4fa6f96f2cb43ffcdbf5e1d39d2ce1ebff5314d0a92413211103aae3d5957
|
| 3 |
+
size 24000716
|
train.zip → document/train-00000-of-00002.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:8b02abb5691b3fa1ba95f76331cadc8bb3e80195c626b4656b480d36e0c92242
|
| 3 |
+
size 227793632
|
document/train-00001-of-00002.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce7786d8626c94c58163b195b6d4c6ddaa01ff0a9c3574ac21399ae56c3dd3a3
|
| 3 |
+
size 228706875
|
valid.zip → document/validation-00000-of-00001.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:8098b61d7aef5b16de870963a2f074b69e625767715f9c5ce94e2fc860087398
|
| 3 |
+
size 26109209
|
govreport-summarization.py
DELETED
|
@@ -1,96 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import os
|
| 3 |
-
import datasets
|
| 4 |
-
from datasets.tasks import TextClassification
|
| 5 |
-
|
| 6 |
-
_DESCRIPTION = """
|
| 7 |
-
GovReport dataset for summarization.
|
| 8 |
-
From paper: Efficient Attentions for Long Document Summarization" by L. Huang et al.
|
| 9 |
-
See: https://arxiv.org/pdf/2104.02112.pdf
|
| 10 |
-
See: https://github.com/luyang-huang96/LongDocSum
|
| 11 |
-
"""
|
| 12 |
-
_CITATION = """\
|
| 13 |
-
@misc{huang2021efficient,
|
| 14 |
-
title={Efficient Attentions for Long Document Summarization},
|
| 15 |
-
author={Luyang Huang and Shuyang Cao and Nikolaus Parulian and Heng Ji and Lu Wang},
|
| 16 |
-
year={2021},
|
| 17 |
-
eprint={2104.02112},
|
| 18 |
-
archivePrefix={arXiv},
|
| 19 |
-
primaryClass={cs.CL}
|
| 20 |
-
}
|
| 21 |
-
}
|
| 22 |
-
"""
|
| 23 |
-
_ABSTRACT = "summary"
|
| 24 |
-
_ARTICLE = "report"
|
| 25 |
-
|
| 26 |
-
class GovReportSummarizationConfig(datasets.BuilderConfig):
|
| 27 |
-
"""BuilderConfig for GovReportSummarization."""
|
| 28 |
-
|
| 29 |
-
def __init__(self, **kwargs):
|
| 30 |
-
"""BuilderConfig for GovReportSummarization.
|
| 31 |
-
Args:
|
| 32 |
-
**kwargs: keyword arguments forwarded to super.
|
| 33 |
-
"""
|
| 34 |
-
super(GovReportSummarizationConfig, self).__init__(**kwargs)
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
class GovReportSummarizationDataset(datasets.GeneratorBasedBuilder):
|
| 38 |
-
"""GovReportSummarization Dataset."""
|
| 39 |
-
|
| 40 |
-
_TRAIN_FILE = "train.zip"
|
| 41 |
-
_VAL_FILE = "valid.zip"
|
| 42 |
-
_TEST_FILE = "test.zip"
|
| 43 |
-
|
| 44 |
-
BUILDER_CONFIGS = [
|
| 45 |
-
GovReportSummarizationConfig(
|
| 46 |
-
name="document",
|
| 47 |
-
version=datasets.Version("1.0.0"),
|
| 48 |
-
description="GovReport dataset for summarization, document",
|
| 49 |
-
),
|
| 50 |
-
]
|
| 51 |
-
|
| 52 |
-
DEFAULT_CONFIG_NAME = "document"
|
| 53 |
-
|
| 54 |
-
def _info(self):
|
| 55 |
-
# Should return a datasets.DatasetInfo object
|
| 56 |
-
return datasets.DatasetInfo(
|
| 57 |
-
description=_DESCRIPTION,
|
| 58 |
-
features=datasets.Features(
|
| 59 |
-
{
|
| 60 |
-
_ARTICLE: datasets.Value("string"),
|
| 61 |
-
_ABSTRACT: datasets.Value("string"),
|
| 62 |
-
#"id": datasets.Value("string"),
|
| 63 |
-
}
|
| 64 |
-
),
|
| 65 |
-
supervised_keys=None,
|
| 66 |
-
homepage="https://github.com/luyang-huang96/LongDocSum",
|
| 67 |
-
citation=_CITATION,
|
| 68 |
-
)
|
| 69 |
-
|
| 70 |
-
def _split_generators(self, dl_manager):
|
| 71 |
-
|
| 72 |
-
train_path = os.path.join(dl_manager.download_and_extract(self._TRAIN_FILE), "train.txt")
|
| 73 |
-
val_path = os.path.join(dl_manager.download_and_extract(self._VAL_FILE), "valid.txt")
|
| 74 |
-
test_path = os.path.join(dl_manager.download_and_extract(self._TEST_FILE), "test.txt")
|
| 75 |
-
|
| 76 |
-
return [
|
| 77 |
-
datasets.SplitGenerator(
|
| 78 |
-
name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}
|
| 79 |
-
),
|
| 80 |
-
datasets.SplitGenerator(
|
| 81 |
-
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": val_path}
|
| 82 |
-
),
|
| 83 |
-
datasets.SplitGenerator(
|
| 84 |
-
name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}
|
| 85 |
-
),
|
| 86 |
-
]
|
| 87 |
-
|
| 88 |
-
def _generate_examples(self, filepath):
|
| 89 |
-
"""Generate GovReportSummarization examples."""
|
| 90 |
-
with open(filepath, encoding="utf-8") as f:
|
| 91 |
-
for id_, row in enumerate(f):
|
| 92 |
-
data = json.loads(row)
|
| 93 |
-
report = data["report"]
|
| 94 |
-
summary = data["summary"]
|
| 95 |
-
|
| 96 |
-
yield id_, {"report": report, "summary": summary}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|