This app suggests the most likely next word for a given text.
The word prediction is based on a simple N-gram (1- to 3-grams) language model (a machine learning model that assigns a probability to each possible next word).
Two probability estimation algorithms are implemented in the app:
- Interpolation: calculates a new probability by combining the trigram, bigram and unigram probabilities (by linearly interpolating them)
- Stupid Backoff: if a higher-order n-gram has a zero count, the lower-order n-gram’s count is used (i.e. we only “back off” to a lower-order n-gram if we have zero evidence for a higher-order n-gram).
Technology
This is a Shiny app - it uses the power of R language and is based on the Shiny web application framework.
This Shiny app is available at the following URL: https://vladmag.shinyapps.io/NextWordPrediction_App/