onadegibert
commited on
Commit
•
e47f81e
1
Parent(s):
99f5bf3
Upload dataset
Browse files- .gitattributes +3 -0
- casum.py +83 -0
- test.jsonl +3 -0
- test.sum +0 -0
- train.jsonl +3 -0
- valid.jsonl +3 -0
- valid.sum +0 -0
.gitattributes
CHANGED
@@ -35,3 +35,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
38 |
+
valid.jsonl filter=lfs diff=lfs merge=lfs -text
|
39 |
+
test.jsonl filter=lfs diff=lfs merge=lfs -text
|
40 |
+
train.jsonl filter=lfs diff=lfs merge=lfs -text
|
casum.py
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Loading script for the CaSum dataset.
|
2 |
+
import json
|
3 |
+
import datasets
|
4 |
+
|
5 |
+
logger = datasets.logging.get_logger(__name__)
|
6 |
+
|
7 |
+
_CITATION = """
|
8 |
+
|
9 |
+
"""
|
10 |
+
|
11 |
+
_DESCRIPTION = """
|
12 |
+
"""
|
13 |
+
|
14 |
+
_HOMEPAGE = """
|
15 |
+
"""
|
16 |
+
|
17 |
+
#_URL = "https://huggingface.co/datasets/projecte-aina/casum/tree/main"
|
18 |
+
_URL = '/home/ona/Documents/Summarization/summ_ca/acn_hf/casum/'
|
19 |
+
_TRAIN_FILE = "train.jsonl"
|
20 |
+
_VALID_FILE = "valid.jsonl"
|
21 |
+
_TEST_FILE = "test.jsonl"
|
22 |
+
|
23 |
+
class CaSumConfig(datasets.BuilderConfig):
|
24 |
+
""" Builder config for the CaSum dataset """
|
25 |
+
|
26 |
+
def __init__(self, **kwargs):
|
27 |
+
"""BuilderConfig for CaSum.
|
28 |
+
Args:
|
29 |
+
**kwargs: keyword arguments forwarded to super.
|
30 |
+
"""
|
31 |
+
super(CaSumConfig, self).__init__(**kwargs)
|
32 |
+
|
33 |
+
|
34 |
+
class CaSum(datasets.GeneratorBasedBuilder):
|
35 |
+
"""CaSum Dataset."""
|
36 |
+
|
37 |
+
BUILDER_CONFIGS = [
|
38 |
+
CaSumConfig(
|
39 |
+
name="CaSum",
|
40 |
+
version=datasets.Version("1.0.0"),
|
41 |
+
description="CaSum dataset",
|
42 |
+
),
|
43 |
+
]
|
44 |
+
|
45 |
+
def _info(self):
|
46 |
+
return datasets.DatasetInfo(
|
47 |
+
description=_DESCRIPTION,
|
48 |
+
features=datasets.Features(
|
49 |
+
{
|
50 |
+
"summary": datasets.Value("string"),
|
51 |
+
"text": datasets.Value("string"),
|
52 |
+
}
|
53 |
+
|
54 |
+
),
|
55 |
+
supervised_keys=None,
|
56 |
+
homepage=_HOMEPAGE,
|
57 |
+
citation=_CITATION,
|
58 |
+
)
|
59 |
+
|
60 |
+
def _split_generators(self, dl_manager):
|
61 |
+
"""Returns SplitGenerators."""
|
62 |
+
urls_to_download = {
|
63 |
+
"train": f"{_URL}{_TRAIN_FILE}"
|
64 |
+
"valid": f"{_URL}{_VALID_FILE}"
|
65 |
+
"test": f"{_URL}{_TEST_FILE}"
|
66 |
+
}
|
67 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
68 |
+
|
69 |
+
return [
|
70 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
71 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["valid"]}),
|
72 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
73 |
+
]
|
74 |
+
|
75 |
+
def _generate_examples(self, filepath):
|
76 |
+
"""This function returns the examples in the raw (text) form."""
|
77 |
+
logger.info("generating examples from = %s", filepath)
|
78 |
+
with open(filepath, encoding="utf-8") as f:
|
79 |
+
for id_, row in enumerate(f):
|
80 |
+
article = json.loads(row)
|
81 |
+
text = article['text']
|
82 |
+
summary = article['summary']
|
83 |
+
yield id_, { "summary": summary,"text": text}
|
test.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a89ab6ba4a414c5eeb3bb12984930a8c1572fb9a45a3180635215503f96732fe
|
3 |
+
size 22414860
|
test.sum
DELETED
The diff for this file is too large to render.
See raw diff
|
|
train.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2f41efa8ea790d57e3aa4dbaf786aba5589435e8fc8491d7511df975c5ca01e
|
3 |
+
size 442268535
|
valid.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cb210735172c0d09e6321c6fa5cab9dc12fd5ffa2b254c5916c70b287b8c9e03
|
3 |
+
size 22387837
|
valid.sum
DELETED
The diff for this file is too large to render.
See raw diff
|
|