(self, lines, set_type)
return examples
Creates examples for the training and dev sets.
Creates examples for the training and dev sets.
Creates examples for the training and dev sets .
def _create_examples(self, lines, set_type):
    """Creates examples for the training and dev sets."""
    examples = []
    print("length of lines:",len(lines))
    for (i, line) in enumerate(lines):
      #print('#i:',i,line)
      if i == 0:
        continue
      guid = "%s-%s" % (set_type, i)
      try:
          label = line[2]
          text_a = line[0].strip().replace(' ','')
          text_b = line[1].strip().replace(' ','')
          if i < 5: # print for debug purpose only
            print("label:",str(label),";text_a:",text_a,";text_b:",text_b)
          examples.append(
              InputExample(guid=guid, text_a=text_a, text_b=text_b, label=label))
      except Exception:
          print('###error.i:', i, line)
    return examples
def _create_examples ( self , lines , set_type ) : examples = [ ] print ( "length of lines:" , len ( lines ) ) for ( i , line ) in enumerate ( lines ) : #print('#i:',i,line) if i == 0 : continue guid = "%s-%s" % ( set_type , i ) try : label = line [ 2 ] text_a = line [ 0 ] . strip ( ) . replace ( ' ' , '' ) text_b = line [ 1 ] . strip ( ) . replace ( ' ' , '' ) if i < 5 : # print for debug purpose only print ( "label:" , str ( label ) , ";text_a:" , text_a , ";text_b:" , text_b ) examples . append ( InputExample ( guid = guid , text_a = text_a , text_b = text_b , label = label ) ) except Exception : print ( '###error.i:' , i , line ) return examples