def read_data(data_file):
  """Read permutation discrimination eval dataset.

  Args:
    data_file: data file to read from

  Returns:
    A list of examples (21 permutations where the first is the correct one).
  """
  perms = []
  with tf.gfile.Open(data_file, "r") as handle:
    tsvreader = csv.reader(handle, delimiter="\t")
    for line in tsvreader:
      if line:
        perms.append(line)

  examples = []
  for perm in perms:
    target = perm[1].split("<PUNC>")
    distractors = [
        list(para.split("<PUNC>")) for para in perm[2].split("<BREAK>")
    ]
    examples.append([target] + distractors)

  return examples
Read permutation discrimination eval dataset.

  Args:
    data_file: data file to read from

  Returns:
    A list of examples (21 permutations where the first is the correct one).
  
language/conpono/evals/discriminative_eval.py