Datasets:
Commit
·
2f370e8
1
Parent(s):
c294844
Update dialogsum_reformat.py
Browse files- dialogsum_reformat.py +2 -6
dialogsum_reformat.py
CHANGED
@@ -81,7 +81,6 @@ class Dialogsum(datasets.GeneratorBasedBuilder):
|
|
81 |
def _generate_examples(self, filepath):
|
82 |
"""This function returns the examples in the raw (text) form."""
|
83 |
logger.info("generating examples from = %s", filepath)
|
84 |
-
key = 0
|
85 |
with open(filepath) as f :
|
86 |
data = json.load(f)
|
87 |
|
@@ -91,18 +90,16 @@ class Dialogsum(datasets.GeneratorBasedBuilder):
|
|
91 |
dialogue_summary = info['summary']
|
92 |
dialogue_topic = info['topic']
|
93 |
|
94 |
-
yield
|
95 |
"id" : dialogue_id,
|
96 |
"dialogue" : dialogue_name,
|
97 |
"summary" : dialogue_summary,
|
98 |
"topic" : dialogue_topic,
|
99 |
}
|
100 |
-
key += 1
|
101 |
|
102 |
# def _generate_examples(self, filepath, split):
|
103 |
# """This function returns the examples in the raw (text) form."""
|
104 |
# logger.info("generating examples from = %s", filepath)
|
105 |
-
# key = 0
|
106 |
# with open(os.path.join(filepath, split)) as f :
|
107 |
# data = json.load(f)
|
108 |
|
@@ -117,5 +114,4 @@ class Dialogsum(datasets.GeneratorBasedBuilder):
|
|
117 |
# "dialogue" : dialogue_name,
|
118 |
# "summary" : dialogue_summary,
|
119 |
# "topic" : dialogue_topic,
|
120 |
-
# }
|
121 |
-
# key += 1
|
|
|
81 |
def _generate_examples(self, filepath):
|
82 |
"""This function returns the examples in the raw (text) form."""
|
83 |
logger.info("generating examples from = %s", filepath)
|
|
|
84 |
with open(filepath) as f :
|
85 |
data = json.load(f)
|
86 |
|
|
|
90 |
dialogue_summary = info['summary']
|
91 |
dialogue_topic = info['topic']
|
92 |
|
93 |
+
yield {
|
94 |
"id" : dialogue_id,
|
95 |
"dialogue" : dialogue_name,
|
96 |
"summary" : dialogue_summary,
|
97 |
"topic" : dialogue_topic,
|
98 |
}
|
|
|
99 |
|
100 |
# def _generate_examples(self, filepath, split):
|
101 |
# """This function returns the examples in the raw (text) form."""
|
102 |
# logger.info("generating examples from = %s", filepath)
|
|
|
103 |
# with open(os.path.join(filepath, split)) as f :
|
104 |
# data = json.load(f)
|
105 |
|
|
|
114 |
# "dialogue" : dialogue_name,
|
115 |
# "summary" : dialogue_summary,
|
116 |
# "topic" : dialogue_topic,
|
117 |
+
# }
|
|