def postprocess_question(question, q_tokens, q_probs, sampling_scheme):
  """Add a ? at the end of SQuAD questions and start questions with Wh* word."""
  assert len(q_tokens) == len(q_probs)
  if "uniform" in sampling_scheme:
    q_word = random.choice(q_tokens)
  else:
    q_word = q_tokens[np.argmax(np.random.multinomial(1, q_probs))]
  # Using q_word.encode throws a can't concat str to bytes. Review and check the
  # same for then ext function's encode.
  question = q_word + " " + question + "?"
  return question
Add a ? at the end of SQuAD questions and start questions with Wh* word.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py