aac_metrics.functional.rouge_l module

class ROUGELScores

Bases: dict

rouge_l: Tensor
rouge_l(candidates: list[str], mult_references: list[list[str]], return_all_scores: bool = True, *, beta: float = 1.2, tokenizer: ~typing.Callable[[str], list[str]] = <method 'split' of 'str' objects>) tuple[ROUGELScores, ROUGELScores] | Tensor[source]

Recall-Oriented Understudy for Gisting Evaluation function.

Parameters:
  • candidates – The list of sentences to evaluate.

  • mult_references – The list of list of sentences used as target.

  • return_all_scores – If True, returns a tuple containing the globals and locals scores. Otherwise returns a scalar tensor containing the main global score. defaults to True.

  • beta – Determines the weight of recall in the combined f-score. defaults to 1.2.

  • tokenizer – The fast tokenizer used to split sentences into words. defaults to str.split.

Returns:

A tuple of globals and locals scores or a scalar tensor with the main global score.