MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / normalized_score

Method normalized_score

include/ctranslate2/scoring.h:26–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 float normalized_score() const {
27 const size_t num_tokens = tokens_score.size();
28 if (num_tokens == 0)
29 return 0.f;
30 return cumulated_score() / static_cast<float>(num_tokens);
31 }
32 };
33
34 // Scores a batch of sequences.

Callers 1

score_raw_text_fileMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected