Ayesha Ansari
25th June, 2026
Typing is slow. Prediction makes it faster.
A smart next-word predictor saves time and reduces errors
Our Solution:
A lightweight, fast, N-gram language model trained on
real-world English text from blogs, news, and Twitter.
Training Data (Coursera SwiftKey Corpus)
| Source | Lines | Sampled (5%) |
|---|---|---|
| Blogs | 899,288 | ~45,000 |
| News | 1,010,242 | ~50,500 |
| 2,360,148 | ~118,000 |
Algorithm: Stupid Backoff N-gram Model
Why Stupid Backoff?
Memory efficient — tables stored as data.table objects
Speed & Accuracy
| Metric | Value |
|---|---|
| Prediction time | < 100ms |
| Quadgram coverage | ~42% |
| Trigram coverage | ~31% |
| Bigram coverage | ~22% |
| Unigram fallback | ~5% |
Live at: https://ayeshaansari.shinyapps.io/NextWordApp/
Features:
Algorithm transparency panel showing N-gram level used
Instructions:
Type a partial sentence in the text box
Click Predict Next Word
See the predicted word highlighted in context
Adjust your phrase and predict again
Key Takeaways
Future Improvements
Thank You!