Saltar al contenido principal

PerSegmentComparison

Report
DashAI.back.reports.translation.PerSegmentComparison

Reference against translation for every segment, worst ones highlighted.

The corpus level BLEU, CHRF and TER metrics condense a whole split into one number. This table is the split itself: it pairs each reference with its translation and a sentence level score, and highlights the lowest scoring rows so the segments dragging the aggregate down are the first thing seen. A concentration of low scores in long or short segments, or around a particular topic, is exactly what the average cannot say.

Parameters

highlight_count : integer, default=5
How many of the lowest scoring segments to highlight.

Methods

compute(self, y_true, y_pred, class_names: Optional[List[str]] = None) -> List[DashAI.back.core.artifacts.Artifact]

Defined on PerSegmentComparison

Build the per segment comparison table.

Parameters

y_true : array_like
Reference translations, one per row.
y_pred : array_like
The model's translations for the same rows.
class_names : Optional[List[str]]
Unused; always None for translation.

Returns

List[Artifact]
A single table, one row per segment plus the average row.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

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

Defined on BaseReport

Get metadata values for the current report.

Returns

Dict[str, Any]
UI metadata, including whether the report needs a model that outputs class probabilities.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.

Compatible with