Skip to contents

p(y|x) = p(z = M(y) | x'). x is a named numeric vector of answer-word probabilities (validated to sum to 1); M a named character vector label -> answer word.

Usage

morie_kamath_ch3_prompt_label_mapping(x, y, M)

Arguments

x

Named answer-word distribution.

y

Class label.

M

Named label -> answer-word map.

Value

List with estimate, label_probs, label_mass.

Examples

morie_kamath_ch3_prompt_label_mapping(c(great = 0.7, terrible = 0.3),
    "positive", list(positive = "great", negative = "terrible"))
#> $estimate
#> [1] 0.7
#> 
#> $label
#> [1] "positive"
#> 
#> $answer_word
#> [1] "great"
#> 
#> $label_probs
#> positive negative 
#>      0.7      0.3 
#> 
#> $label_mass
#> [1] 1
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "prompt label word mapping (Kamath Eq 3.1)"
#>