Umesh Rijal
August 2026
Johns Hopkins Data Science Capstone
Built with R, Quanteda and Shiny
Objective: Predict the most likely next word from a phrase entered by the user.
Typing assistance can make text entry faster and more convenient.
The English SwiftKey corpus contains:
A 1% sample was used for this prototype.
The sampled text was cleaned and converted into word sequences.
Unigram — individual word frequency
Bigram — two-word sequences
Trigram — three-word sequences
4-gram — four-word sequences
The frequency models are saved as .RDS files and loaded by the Shiny application.
Longer sequences provide more context, while shorter sequences provide fallback when a phrase is uncommon.
The application searches from the most specific context to the least specific:
4-gram
↓
3-gram
↓
2-gram
↓
Unigram
The project demonstrates an end-to-end path from text data to an interactive prediction application.
A statistical NLP model can be transformed into a practical, user-facing application using R and Shiny.