Skip to contents

Generates reverse questions, embeds them, then delegates the cosine mean to morie_kamath_ch7_answer_relevance (km112).

Usage

morie_kamath_ragas_answer_relevance(
  answer,
  original_question,
  model,
  embed = NULL
)

Arguments

answer

Model answer.

original_question

Query (or embedding).

model

Function answer -> reverse questions.

embed

Optional.

Value

List with estimate, score, similarities.

Examples

morie_kamath_ragas_answer_relevance("ans", c(1, 1), function(a) list(c(1,
    0), c(0, 1)))
#> $estimate
#> [1] 0.7071068
#> 
#> $score
#> [1] 0.7071068
#> 
#> $similarities
#> [1] 0.7071068 0.7071068
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "RAGAS answer relevance (Kamath Ch 7; km112 core)"
#>