
BLEU geometric mean and final score (Kamath Eq 8.3, 8.5)
Source:R/kamath_llm2_native.R
morie_kamath_ch8_bleu_n_geom_mean.RdBLEU geometric mean and final score (Kamath Eq 8.3, 8.5)
Usage
morie_kamath_ch8_bleu_n_geom_mean(p_n, N = NULL)
morie_kamath_ch8_bleu_final(BP, p_n, N = NULL)Details
One geometric mean serves both Python modules exactly as km117
calls km115: km115 -> morie_kamath_ch8_bleu_n_geom_mean, km117 ->
morie_kamath_ch8_bleu_final (BP times that mean). Any zero precision
collapses the mean to 0 and the log mean to -Inf.
Examples
morie_kamath_ch8_bleu_n_geom_mean(c(0.5, 0.25))
#> $estimate
#> [1] 0.3535534
#>
#> $log_mean
#> [1] -1.039721
#>
#> $p_n
#> [1] 0.50 0.25
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "BLEU-N geometric mean of precisions (Kamath Eq 8.3)"
#>