def _create_examples(filename, set_type):
  """Creates examples for the training and dev sets."""
  examples = []
  with tf.gfile.Open(filename) as f:
    for i, line in enumerate(f):
      data = json.loads(line)
      guid = "%s-%s" % (set_type, i)
      label = "Yes" if data["answer"] else "No"
      examples.append(
          BoolQExample(
              guid=guid,
              text_a=data["passage"],
              text_b=data["question"],
              label=label))

  if FLAGS.n_examples and set_type == "train":
    examples = np.random.RandomState(0).choice(
        examples, FLAGS.n_examples, replace=False)
  return examples
Creates examples for the training and dev sets.
language/boolq/run_bert_boolq.py