createScorer()
createScorer() gives a scoring function a name. Use the returned scorer in
an evaluation's scorers array.
Import
Signature
Parameters
Scorer identity and scoring callback. EXPECTED defaults to OUTPUT.
Return value
Returns a Scorer<OUTPUT, EXPECTED, EXTRA> function that can be used in evaluations:
createScorer() supplies the configured name, overriding any name returned by
the callback. evaluate() passes additional case fields to each scorer. It also
passes input at runtime, but the current ScorerArgs type does not infer its
type separately. Declare input in EXTRA when using it in a typed custom
scorer.
A config factory receives worker-local model and integration dependencies. Use it to resolve dependencies, not to open external resources for each case.
Example
Task output and expected values may have different types:
To adapt an existing scorer instead of writing a new one, use wrapScorer().