(input_file)
return examples
Read a list of `InputExample`s from an input file.
Read a list of `InputExample`s from an input file.
Read a list of InputExample s from an input file .
def read_examples(input_file):
  """Read a list of `InputExample`s from an input file."""
  examples = []
  unique_id = 0
  with tf.gfile.GFile(input_file, "r") as reader:
    while True:
      line = tokenization.convert_to_unicode(reader.readline())
      if not line:
        break
      line = line.strip()
      text_a = None
      text_b = None
      m = re.match(r"^(.*) \|\|\| (.*)$", line)
      if m is None:
        text_a = line
      else:
        text_a = m.group(1)
        text_b = m.group(2)
      examples.append(
          InputExample(unique_id=unique_id, text_a=text_a, text_b=text_b))
      unique_id += 1
  return examples
def read_examples ( input_file ) : examples = [ ] unique_id = 0 with tf . gfile . GFile ( input_file , "r" ) as reader : while True : line = tokenization . convert_to_unicode ( reader . readline ( ) ) if not line : break line = line . strip ( ) text_a = None text_b = None m = re . match ( r"^(.*) \|\|\| (.*)$" , line ) if m is None : text_a = line else : text_a = m . group ( 1 ) text_b = m . group ( 2 ) examples . append ( InputExample ( unique_id = unique_id , text_a = text_a , text_b = text_b ) ) unique_id += 1 return examples