title: "Next word prediction"author: "Enrique Figueroa"date: "2021-12-19"
by Enrique Figueroa
December 19, 2021
The user should enter a two or three-word phrase in the App input box. The App will find and display the most probable next words based on their conditional probabilities of being together.
The App is stored at shinyapps.io.
n-grams (“contiguous sequence of n items from a given sample of text”).Bag of words (BoW) in the form of .Rdata files, created in the processing step are available for the App.
The user's input is processed for appropriately feeding the function that retrieves the most probable words. For instance:
The top 3 predictions will be returned if available.
Unsuccessful searches of the 3-grams will resort to a 2-gram table search.
The App can be found at github.com/efignav.
Since we only want to proof concept the algorithms behind next word predictions the user interface is simple: