Datasets:
Tasks:
Summarization
Modalities:
Text
Formats:
parquet
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
bills-summarization
License:
Commit
•
f3b3a1a
0
Parent(s):
Update files from the datasets library (from 1.0.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.0.0
- .gitattributes +27 -0
- billsum.py +106 -0
- dataset_infos.json +1 -0
- dummy/3.0.0/dummy_data.zip +3 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
billsum.py
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
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 |
+
"""BillSum Dataset."""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import json
|
22 |
+
import os
|
23 |
+
|
24 |
+
import datasets
|
25 |
+
|
26 |
+
|
27 |
+
_CITATION = """
|
28 |
+
@misc{kornilova2019billsum,
|
29 |
+
title={BillSum: A Corpus for Automatic Summarization of US Legislation},
|
30 |
+
author={Anastassia Kornilova and Vlad Eidelman},
|
31 |
+
year={2019},
|
32 |
+
eprint={1910.00523},
|
33 |
+
archivePrefix={arXiv},
|
34 |
+
primaryClass={cs.CL}
|
35 |
+
}
|
36 |
+
"""
|
37 |
+
|
38 |
+
_DESCRIPTION = """
|
39 |
+
BillSum, summarization of US Congressional and California state bills.
|
40 |
+
|
41 |
+
There are several features:
|
42 |
+
- text: bill text.
|
43 |
+
- summary: summary of the bills.
|
44 |
+
- title: title of the bills.
|
45 |
+
features for us bills. ca bills does not have.
|
46 |
+
- text_len: number of chars in text.
|
47 |
+
- sum_len: number of chars in summary.
|
48 |
+
"""
|
49 |
+
|
50 |
+
_URL = "https://drive.google.com/uc?export=download&id=1g89WgFHMRbr4QrvA0ngh26PY081Nv3lx"
|
51 |
+
|
52 |
+
_DOCUMENT = "text"
|
53 |
+
_SUMMARY = "summary"
|
54 |
+
|
55 |
+
|
56 |
+
class Billsum(datasets.GeneratorBasedBuilder):
|
57 |
+
"""BillSum Dataset."""
|
58 |
+
|
59 |
+
# 2.0.0 data source updated to filter near duplicates.
|
60 |
+
# 3.0.0 none of the test examples are 'near duplicates' of an example in the
|
61 |
+
# train set AND they dont have the same title, regardless of similarity.
|
62 |
+
VERSION = datasets.Version("3.0.0")
|
63 |
+
|
64 |
+
def _info(self):
|
65 |
+
return datasets.DatasetInfo(
|
66 |
+
description=_DESCRIPTION,
|
67 |
+
features=datasets.Features(
|
68 |
+
{
|
69 |
+
_DOCUMENT: datasets.Value("string"),
|
70 |
+
_SUMMARY: datasets.Value("string"),
|
71 |
+
"title": datasets.Value("string"),
|
72 |
+
}
|
73 |
+
),
|
74 |
+
supervised_keys=(_DOCUMENT, _SUMMARY),
|
75 |
+
homepage="https://github.com/FiscalNote/BillSum",
|
76 |
+
citation=_CITATION,
|
77 |
+
)
|
78 |
+
|
79 |
+
def _split_generators(self, dl_manager):
|
80 |
+
"""Returns SplitGenerators."""
|
81 |
+
dl_path = dl_manager.download_and_extract(_URL)
|
82 |
+
return [
|
83 |
+
datasets.SplitGenerator(
|
84 |
+
name=datasets.Split.TRAIN,
|
85 |
+
gen_kwargs={"path": os.path.join(dl_path, "us_train_data_final_OFFICIAL.jsonl"), "key": "bill_id"},
|
86 |
+
),
|
87 |
+
datasets.SplitGenerator(
|
88 |
+
name=datasets.Split.TEST,
|
89 |
+
gen_kwargs={"path": os.path.join(dl_path, "us_test_data_final_OFFICIAL.jsonl"), "key": "bill_id"},
|
90 |
+
),
|
91 |
+
datasets.SplitGenerator(
|
92 |
+
name="ca_test",
|
93 |
+
gen_kwargs={"path": os.path.join(dl_path, "ca_test_data_final_OFFICIAL.jsonl"), "key": "external_id"},
|
94 |
+
),
|
95 |
+
]
|
96 |
+
|
97 |
+
def _generate_examples(self, path=None, key=None):
|
98 |
+
"""Yields examples."""
|
99 |
+
with open(path, encoding="utf-8") as f:
|
100 |
+
for line in f:
|
101 |
+
# in us bills, json has fields:
|
102 |
+
# text, summary, title, bill_id, text_len, sum_len
|
103 |
+
# in ca bills, json has fields:
|
104 |
+
# text, summary, title, external_id
|
105 |
+
d = json.loads(line)
|
106 |
+
yield d[key], {k: d[k] for k in [_DOCUMENT, _SUMMARY, "title"]}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "\nBillSum, summarization of US Congressional and California state bills.\n\nThere are several features:\n - text: bill text.\n - summary: summary of the bills.\n - title: title of the bills.\nfeatures for us bills. ca bills does not have.\n - text_len: number of chars in text.\n - sum_len: number of chars in summary.\n", "citation": "\n@misc{kornilova2019billsum,\n title={BillSum: A Corpus for Automatic Summarization of US Legislation},\n author={Anastassia Kornilova and Vlad Eidelman},\n year={2019},\n eprint={1910.00523},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://github.com/FiscalNote/BillSum", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "summary": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": {"input": "text", "output": "summary"}, "builder_name": "billsum", "config_name": "default", "version": {"version_str": "3.0.0", "description": null, "datasets_version_to_prepare": null, "major": 3, "minor": 0, "patch": 0}, "splits": {"ca_test": {"name": "ca_test", "num_bytes": 14945923, "num_examples": 1237, "dataset_name": "billsum"}, "test": {"name": "test", "num_bytes": 37867905, "num_examples": 3269, "dataset_name": "billsum"}, "train": {"name": "train", "num_bytes": 219605578, "num_examples": 18949, "dataset_name": "billsum"}}, "download_checksums": {"https://drive.google.com/uc?export=download&id=1g89WgFHMRbr4QrvA0ngh26PY081Nv3lx": {"num_bytes": 67260676, "checksum": "5a55dfb231618d63b25cec4773280a2986d38f53d6d4d39b8256b278edf1110c"}}, "download_size": 67260676, "dataset_size": 272419406, "size_in_bytes": 339680082}}
|
dummy/3.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3762d779e1816b59cbacc0d291d9ea7d4456d9db527fe13d1bc1685fda4c904
|
3 |
+
size 1113
|