Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added args to evaluate_dataset #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, transition_system=None, args=None):
def is_hyp_correct(self, example, hyp):
return self.transition_system.compare_ast(hyp.tree, example.tgt_ast)

def evaluate_dataset(self, examples, decode_results, fast_mode=False):
def evaluate_dataset(self, examples, decode_results, fast_mode=False, args=None):
correct_array = []
oracle_array = []
for example, hyp_list in zip(examples, decode_results):
Expand Down Expand Up @@ -58,7 +58,7 @@ class CachedExactMatchEvaluator(Evaluator):
def is_hyp_correct(self, example, hyp):
raise hyp.is_correct

def evaluate_dataset(self, examples, decode_results, fast_mode=False):
def evaluate_dataset(self, examples, decode_results, fast_mode=False, args=None):
if fast_mode:
acc = sum(hyps[0].is_correct for hyps in decode_results if len(hyps) > 0) / float(len(examples))
return acc
Expand Down