def _TextGenerator(self, example_gen):
"""Generates article and abstract text from tf.Example."""
while True:
e = example_gen.next()
try:
article_text = self._GetExFeatureText(e, self._article_key)
abstract_text = self._GetExFeatureText(e, self._abstract_key)
except ValueError:
tf.logging.error('Failed to get article or abstract from example')
continue
yield (article_text, abstract_text)
评论列表
文章目录