Next Word Prediction App
Aafreen
1. Introduction
Goal:
Predict the next word in a given phrase
Why it matters:
Enhances typing efficiency, autocomplete, smart assistants
Built with:
R, Shiny, n-gram language modeling
Capstone project
for the Coursera Data Science specialization
2. The Algorithm
Trigram language model
used for prediction
Trained on a sample English corpus (sentences from various domains)
Preprocessing: lowercasing, punctuation removal, tokenization
Given the last two words, predicts the most probable next word
3. The App (Shiny)
Simple UI with:
Text input box
Submit button
Predicted word output
Reactive and runs on shinyapps.io
Live: [insert your app URL here]
4. Example Predictions
Input Phrase
Predicted Word
“the economy”
is
“she walked”
into
“data science”
is
“the stock”
market
“he opened”
the
Prediction shown after pressing
Submit
5. Business Case
Useful for:
Autocomplete in messaging, email apps
Voice assistants and search engines
Educational tools for language learning
Extensible to neural networks (LSTM/transformers)
Deployed app + clear NLP logic = production-ready prototype