(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_version2(self, lines, set_type):
        """Creates examples for the training and dev sets."""
        examples = []
        for (i, line) in enumerate(lines):
            guid = "%s-%s" % (set_type, i)
            if line['question'] == 'cause':
                text_a = line['premise'] + '这是什么原因造成的？' + line['choice0']
                text_b = line['premise'] + '这是什么原因造成的？' + line['choice1']
            else:
                text_a = line['premise'] + '这造成了什么影响？' + line['choice0']
                text_b = line['premise'] + '这造成了什么影响？' + line['choice1']
            label = str(1 if line['label'] == 0 else 0) if set_type != 'test' else '0'
            examples.append(
                InputExample(guid=guid, text_a=text_a, text_b=text_b, label=label))
        return examples
def _create_examples_version2 ( self , lines , set_type ) : examples = [ ] for ( i , line ) in enumerate ( lines ) : guid = "%s-%s" % ( set_type , i ) if line [ 'question' ] == 'cause' : text_a = line [ 'premise' ] + '这是什么原因造成的？' + line['choice0'] text_b = line [ 'premise' ] + '这是什么原因造成的？' + line['choice1'] else : text_a = line [ 'premise' ] + '这造成了什么影响？' + line['choice0'] text_b = line [ 'premise' ] + '这造成了什么影响？' + line['choice1'] label = str ( 1 if line [ 'label' ] == 0 else 0 ) if set_type != 'test' else '0' examples . append ( InputExample ( guid = guid , text_a = text_a , text_b = text_b , label = label ) ) return examples