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

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

Closed
SunbowLiu opened this issue Jan 9, 2021 · 0 comments · Fixed by #133
Closed

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

SunbowLiu opened this issue Jan 9, 2021 · 0 comments · Fixed by #133
Assignees

Comments

@SunbowLiu
Copy link

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'

ozancaglayan added a commit that referenced this issue Jan 12, 2021
`--short` is now working correctly with TER
@ozancaglayan ozancaglayan self-assigned this Jan 12, 2021
@ozancaglayan ozancaglayan linked a pull request Jan 12, 2021 that will close this issue
ozancaglayan added a commit that referenced this issue Jan 18, 2021
This commit incorporates several bugfixes and API improvements for the upcoming release

- TER: Correctly handle the --short option (#131)
- sacrebleu: use correct method with sacrelogger
- Update docstrings for bleu methods
- BLEU: Change default value for `floor` smoothing to 0.1 (#129)
- test: fix test case for the floor param changes
- Use 'exp' smoothing for compat.sentence_bleu() (#98)
-  Bleu: add smoothing value to signature (#98)
- dataset: Fix IWSLT links (#128)
- API: move __repr__() to BaseScore
- Change version to 1.5.0, update Changelog
* compat: let raw_corpus_bleu() use the floor default value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants