Chrf
DashAI.back.metrics.translation.Chrf
A class for calculating CHRF scores between source and target sentences.
CHRF (Character n-gram F-score) is a metric used for evaluating the quality of machine-translated text by comparing it to reference translations at the character level.
References
- [1] https://en.wikipedia.org/wiki/CHRF
- [2] https://lightning.ai/docs/torchmetrics/stable/text/chrf_score.html
Methods
score(source_sentences: 'DashAIDataset', target_sentences: 'np.ndarray') -> float
ChrfCalculate the CHRF score between source and target sentences.
Parameters
- source_sentences : DashAIDataset
- Sentences in the original language.
- target_sentences : ndarray
- Sentences in the target language.
Returns
- float
- The calculated CHRF score ranging between 0 and 1.
get_metadata(cls: 'BaseMetric') -> Dict[str, Any]
BaseMetricGet metadata values for the current metric.
Returns
- Dict[str, Any]
- Dictionary with the metadata