def _generate_examples(self, data_file):
    """This function returns the examples in the raw (text) form."""
    with tf.io.gfile.GFile(data_file) as f:
      reader = csv.DictReader(f, delimiter='\t', quoting=csv.QUOTE_NONE)
      for row in reader:
        # Everything in the row except for 'talk_name' will be a translation.
        # Missing/incomplete translations will contain the string "__NULL__" or
        # "_ _ NULL _ _".
        yield {
            'translations': {
                lang: text
                for lang, text in six.iteritems(row)
                if lang != 'talk_name' and _is_translation_complete(text)
            },
            'talk_name': row['talk_name']
        }
def _generate_examples ( self , data_file ) : with tf . io . gfile . GFile ( data_file ) as f : reader = csv . DictReader ( f , delimiter = '\t' , quoting = csv . QUOTE_NONE ) for row in reader : yield { 'translations' : { lang : text for lang , text in six . iteritems ( row ) if lang != 'talk_name' and _is_translation_complete ( text ) } , 'talk_name' : row [ 'talk_name' ] }
This function returns the examples in the raw (text) form.