Skip to content

Commit

Permalink
Mod: Update internal functional typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
LABBE Etienne committed May 27, 2024
1 parent d78c8b9 commit 62acc11
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/aac_metrics/functional/bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def _bleu_compute(
bleu_n_outs_sents[f"bleu_1_to_{n}"] = bleu_1_to_n_scores

bleu_n_outs = bleu_n_outs_corpus, bleu_n_outs_sents

return bleu_n_outs
else:
return bleu_n_score
Expand Down
2 changes: 1 addition & 1 deletion src/aac_metrics/functional/meteor.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def meteor(
"meteor": meteor_scores,
}
meteor_outs = meteor_outs_corpus, meteor_outs_sents
return meteor_outs
return meteor_outs # type: ignore
else:
return meteor_score

Expand Down
3 changes: 2 additions & 1 deletion src/aac_metrics/functional/rouge_l.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def _rouge_l_compute(
rouge_l_outs_sents = {
"rouge_l": rouge_l_scores_pt,
}
return rouge_l_outs_corpus, rouge_l_outs_sents
rouge_l_outs = rouge_l_outs_corpus, rouge_l_outs_sents
return rouge_l_outs # type: ignore
else:
return rouge_l_score_pt

Expand Down
4 changes: 2 additions & 2 deletions src/aac_metrics/functional/sbert_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def sbert_sim(
sbert_sim_outs_sents = {
"sbert_sim": sbert_sim_scores,
}

return sbert_sim_outs_corpus, sbert_sim_outs_sents
sbert_sim_outs = sbert_sim_outs_corpus, sbert_sim_outs_sents
return sbert_sim_outs # type: ignore
else:
return sbert_sim_score

Expand Down
3 changes: 2 additions & 1 deletion src/aac_metrics/functional/spice.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def spice(
spice_outs_sents = {
"spice": spice_scores,
}
return spice_outs_corpus, spice_outs_sents
spice_outs = spice_outs_corpus, spice_outs_sents
return spice_outs
else:
return spice_score

Expand Down
3 changes: 2 additions & 1 deletion src/aac_metrics/functional/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def vocab(
"vocab.ratio_avg": vocab_len_ratio_avg,
}

return corpus_scores, sents_scores
vocab_outs = corpus_scores, sents_scores
return vocab_outs # type: ignore


def _corpus_vocab(tok_sents: list[list[str]], dtype: torch.dtype) -> Tensor:
Expand Down

0 comments on commit 62acc11

Please sign in to comment.