Learn R Programming

sbo (version 0.5.0)

predict.sbo_kgram_freqs: Predict method for k-gram frequency tables

Description

Predictive text based on Stupid Back-off N-gram model.

Usage

# S3 method for sbo_kgram_freqs
predict(object, input, lambda = 0.4, ...)

Arguments

object

a sbo_kgram_freqs object.

input

a length one character vector, containing the input for next-word prediction.

lambda

a numeric vector of length one. The back-off penalization in Stupid Back-off algorithm.

...

further arguments passed to or from other methods.

Value

A tibble containing the next-word probabilities for all words in the dictionary.

Examples

Run this code
# NOT RUN {
predict(twitter_freqs, "i love")
# }

Run the code above in your browser using DataLab