Louis Natasha Voudy Nanlessy
2026-06-08
Typing on mobile devices is often slow and error-prone. A predictive keyboard can reduce typing effort by suggesting the next word before the user finishes typing.
Goal: build a Shiny app that takes a phrase as input and predicts the next word.
The model uses English text from three sources:
The exploratory analysis focuses on word frequency, bigrams, trigrams, and common language patterns. The data is cleaned by lowercasing text, removing URLs, removing non-letter symbols, and trimming spaces.
The app uses an n-gram backoff model:
This approach is simple, fast, and suitable for an interactive Shiny app.
The Shiny app contains:
Example input:
I went to the
Example output:
store, gym, beach
The model demonstrates how text data can be transformed into a useful data product. It is lightweight enough for deployment and easy to explain to non-technical users.
Future improvements may include larger training samples, profanity filtering, smoothing, and better handling of punctuation and unknown words.