SwiftKey Next-Word Prediction

author: Ayşe Çiğdem Şehitoğlu date: 18 October 2026

The Problem

  • Typing on mobile devices is slow and error-prone
  • Users need fast and accurate next-word suggestions
  • Goal: Build a lightweight text prediction app similar to SwiftKey

Our Solution

  • A simple Shiny web application
  • User types a phrase → App predicts the most likely next word
  • Fast response and easy to use
  • Built with R and deployed on shinyapps.io

How the Algorithm Works

  • Cleaned text from blogs, news and Twitter
  • Built n-gram models (bigrams and trigrams)
  • Used Stupid Backoff strategy
  • When a higher-order n-gram is not found, the model falls back to a simpler one
  • Only the most frequent n-grams are kept to keep the model fast and small

How to Use the App

  1. Open the Shiny app
  2. Type a phrase in the text box (example: “I want to”)
  3. Click Submit or wait a moment
  4. The app shows the predicted next word

Demo link will be provided in the final submission.

Why This Matters

  • Simple and understandable approach
  • Fast enough for real-time use
  • Easy to improve later (more data, better backoff, larger n-grams)
  • Demonstrates end-to-end data science skills: data → model → product

Thank you