def get_dynamic_dataset(preprocessing_servers,
                        featurizer,
                        num_input_threads):
  """Get dataset generated dynamically by a preprocessing job."""

  def _parse_example(serialized_example):
    return nest_utils.tf_example_to_structure(
        serialized_example, featurizer.query_and_docs_feature_structure)

  dataset = preprocessing.dataset_from_preprocessors(
      preprocessing_servers=preprocessing_servers,
      rpcs_per_tf_op=20,
  )
  return dataset.map(_parse_example, num_parallel_calls=num_input_threads)
Get dataset generated dynamically by a preprocessing job.
language/realm/model.py