October 6, 2026

Overview & Problem Statement

  • Smart keyboards require fast and accurate text prediction to enhance typing speed.
  • The objective of this project is to create an intuitive data product that predicts the next word based on user input.
  • Key features:
    • Text processing on SwiftKey dataset (Blogs, News, Twitter)
    • Real-time word prediction algorithm
    • User-friendly interactive Shiny application

Prediction Algorithm

  • Data Cleaning: Lowercased text, removed numbers, symbols, and punctuation.
  • N-gram Modeling: Built Tokenized Bigram, Trigram, and Quadgram matrices.
  • Backoff Logic: Uses a simplified Backoff model:
    • Checks Quadgram for last 3 words input.
    • Falls back to Trigram/Bigram if no match is found.
    • Defaults to highest frequency unigram (“the”) for unknown words.

Shiny Application Features

  • Simple UI with minimal lag for optimal user experience.
  • Input box allows users to type any custom phrase.
  • Instant output box renders the predicted next word automatically.
  • Lightweight design optimized for deployment on shinyapps.io.

How to Use & Resources

  1. Open the Shiny Application in your browser.
  2. Enter your text phrase into the provided text box.
  3. View the predicted next word displayed instantly below.