arka0821 commited on
Commit
7f90eef
1 Parent(s): 3a156da

Update multi_document_summarization.py

Browse files
Files changed (1) hide show
  1. multi_document_summarization.py +16 -1
multi_document_summarization.py CHANGED
@@ -84,4 +84,19 @@ class MultiDocumentSum(datasets.GeneratorBasedBuilder):
84
  name=datasets.Split.VALIDATION,
85
  gen_kwargs={"path": val_path},
86
  ),
87
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  name=datasets.Split.VALIDATION,
85
  gen_kwargs={"path": val_path},
86
  ),
87
+ ]
88
+
89
+ def _generate_examples(self, path=None):
90
+ """Yields examples."""
91
+ with open(path, encoding="utf-8") as f:
92
+ data = json.load(f)
93
+ f.close()
94
+
95
+ for idx, el in enumerate(data):
96
+ '''cite_n = list(el["ref_abstract"].keys())
97
+ cite_n_mid = [el["ref_abstract"][cite]["mid"] for cite in cite_n]
98
+ cite_n_abstract = [el["ref_abstract"][cite]["abstract"] for cite in cite_n]
99
+ tmp = {"cite_N": cite_n, "mid": cite_n_mid, "abstract": cite_n_abstract}
100
+ d = el.copy()
101
+ d["summary"] = tmp'''
102
+ yield idx, d