
RAG faithfulness (Kamath Eq 7.2)
Source:R/kamath_llm2_native.R
morie_kamath_ch7_faithfulness_metric.RdSupported facts / total facts. facts must be 0/1 or logical.
Examples
morie_kamath_ch7_faithfulness_metric(c(1, 0, 1, 1))
#> $estimate
#> [1] 0.75
#>
#> $n_supported
#> [1] 3
#>
#> $n_facts
#> [1] 4
#>
#> $n
#> [1] 4
#>
#> $method
#> [1] "RAG faithfulness = supported / total facts (Kamath Eq 7.2)"
#>