Skip to contents

P(t) = P_forward(t_hat|t) . P_backward(t|t_hat). The printed equation cannot be a round trip; the coherent reading is implemented, as in Python.

Usage

morie_kamath_ch3_back_translation_prob(
  t,
  thatt,
  p_forward = NULL,
  p_backward = NULL
)

Arguments

t

Candidate prompt.

thatt

Pivot translation.

p_forward, p_backward

Leg probabilities in [0, 1].

Value

List with estimate.

Examples

morie_kamath_ch3_back_translation_prob("a", "b", p_forward = 0.5,
    p_backward = 0.25)
#> $estimate
#> [1] 0.125
#> 
#> $p_forward
#> [1] 0.5
#> 
#> $p_backward
#> [1] 0.25
#> 
#> $candidate
#> [1] "a"
#> 
#> $pivot
#> [1] "b"
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "round-trip back-translation score (Kamath Eq 3.9)"
#>