Exemplo n.º 1
0
 def _create_examples(lines, set_type):
     examples = []
     for (i, line) in enumerate(lines):
         if i == 0:
             continue
         guid = "%s-%s" % (set_type, line[0])
         text_a = line[8]
         text_b = line[9]
         if set_type in ["train", "dev_matched"]:
             label = line[-1]
             examples.append(
                 SequenceClsInputExample(guid=guid, text=text_a, text_b=text_b, label=label)
             )
         else:
             examples.append(SequenceClsInputExample(guid=guid, text=text_a, text_b=text_b))
     return examples
Exemplo n.º 2
0
 def _create_examples(lines, set_type):
     examples = []
     for (i, line) in enumerate(lines):
         if i == 0:
             continue
         guid = "%s-%s" % (set_type, i)
         if set_type in ["train", "dev"]:
             text_a = line[0]
             label = line[1]
             examples.append(
                 SequenceClsInputExample(guid=guid, text=text_a, text_b=None, label=label)
             )
         else:
             text_a = line[1]
             examples.append(SequenceClsInputExample(guid=guid, text=text_a))
     return examples
Exemplo n.º 3
0
 def _create_examples(lines, set_type):
     examples = []
     for (i, line) in enumerate(lines):
         if i == 0:
             continue
         guid = "%s-%s" % (set_type, line[0])
         if set_type in ["train", "dev"]:
             try:
                 text_a = line[3]
                 text_b = line[4]
                 label = line[5]
             except IndexError:
                 continue
             examples.append(
                 SequenceClsInputExample(guid=guid, text=text_a, text_b=text_b, label=label)
             )
         else:
             try:
                 text_a = line[1]
                 text_b = line[2]
             except IndexError:
                 continue
             examples.append(SequenceClsInputExample(guid=guid, text=text_a, text_b=text_b))
     return examples