get_sentence_representation: Get sentence embedding

Description Usage Arguments Examples

View source: R/API.R

Description

Sentence is splitted in words (using space characters), and word embeddings are averaged.

Usage

1
get_sentence_representation(model, sentences)

Arguments

model

fastText model

sentences

character containing the sentences

Examples

1
2
3
4
5
library(fastrtext)
model_test_path <- system.file("extdata", "model_unsupervised_test.bin", package = "fastrtext")
model <- load_model(model_test_path)
m <- get_sentence_representation(model, "this is a test")
print(m)

fastrtext documentation built on March 10, 2019, 5:04 p.m.