Precision metric
Bases: FBetaScore
Computes token-level precision for LM string outputs.
Formula (per field, SQuAD-style multiset over normalized tokens):
Mirrors F1Score: tokenization, masking and average modes behave
identically; only the result formula differs. Use this when you want
to report precision as a separate signal alongside Recall and
F1Score.
Example:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
average
|
str
|
Type of averaging across per-field results.
One of |
None
|
name
|
str
|
(Optional) string name of the metric instance. |
'precision'
|
in_mask
|
list
|
(Optional) list of keys to keep to compute the metric. |
None
|
out_mask
|
list
|
(Optional) list of keys to remove to compute the metric. |
None
|
in_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are kept (combined with |
None
|
out_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are dropped (combined with |
None
|