Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
answer prune
  • Loading branch information
Pengcheng Yin committed Oct 4, 2018
1 parent 0f4dda9 commit a234019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion evaluation.py
Expand Up @@ -29,7 +29,7 @@ def decode(examples, model, args, verbose=False, **kwargs):
try:
hyp.code = model.transition_system.ast_to_surface_code(hyp.tree)

if args.lang == 'wikisql':
if args.lang == 'wikisql' and args.answer_prune:
# try execute the code, if fails, skip this example!
# if the execution returns null, also skip this example!
detokenized_hyp_query = detokenize_query(hyp.code, example.meta, example.table)
Expand Down
3 changes: 3 additions & 0 deletions exp.py
Expand Up @@ -67,6 +67,9 @@ def init_arg_parser():

# wikisql
arg_parser.add_argument('--column_att', choices=['dot_prod', 'affine'], default='affine')
arg_parser.add_argument('--answer_prune', dest='answer_prune', action='store_true')
arg_parser.add_argument('--no_answer_prune', dest='answer_prune', action='store_false')
arg_parser.set_defaults(answer_prune=True)

# parent information switch and input feeding
arg_parser.add_argument('--no_parent_production_embed', default=False, action='store_true')
Expand Down

0 comments on commit a234019

Please sign in to comment.