If you haven't tried out the app, go here to try it!
Predicts next word
Shows you top 5 other possibilities
Can be used to string together continuous
How To Use the App
Underlying Algorithm
N-gram model with “Stupid Backoff”
Checks if highest-order (in this case, n=4) n-gram has been seen. If not “degrades” to a lower-order model (n=3, 2); we would use even higher orders, but ShinyApps caps app size at 100mb
Further Exploration
The code (for processing into a database and prediction) is available on GitHub
Further work can expand the main weakness of this approach: long-range context
Current algorithm discards contextual information past 4-grams
We can incorporate this into future work through clustering underlying training corpus/data and predicting what cluster the entire sentence would fall into
This allows us to predict using ONLY the data subset that fits the long-range context of the sentence, while still preserving the performance characteristics of an n-gram and Stupid Backoff model