Skip to contents

Counts clipped n-grams against the best-matching reference count, then delegates to km114 (precision), km116 (brevity penalty) and km117 (final).

Usage

morie_kamath_bleu_score(hypothesis, references, max_n = 4)

Arguments

hypothesis

Token vector.

references

List of token vectors.

max_n

Highest order.

Value

List with estimate, p_n, brevity_penalty.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_bleu_score(V, V)
#> $estimate
#> [1] 0
#> 
#> $bleu
#> [1] 0
#> 
#> $p_n
#> [1] 1 0 0 0
#> 
#> $clipped_counts
#>      [,1] [,2]
#> [1,]    8    8
#> [2,]    0    7
#> [3,]    0    6
#> [4,]    0    5
#> 
#> $brevity_penalty
#> [1] 1
#> 
#> $candidate_length
#> [1] 8
#> 
#> $reference_length
#> [1] 1
#> 
#> $max_n
#> [1] 4
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "BLEU (Kamath Ch 8; km114/km116/km117 cores)"
#>