Skip to content

[BUG] TER metric fails to use --short #131

@SunbowLiu

Description

@SunbowLiu

Using no-short version is ok:
sacrebleu -t wmt14/full -l en-de --metric ter < detok.de
TER+lang.en-de+test.wmt14/full+tok.tercom-nonorm-punct-noasian-uncased+version.1.4.14 = XX

But short verision meets the bug:
sacrebleu --short -t wmt14/full -l en-de --metric ter < detok.de

Traceback (most recent call last):
File "/root/miniconda2/envs/torch1.4/bin/sacrebleu", line 33, in
sys.exit(load_entry_point('sacrebleu==1.4.14', 'console_scripts', 'sacrebleu')())
File "/root/miniconda2/envs/torch1.4/lib/python3.7/site-packages/sacrebleu-1.4.14-py3.7.egg/sacrebleu/sacrebleu.py", line 319, in main
print(score.format(args.width, args.score_only, metric.signature))
File "/root/miniconda2/envs/torch1.4/lib/python3.7/site-packages/sacrebleu-1.4.14-py3.7.egg/sacrebleu/metrics/ter.py", line 80, in format
prefix = "{}+{}".format(self.prefix, signature) if signature else self.prefix
File "/root/miniconda2/envs/torch1.4/lib/python3.7/site-packages/sacrebleu-1.4.14-py3.7.egg/sacrebleu/metrics/base.py", line 50, in str
final_name = self._abbr[name] if self.short else name
KeyError: 'tok'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions