
MoverScore from exact Word Mover's Distance (Kamath Ch 8)
Source:R/kamath_llm2_native.R
morie_kamath_moverscore.Rd1 - exact WMD / max pair cost. The transport LP is the same core the Eq 8.10 module uses, so the two cannot drift.
Usage
morie_kamath_moverscore(
hypothesis_embeddings,
reference_embeddings,
weights_h = NULL,
weights_r = NULL,
metric = "euclidean",
normalizer = NULL
)
morie_kamath_word_movers_distance(cost, p, q, max_iter = 10000)Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_moverscore(V, V)
#> $estimate
#> [1] 1
#>
#> $score
#> [1] 1
#>
#> $wmd
#> [1] 0
#>
#> $normalizer
#> [1] 7
#>
#> $metric
#> [1] "euclidean"
#>
#> $n_hypothesis
#> [1] 8
#>
#> $n_reference
#> [1] 8
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "MoverScore = 1 - exact WMD / normalizer"
#>