Skip to main content

Bleu

Metric
DashAI.back.metrics.translation.Bleu

A class for calculating BLEU scores between source and target sentences.

BLEU (bilingual evaluation understudy) is an algorithm for evaluating the quality of text which has been machine-translated from one natural language to another.

References

Methods

score(source_sentences: 'DashAIDataset', target_sentences: 'np.ndarray') -> float

Defined on Bleu

Calculate the BLEU 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 BLEU score ranging between 0 and 1.

get_metadata(cls: 'BaseMetric') -> Dict[str, Any]

Defined on BaseMetric

Get metadata values for the current metric.

Returns

Dict[str, Any]
Dictionary with the metadata

Compatible with