Learn R Programming

fastrtext (version 0.3.4)

get_word_vectors: Get word embeddings

Description

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

Usage

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

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_vectors(model, c("introduction", "we"))

# }

Run the code above in your browser using DataLab