Skip to content

Commit 8461665

Browse files
authored
meteor: Close Meteor for the functional API. (#90)
Resolves #89
1 parent fe6a9c0 commit 8461665

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nlgeval/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def compute_metrics(hypothesis, references, no_overlap=False, no_skipthoughts=Fa
4545
else:
4646
print("%s: %0.6f" % (method, score))
4747
ret_scores[method] = score
48+
if isinstance(scorer, Meteor):
49+
scorer.close()
4850
del scorers
4951

5052
if not no_skipthoughts:
@@ -108,6 +110,9 @@ def compute_individual_metrics(ref, hyp, no_overlap=False, no_skipthoughts=False
108110
ret_scores[m] = sc
109111
else:
110112
ret_scores[method] = score
113+
if isinstance(scorer, Meteor):
114+
scorer.close()
115+
del scorers
111116

112117
if not no_skipthoughts:
113118
from nlgeval.skipthoughts import skipthoughts

0 commit comments

Comments
 (0)