fastrtext (version 0.3.3)

get_sentence_representation: Get sentence embedding

Description

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

Usage

get_sentence_representation(model, sentences)

Arguments

model

fastText model

sentences

character containing the sentences

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)
m <- get_sentence_representation(model, "this is a test")
print(m)
# }

Run the code above in your browser using DataLab