def _example_to_rule(source_str, target_str):
  """Convert (source, target) example to a QCFGRule."""
  return qcfg_rule.QCFGRule(
      tuple(source_str.split()), tuple(target_str.split()), arity=0)
Convert (source, target) example to a QCFGRule.
language/compgen/nqg/model/induction/induction_utils.py