Skip to content

Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA031 · Metric

chrF and chrF++

Scores character n-gram precision/recall; chrF++ incorporates word n-grams as well.

Runs in CodeSplash Complete calculation CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through evaluate.text. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Scores character n-gram precision/recall; chrF++ incorporates word n-grams as well.

Question / hypotheses

How well do surface forms overlap while accommodating morphology and tokenization differences?

Architecture / computational structure

A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.

Assumptions

Unicode normalization, whitespace policy, n-gram orders, and corpus aggregation must be specified. Reference adequacy remains essential.

Formula / computational definition

Fβ=(1+β2)PRβ2P+R.F_\beta=\frac{(1+\beta^2)PR}{\beta^2P+R}.

Parameters and notation

P and R are the implementation’s aggregated character/word n-gram precision and recall. beta controls recall emphasis; maximum character order and word order distinguish variants.

Fitting, fine-tuning, and adaptation

There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.

How to use and calibrate

Use a standard implementation with a saved signature; complement lexical scores with semantic and human assessment. Compare identical test examples.

Example application

Evaluate translations for a morphologically rich language where exact word matching is brittle.

Interpretation / pitfalls

Watch out

Different versions average counts and orders differently; the toy below demonstrates F-beta aggregation only. High overlap can survive a negation or number error.

Python and R code examples

Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

P=.7; R=.8; beta=2
print((1+beta**2)*P*R/(beta**2*P+R))
R

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

P <- .7; R <- .8; beta <- 2
print((1+beta^2)*P*R/(beta^2*P+R))

Sources

From the CodeSplash reference, entry EVA031.