@@ -41,7 +41,7 @@ def _info(self):
41
41
description = _DESCRIPTION ,
42
42
features = tfds .features .FeaturesDict ({
43
43
_REVIEW_SENTS : tfds .features .Text (),
44
- _SUMMARIES : tfds .features .Text (),
44
+ _SUMMARIES : tfds .features .Sequence ( tfds . features . Text ())
45
45
}),
46
46
supervised_keys = (_REVIEW_SENTS , _SUMMARIES ),
47
47
homepage = 'http://kavita-ganesan.com/opinosis/#.XeTZopNKhTY' ,
@@ -62,7 +62,7 @@ def _generate_examples(self, path=None):
62
62
"""Yields examples."""
63
63
topics_path = os .path .join (path , "topics" )
64
64
filenames = tf .io .gfile .listdir (topics_path )
65
- for i , filename in enumerate ( filenames ) :
65
+ for filename in filenames :
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 :
@@ -74,8 +74,8 @@ def _generate_examples(self, path=None):
74
74
with tf .io .gfile .GFile (file_path , "rb" ) as tgt_f :
75
75
data = tgt_f .read ()
76
76
summary_lst .append (data )
77
- summary_data = b"[SEP_SUM]" . join ( summary_lst )
78
- yield i , {
77
+ summary_data = summary_lst
78
+ yield filename , {
79
79
_REVIEW_SENTS : input_data ,
80
80
_SUMMARIES : summary_data
81
81
}
0 commit comments