(self, data_dir, set_type="train")
return examples
See base class.
See base class.
See base class .
def get_train_examples(self, data_dir, set_type="train"):
    """See base class."""
    train_file = os.path.join(data_dir, "multinli",
                     "multinli.train.%s.tsv" % self.language)
    lines = self._read_tsv(train_file)
    examples = []
    for (i, line) in enumerate(lines):
      if i == 0:
        continue
      guid = "%s-%s" % (set_type, i)
      text_a = line[0].replace(' ','')
      text_b = line[1].replace(' ','')
      label = line[2]
      if label == "contradictory":
        label = "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 , set_type = "train" ) : train_file = os . path . join ( data_dir , "multinli" , "multinli.train.%s.tsv" % self . language ) lines = self . _read_tsv ( train_file ) examples = [ ] for ( i , line ) in enumerate ( lines ) : if i == 0 : continue guid = "%s-%s" % ( set_type , i ) text_a = line [ 0 ] . replace ( ' ' , '' ) text_b = line [ 1 ] . replace ( ' ' , '' ) label = line [ 2 ] if label == "contradictory" : label = "contradiction" examples . append ( InputExample ( guid = guid , text_a = text_a , text_b = text_b , label = label ) ) return examples