(self, data_dir)
return examples
See base class.
See base class.
See base class .
def get_train_examples(self, data_dir):
    """See base class."""
    lines = self._read_tsv(
        os.path.join(data_dir, "multinli",
                     "multinli.train.%s.tsv" % self.language))
    examples = []
    for (i, line) in enumerate(lines):
      if i == 0:
        continue
      guid = "train-%d" % (i)
      text_a = tokenization.convert_to_unicode(line[0])
      text_b = tokenization.convert_to_unicode(line[1])
      label = tokenization.convert_to_unicode(line[2])
      if label == tokenization.convert_to_unicode("contradictory"):
        label = tokenization.convert_to_unicode("contradiction")
      examples.append(
          InputExample(guid=guid, text_a=text_a, text_b=text_b, label=label))
    return examples
def get_train_examples ( self , data_dir ) : lines = self . _read_tsv ( os . path . join ( data_dir , "multinli" , "multinli.train.%s.tsv" % self . language ) ) examples = [ ] for ( i , line ) in enumerate ( lines ) : if i == 0 : continue guid = "train-%d" % ( i ) text_a = tokenization . convert_to_unicode ( line [ 0 ] ) text_b = tokenization . convert_to_unicode ( line [ 1 ] ) label = tokenization . convert_to_unicode ( line [ 2 ] ) if label == tokenization . convert_to_unicode ( "contradictory" ) : label = tokenization . convert_to_unicode ( "contradiction" ) examples . append ( InputExample ( guid = guid , text_a = text_a , text_b = text_b , label = label ) ) return examples