def load_nli_file(data_path, num_par=2):
  """Build a tf.data.Data from a file of NLI examples."""
  tokenizer = tokenization.NltkTokenizer()
  dataset = tf.data.TextLineDataset(data_path)
  dataset = dataset.map(
      functools.partial(_nli_line_to_tensors, tokenizer=tokenizer),
      num_parallel_calls=num_par)
  dataset = dataset.filter(lambda x: tf.greater_equal(x["label"], 0))
  return dataset
Build a tf.data.Data from a file of NLI examples.
language/boolq/run_recurrent_model_boolq.py