'Generates article and abstract text from tf.Example.'

def _TextGenerator(self, example_gen):

    while True:
        e = six.next(example_gen)
        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))
