aac_metrics.functional.cider_d module¶
- cider_d(
- candidates: list[str],
- mult_references: list[list[str]],
- return_all_scores: True =
True, - *,
- n: int =
4, - sigma: float =
6.0, - tokenizer: Callable[[str], list[str]] =
str.split, - return_tfidf: bool =
False, - scale: float =
10.0, - cider_d(
- candidates: list[str],
- mult_references: list[list[str]],
- return_all_scores: False,
- *,
- n: int =
4, - sigma: float =
6.0, - tokenizer: Callable[[str], list[str]] =
str.split, - return_tfidf: bool =
False, - scale: float =
10.0, Consensus-based Image Description Evaluation function.
Warning
This metric requires at least 2 candidates with 2 sets of references, otherwise it will raises a ValueError.
- Parameters:¶
- candidates: list[str]¶
The list of sentences to evaluate.
- mult_references: list[list[str]]¶
The list of list of sentences used as target.
- return_all_scores: True =
True¶ - return_all_scores: False
If True, returns a tuple containing the globals and locals scores. Otherwise returns a scalar tensor containing the main global score. defaults to True.
- n: int =
4¶ Maximal number of n-grams taken into account. defaults to 4.
- sigma: float =
6.0¶ Standard deviation parameter used for gaussian penalty. defaults to 6.0.
- tokenizer: Callable[[str], list[str]] =
str.split¶ The fast tokenizer used to split sentences into words. defaults to str.split.
- return_tfidf: bool =
False¶ If True, returns the list of dictionaries containing the tf-idf scores of n-grams in the sents_score output. defaults to False.
- scale: float =
10.0¶ CIDEr-D score factor. defaults to 10.0.
- Returns:¶
A tuple of globals and locals scores or a scalar tensor with the main global score.