File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
tensorflow_datasets/summarization Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -66,18 +66,15 @@ def _generate_examples(self, path=None):
66
66
file_path = os .path .join (topics_path , filename )
67
67
topic_name = filename .split (".txt" )[0 ]
68
68
with tf .io .gfile .GFile (file_path , "rb" ) as src_f :
69
- lines = str (src_f .readlines ())
70
- input_data = "" .join (lines )
69
+ input_data = src_f .read ()
71
70
summaries_path = os .path .join (path , "summaries-gold" , topic_name )
72
71
summary_lst = []
73
72
for summ_filename in tf .io .gfile .listdir (summaries_path ):
74
73
file_path = os .path .join (summaries_path , summ_filename )
75
- file_path = os .path .join (summaries_path , summ_filename )
76
- with tf .io .gfile .GFile (file_path ) as tgt_f :
77
- lines = tgt_f .readlines ()
78
- data = "" .join (lines )
74
+ with tf .io .gfile .GFile (file_path , "rb" ) as tgt_f :
75
+ data = tgt_f .read ()
79
76
summary_lst .append (data )
80
- summary_data = "[SEP_SUM]" .join (summary_lst )
77
+ summary_data = b "[SEP_SUM]" .join (summary_lst )
81
78
yield i , {
82
79
_REVIEW_SENTS : input_data ,
83
80
_SUMMARIES : summary_data
Original file line number Diff line number Diff line change @@ -18,4 +18,3 @@ class OpinosisTest(testing.DatasetBuilderTestCase):
18
18
19
19
if __name__ == "__main__" :
20
20
testing .test_main ()
21
-
You can’t perform that action at this time.
0 commit comments