Skip to content

Commit

Permalink
fixes #91: replace newline and space like characters with a space for…
Browse files Browse the repository at this point in the history
… meteor
  • Loading branch information
kracwarlock committed Feb 10, 2020
1 parent 8461665 commit 4115f3a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nlgeval/pycocoevalcap/meteor/meteor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def _stat(self, hypothesis_str, reference_list):
# SCORE ||| reference 1 words ||| reference n words ||| hypothesis words
hypothesis_str = hypothesis_str.replace('|||', '').replace(' ', ' ')
score_line = ' ||| '.join(('SCORE', ' ||| '.join(reference_list), hypothesis_str))
score_line = re.sub(r'\s+', ' ', score_line)
self.meteor_p.stdin.write(enc(score_line))
self.meteor_p.stdin.write(enc('\n'))
self.meteor_p.stdin.flush()
Expand Down

0 comments on commit 4115f3a

Please sign in to comment.