Skip to contents

|answer tokens present in the context| / |answer tokens|.

Usage

morie_kamath_groundedness_reward(y_tokens, ctx_tokens, lowercase = TRUE)

Arguments

y_tokens

Answer tokens.

ctx_tokens

Context tokens.

lowercase

Case-fold before matching.

Value

List with estimate, n_grounded, ungrounded.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_groundedness_reward(V, V)
#> $estimate
#> [1] 1
#> 
#> $n_grounded
#> [1] 8
#> 
#> $n_tokens
#> [1] 8
#> 
#> $ungrounded
#> character(0)
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Groundedness reward (answer tokens found in context)"
#>