def get_input_features(source,
                       target,
                       rules,
                       rhs_emb_idx_map,
                       lhs_emb_idx_map,
                       config,
                       verbose=False):
  """Return tuple of input features as lists."""
  # Run chart parser.
  target_node = parsing_utils.get_target_node(
      source,
      target,
      rules,
      max_single_nt_applications=config["max_single_nt_applications"])
  if not target_node:
    raise ValueError("No parse returned for target for example: (%s, %s)" %
                     (source, target))
  if verbose:
    print("target_node\n%s" % _print_tree(target_node))

  # Get parse forest.
  return forest_serialization.get_forest_lists(
      target_node,
      rhs_emb_idx_map,
      lhs_emb_idx_map,
      max_num_nts=config["max_num_nts"])
Return tuple of input features as lists.
language/compgen/csl/model/data/example_converter.py