def save_examples(queries,
                  passages,
                  neighbors_path,
                  q_ids,
                  max_cand,
                  examples_path,
                  is_training,
                  train_eval=False):
  """Save examples for the given q_ids as TFRecords."""

  encoded_passages_path = None
  encoded_queries_path = None
  encoded_passages_path = FLAGS.encoded_passages_path
  encoded_queries_path = FLAGS.encoded_queries_path
  processor = RetrievalProcessor(FLAGS.answers_path, queries, passages,
                                 encoded_queries_path, encoded_passages_path)
  tokenizer = get_tokenizer(FLAGS.bert_hub_module_path)
  max_seq_length = FLAGS.max_seq_length
  function = get_grouped_candidates_v2

  examples = function(
      processor,
      queries,
      passages,
      neighbors_path,
      q_ids,
      max_cand,
      is_training,
      train_eval=train_eval)
  file_based_convert_examples_to_features(examples, processor.get_labels(),
                                          max_seq_length, tokenizer,
                                          examples_path)
Save examples for the given q_ids as TFRecords.
language/multivec/preprocessing/create_training_data.py