fastrtext (version 0.3.3)

get_word_distance: Distance between two words

Description

Distance is equal to 1 - cosine

Usage

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

Run this code
# NOT RUN {
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")

# }

Run the code above in your browser using DataLab