Distance is equal to 1 - cosine

get_word_distance(model, w1, w2)

Arguments

model

trained fastText model. Null if train a new model.

w1

first word to compare

w2

second word to compare

Value

a scalar with the distance

Examples

library(fastrtext) model_test_path <- system.file("extdata", "model_unsupervised_test.bin", package = "fastrtext") model <- load_model(model_test_path) get_word_distance(model, "time", "timing")
#> [,1] #> [1,] 0.5868116