Swiftkey Word Prediction

Data Science Capstone Project

Devprakash Rai

January 8, 2026

1. The Big Idea

Problem: Typing on mobile devices is slow and prone to errors. Users need a way to communicate faster.

Solution: A lightweight, intelligent prediction engine that guesses the next word before you finish typing.

  • Fast: Response in milliseconds.
  • Accurate: Uses real-world data from Twitter, Blogs, and News.
  • Mobile-Ready: Small memory footprint.

2. The Data Journey

Before building the “brain,” we analyzed over 4 million lines of text to find patterns.

  • Cleaning: Removed profanity, punctuation, and numbers.
  • Sampling: Used a representative subset to ensure the app stays fast.
  • Discovery: Identified common “N-grams” (word sequences).

3. How the “Brain” Works

We use a Stupid Backoff Algorithm. It’s like a detective looking for clues in a specific order:

  1. Trigrams: It looks at your last two words (e.g., “Going to”) to find a 3rd word match.
  2. Bigrams: If no 3-word match exists, it “backs off” to look at just your last word.
  3. The Safety Net: If the word is totally new, it predicts “the” (the most common English word).

4. Using the App

The interface is designed for a 12-year-old to use—simple and clean!

  1. Input: Type your phrase in the text box.
  2. Wait: No need to click “Submit.” The app is “Reactive.”
  3. Result: The best guess appears instantly in bold blue text.

Experience: Using the app feels like a conversation. It’s built with R Shiny to be interactive and fun.

5. Conclusion & Future

My algorithm shows that we can predict human speech using simple mathematical patterns.

What’s Next? - Context Awareness: Understanding if the user is writing a formal email or a casual tweet. - Personalization: Learning your specific slang and favorite phrases.

6. Try It Yourself!

The predictive engine is live and ready for testing.

  • Fast: Optimized for mobile and web.
  • Smart: Learns from millions of real-world sentences.
  • Simple: Designed for users of all ages.

CLICK HERE TO OPEN THE APP

Pro-Tip

Type “How are” or “Thank you” in the app to see the algorithm in action!