mbrs.selectors.nbest module

mbrs.selectors.nbest module#

class mbrs.selectors.nbest.SelectorNbest(cfg: Config)[source]#

Bases: Selector

select(hypotheses: list[str], expected_scores: Tensor, nbest: int = 1, source: str | None = None, maximize: bool = True, **kwargs) Output[source]#

Select the final output list.

Parameters:
  • hypotheses (list[str]) – Hypotheses.

  • expected_scores (Tensor) – The expected scores for each hypothesis.

  • nbest (int) – Return the n-best hypotheses based on the selection rule.

  • source (str, optional) – A source.

  • maximize (bool) – Whether maximize the scores or not.

Returns:

Selected hypotheses.

Return type:

Selector.Output