Skip to content

Commit

Permalink
meteor: Close Meteor for the functional API. (#90)
Browse files Browse the repository at this point in the history
Resolves #89
  • Loading branch information
juharris authored Nov 22, 2019
1 parent fe6a9c0 commit 8461665
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nlgeval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def compute_metrics(hypothesis, references, no_overlap=False, no_skipthoughts=Fa
else:
print("%s: %0.6f" % (method, score))
ret_scores[method] = score
if isinstance(scorer, Meteor):
scorer.close()
del scorers

if not no_skipthoughts:
Expand Down Expand Up @@ -108,6 +110,9 @@ def compute_individual_metrics(ref, hyp, no_overlap=False, no_skipthoughts=False
ret_scores[m] = sc
else:
ret_scores[method] = score
if isinstance(scorer, Meteor):
scorer.close()
del scorers

if not no_skipthoughts:
from nlgeval.skipthoughts import skipthoughts
Expand Down

0 comments on commit 8461665

Please sign in to comment.