ft_embed: Word Embeddings

Description Usage Arguments Value Author(s) Examples

View source: R/core.R

Description

Given a vector words, this function returns the 300-dimensional embedding of each element. The embedding is given in reference to a particular language. The model must have been loaded using the function ft_load_model.

Usage

1
ft_embed(words, lang = "en")

Arguments

words

a character vector of the words for which an embedding should be returned

lang

the two letter language code specifying the language to use for the embedding

Value

A matrix with three hundred columns and one row for each word. Rownames record the input words. Rows corresponding the words not in the embedding are set to NA

Author(s)

Taylor B. Arnold, taylor.arnold@acm.org

Examples

1
2
ft_load_model(lang = "en")
ft_embed(c("the", "and", "I", "banana"), lang = "en")

statsmaths/fasttextM documentation built on April 2, 2020, 5:33 p.m.