def induce_and_write_rules():
  """Induce and write set of rules."""
  examples = tsv_utils.read_tsv(FLAGS.input)
  config = induction_utils.InductionConfig(
      sample_size=FLAGS.sample_size,
      max_iterations=FLAGS.max_iterations,
      min_delta=FLAGS.min_delta,
      terminal_codelength=FLAGS.terminal_codelength,
      non_terminal_codelength=FLAGS.non_terminal_codelength,
      parse_sample=FLAGS.parse_sample,
      allow_repeated_target_nts=FLAGS.allow_repeated_target_nts,
      seed_exact_match=FLAGS.seed_exact_match,
      balance_parens=FLAGS.balance_parens,
  )
  induced_rules = induction_utils.induce_rules(examples, config)
  qcfg_file.write_rules(induced_rules, FLAGS.output)
Induce and write set of rules.
language/compgen/nqg/model/induction/induce_rules.py