get_word_vectors: Get word embeddings

Description Usage Arguments Value Examples

View source: R/API.R

Description

Return the vector representation of provided words (unsupervised training) or provided labels (supervised training).

Usage

1
get_word_vectors(model, words = get_dictionary(model))

Arguments

model

trained fastText model

words

character of words. Default: return every word from the dictionary.

Value

matrix containing each word embedding as a row and rownames are populated with word strings.

Examples

1
2
3
4
library(fastrtext)
model_test_path <- system.file("extdata", "model_unsupervised_test.bin", package = "fastrtext")
model <- load_model(model_test_path)
get_word_vectors(model, c("introduction", "we"))

fastrtext documentation built on Oct. 30, 2019, 11:32 a.m.