def postprocess_question_boolq(question, q_tokens, q_probs, sampling_scheme):
  """Start BoolQ questions with a yes/no question starter 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))]
  return q_word.encode("ascii", "ignore") + " " + question
Start BoolQ questions with a yes/no question starter word.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py