Update multi_document_summarization.py
Browse files
multi_document_summarization.py
CHANGED
@@ -35,9 +35,9 @@ _DESCRIPTION = """
|
|
35 |
Multi-Document, a large-scale multi-document summarization dataset created from scientific articles. Multi-Document introduces a challenging multi-document summarization task: writing the related-work section of a paper based on its abstract and the articles it references.
|
36 |
"""
|
37 |
|
38 |
-
_URL_TRAIN = "https://github.com/arka0821/multi_document_summarization/blob/master/data/train.
|
39 |
-
_URL_TEST = "https://github.com/arka0821/multi_document_summarization/blob/master/data/test.
|
40 |
-
_URL_VAL = "https://github.com/arka0821/multi_document_summarization/blob/master/data/val.
|
41 |
|
42 |
|
43 |
class MultiDocumentSum(datasets.GeneratorBasedBuilder):
|
@@ -88,15 +88,13 @@ class MultiDocumentSum(datasets.GeneratorBasedBuilder):
|
|
88 |
def _generate_examples(self, path=None):
|
89 |
"""Yields examples."""
|
90 |
with open(path, encoding="utf-8") as f:
|
91 |
-
data =
|
92 |
f.close()
|
93 |
-
print("************")
|
94 |
-
print(data)
|
95 |
for idx, el in enumerate(data):
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
d = el
|
100 |
-
|
101 |
yield idx, d
|
102 |
|
|
|
35 |
Multi-Document, a large-scale multi-document summarization dataset created from scientific articles. Multi-Document introduces a challenging multi-document summarization task: writing the related-work section of a paper based on its abstract and the articles it references.
|
36 |
"""
|
37 |
|
38 |
+
_URL_TRAIN = "https://github.com/arka0821/multi_document_summarization/blob/master/data/train.json"
|
39 |
+
_URL_TEST = "https://github.com/arka0821/multi_document_summarization/blob/master/data/test.json"
|
40 |
+
_URL_VAL = "https://github.com/arka0821/multi_document_summarization/blob/master/data/val.json"
|
41 |
|
42 |
|
43 |
class MultiDocumentSum(datasets.GeneratorBasedBuilder):
|
|
|
88 |
def _generate_examples(self, path=None):
|
89 |
"""Yields examples."""
|
90 |
with open(path, encoding="utf-8") as f:
|
91 |
+
data = json.load(f)
|
92 |
f.close()
|
|
|
|
|
93 |
for idx, el in enumerate(data):
|
94 |
+
ids = [id["id"] for id in json.loads(el["docs"])]
|
95 |
+
texts = [text["text"] for text in el["docs"]]
|
96 |
+
tmp = {"id": ids, "text": texts}
|
97 |
+
d = el.copy()
|
98 |
+
d["docs"] = tmp
|
99 |
yield idx, d
|
100 |
|