2023-12-23
The Next Word Predictor app predicts the next word based on the input of the user.
This app is developed for the Capstone Project of the Data Science Specialization. The data for training the model is provided by SwiftKey and is available at:
https://d396qusza40orc.cloudfront.net/dsscapstone/dataset/Coursera-SwiftKey.zip
The Next Word Predictor is an easy to use, simple, light weight and fast Shiny app that takes a text as an input and when the user clicks submit predicts the next word.
When 2 or more words are entered by the user the two words are looked up in the 3-gram, if found the most frequent word that comes next is returned.
If the entered words are not found the second word is looked up in the 2-gram. If it is found the most frequent word that comes next is returned.
If the entered word is not found in the 2-gram than the unigram is sampled and a frequently used word is returned.
In this manner we predict a word by backing off to lower order n-grams.
You can try the app at:
https://denizd.shinyapps.io/WordPrediction/
View the source code at:
https://github.com/DenizDemi/WordPredictor