Description Usage Arguments Value Examples
Apply the trained model to new sentences.
Average word embeddings and search most similar label
vector.
1 2 3 4 |
object |
trained |
sentences |
character containing the sentences |
k |
will return the |
simplify |
when TRUE and |
unlock_empty_predictions |
logical to avoid crash when some predictions are not provided for some sentences because all their words have not been seen during training. This parameter should only be set to TRUE to debug. |
threshold |
used to limit number of words used. (optional; 0.0 by default) |
... |
not used |
list containing for each sentence the probability to be associated with k
labels.
1 2 3 4 5 6 | library(fastrtext)
data("test_sentences")
model_test_path <- system.file("extdata", "model_classification_test.bin", package = "fastrtext")
model <- load_model(model_test_path)
sentence <- test_sentences[1, "text"]
print(predict(model, sentence))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.