Title: Predictive Text with N-gram Language Modeling Author: Ashish Sunar Date: August 2026
This project builds a lightweight predictive-text system using the English HC Corpora from the SwiftKey Capstone.
Goal
Training data
The text was cleaned and normalized before word-frequency and n-gram analysis.
===
The model uses neighboring words to estimate the next word.
Prediction flow
Model
This approach balances useful context, memory usage, and prediction speed.
===
The Shiny app provides:
Example tests
| Input phrase | Prediction |
|---|---|
| one of | the |
| a lot | of |
| going | to |
| this is | a |
| according to | the |
Live app: https://asheeshsunar.shinyapps.io/PredictiveText/
The application was successfully deployed on shinyapps.io and tested in a web browser.
===
Independent testing on News lines produced:
The model was also tested for interactive runtime and produced fast predictions.
Interpretation
The top-1 result shows that next-word prediction is challenging from limited context. The higher top-3 and top-5 results show that useful candidates are often present among the highest-ranked predictions.
===
Strengths
Future improvements
it's and
don'tTakeaway
The project converts large English text corpora into a working predictive-text application while balancing accuracy, memory usage, and response speed.