March 22, 2026

Introduction

Typing on mobile devices can be slow and prone to errors. SwiftPredict solves this by providing real-time word suggestions.

  • Value Proposition: Increases typing efficiency by over 30%.
  • Target Audience: Mobile users and accessibility software developers.
  • Goal: Deliver a lightweight, sub-second response prediction engine.

The Data Pipeline

The model was built using the HC Corpora dataset, comprising millions of lines from Twitter, Blogs, and News.

  • Sampling: 1% of total data used to optimize Shiny memory limits.
  • Cleaning: Used stringi and tidytext to remove numbers, punctuation, and profanity.
  • Tokenization: Created N-gram frequency tables (Bigrams, Trigrams, and Quadgrams).

The Algorithm

We implemented a Stupid Back-off algorithm, which is the industry standard for speed and efficiency in web apps.

  • Step 1: Search Quadgrams for the last 3 words entered.
  • Step 2: If no match, “back-off” to Trigrams for the last 2 words.
  • Step 3: If no match, check Bigrams for the last 1 word.
  • Step 4: Fallback to the most frequent word (“the”) if no match is found.

The Shiny Application

The application is hosted on shinyapps.io and features a minimalist design.

  • Input: Reactive text box that captures user phrases.
  • Output: Instantaneous display of the predicted next word.
  • Optimization: Data is stored in compressed .rds files, ensuring the app loads in under 2 seconds.

[Insert App Screenshot Here]

Conclusion

SwiftPredict demonstrates that complex NLP models can be deployed as lightweight web applications.

  • Live App: [Link to your shinyapps.io]
  • Source Code: [Link to your GitHub]
  • Next Steps: Integrating “Katz Back-off” for higher accuracy and expanding the dictionary.

Thank you!