(self, data_dir, set_type="dev")
return examples
See base class.
See base class.
See base class .
def get_devtest_examples(self, data_dir, set_type="dev"):
    """See base class."""
    devtest_file = os.path.join(data_dir, "xnli."+set_type+".tsv")
    tf.logging.info("using file %s" % devtest_file)
    lines = self._read_tsv(devtest_file)
    examples = []
    for (i, line) in enumerate(lines):
      if i == 0:
        continue
      guid = "%s-%s" % (set_type, i)
      language = line[0]
      if language != self.language:
        continue

      text_a = line[6].replace(' ','')
      text_b = line[7].replace(' ','')
      label = line[1]
      
      examples.append(
          InputExample(guid=guid, text_a=text_a, text_b=text_b, label=label))
    return examples
def get_devtest_examples ( self , data_dir , set_type = "dev" ) : devtest_file = os . path . join ( data_dir , "xnli." + set_type + ".tsv" ) tf . logging . info ( "using file %s" % devtest_file ) lines = self . _read_tsv ( devtest_file ) examples = [ ] for ( i , line ) in enumerate ( lines ) : if i == 0 : continue guid = "%s-%s" % ( set_type , i ) language = line [ 0 ] if language != self . language : continue text_a = line [ 6 ] . replace ( ' ' , '' ) text_b = line [ 7 ] . replace ( ' ' , '' ) label = line [ 1 ] examples . append ( InputExample ( guid = guid , text_a = text_a , text_b = text_b , label = label ) ) return examples