The fastTextR allows for two different styles, 1. functional style and 2. object style.
The object style uses the same functions as the functional style. the main difference is that the model is not required to be provided as first argument.
The following cheatsheet shows the functions with arguments for both styles without the default values. More detailed information can be found in the Manual.
functional style | object style |
---|---|
ft <- fasttext() |
|
model <- ft_loat(file) |
ft$load(file) |
ft_save(model, file, what) |
ft$save(file, what) |
model <- ft_train(file, method, control, ...) |
ft$train(file, method, control, ...) |
ft_predict(model, newdata, k, threshold, rval, ...) |
ft$predict(newdata, k, threshold, rval, ...) |
ft_test(model, file, k, threshold) |
ft$test(file, k, threshold) |
ft_words(model) |
ft$words() |
ft_word_vectors(model, words) |
ft$word_vectors(words) |
ft_sentence_vectors(model, sentences) |
ft$sentence_vectors(sentences) |
ft_nearest_neighbors(model, word, k) |
ft$nearest_neighbors(word, k) |
ft_analogies(model, word_triplets, k) |
ft$analogies(word_triplets, k) |