Get ID of words in the dictionary
get_word_ids(model, words)
model |
|
---|---|
words | character containing words to retrieve IDs |
numeric of ids
library(fastrtext) model_test_path <- system.file("extdata", "model_unsupervised_test.bin", package = "fastrtext") model <- load_model(model_test_path) ids <- get_word_ids(model, c("this", "is", "a", "test")) # print positions print(ids)#> [1] 18 9 7 120#> [1] "this" "is" "a" "test"