def filter_question(question, answer):
  """Apply filtering rules to QA pair."""
  question = question.strip(string.punctuation + " ")
  answer = answer.strip(string.punctuation + " ")
  if not question:
    return True
  if not answer:
    return True
  if answer.lower() in ["yes", "no", "none", "unanswerable", "unsuitable"]:
    return True
  if any([c.isnumeric() for c in answer]):
    return True
  return False
Apply filtering rules to QA pair.
language/capwap/utils/io_utils.py