-
Notifications
You must be signed in to change notification settings - Fork 164
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
Having better defaults for ChrF #124
Comments
This would require changing |
@m-popovic should be the "authoritative" person to confirm that =) |
I added this into my
Also, because of the way the sentences are tokenized as above, languages like zh and ja would probably not benefit from having word-level ngrams, right? |
Yes, only a single punctuation character, only at beginning and end of words, but if there is a punctuation at the end, no punctuation from the beginning is separated: separate_punctuation('(hi)') == ['(hi', ')'] This seems very wrong, but if we need to replicate chrF++, we need to accept that.
The following code is so obfuscated and also about 3.3 times slower than the original, so I mention it just as a joke: import string
punct = string.punctuation
ugly_re = f'\s+|((?<=\S)[{punct}](?=\s|$)|(?<=\s)[{punct}](?=\S*[^{punct}](?:\s|$)))'
def separate_punctuation_re(line):
return list(filter(None, re.split(ugly_re, line))) The following code seems to be 23% faster than the original (on a randomly chosen file): import string
punct_set = set(string.punctuation)
def separate_punctuation4(line):
tokenized = []
for w in line.split():
if len(w) == 1:
tokenized.append(w)
else:
if w[-1] in punct_set:
tokenized += (w[:-1], w[-1])
elif w[0] in punct_set:
tokenized += (w[0], w[1:])
else:
tokenized.append(w)
return tokenized |
Didn't notice that glitch about being first/last. Definitely weird, probably an |
- Build: Add Windows and OS X testing to github workflow - Improve documentation and type annotations. - Drop `Python < 3.6` support and migrate to f-strings. - Drop input type manipulation through `isinstance` checks. If the user does not obey to the expected annotations, exceptions will be raised. Robustness attempts lead to confusions and obfuscated score errors in the past (fixes #121) - Use colored strings in tabular outputs (multi-system evaluation mode) through the help of `colorama` package. - tokenizers: Add caching to tokenizers which seem to speed up things a bit. - `intl` tokenizer: Use `regex` module. Speed goes from ~4 seconds to ~0.6 seconds for a particular test set evaluation. (fixes #46) - Signature: Formatting changed (mostly to remove '+' separator as it was interfering with chrF++). The field separator is now '|' and key values are separated with ':' rather than '.'. - Metrics: Scale all metrics into the [0, 100] range (fixes #140) - BLEU: In case of no n-gram matches at all, skip smoothing and return 0.0 BLEU (fixes #141). - BLEU: allow modifying max_ngram_order (fixes #156) - CHRF: Added multi-reference support, verified the scores against chrF++.py, added test case. - CHRF: Added chrF+ support through `word_order` argument. Added test cases against chrF++.py. Exposed it through the CLI (--chrf-word-order) (fixes #124) - CHRF: Add possibility to disable effective order smoothing (pass --chrf-eps-smoothing). This way, the scores obtained are exactly the same as chrF++, Moses and NLTK implementations. We keep the effective ordering as the default for compatibility, since this only affects sentence-level scoring with very short sentences. (fixes #144) - CLI: Allow modifying TER arguments through CLI. We still keep the TERCOM defaults. - CLI: Prefix metric-specific arguments with --chrf and --ter. To maintain compatibility, BLEU argument names are kept the same. - CLI: Added `--format/-f` flag. The single-system output mode is now `json` by default. If you want to keep the old text format persistently, you can export `SACREBLEU_FORMAT=text` into your shell. - CLI: sacreBLEU now supports evaluating multiple systems for a given test set in an efficient way. Through the use of `tabulate` package, the results are nicely rendered into a plain text table, LaTeX, HTML or RST (cf. --format/-f argument). The systems can be either given as a list of plain text files to `-i/--input` or as a tab-separated single stream redirected into `STDIN`. In the former case, the basenames of the files will be automatically used as system names. - Statistical tests: sacreBLEU now supports confidence interval estimation through bootstrap resampling for single-system evaluation (`--confidence` flag) as well as paired bootstrap resampling (`--paired-bs`) and paired approximate randomization tests (`--paired-ar`) when evaluating multiple systems (fixes #40 and fixes #78).
The chrf++ is a better chrf than the default chrf6 used in sacrebleu, could we change the default to chrf++?
From the original ChrF creator: https://twitter.com/amelija16mp/status/1331288013880614913
The text was updated successfully, but these errors were encountered: