2025-05-02

About the App & How It Works

This app predicts the next word based on user input using n-gram language models. Inspired by predictive keyboards like SwiftKey.

  • Trained on 5% sample from blogs, news, and Twitter (English corpus)
  • Uses unigram, bigram, trigram frequency
  • Algorithm: Stupid Backoff
  • Built with tidytext, dplyr, shiny

Prediction logic:

  1. Try trigram
  2. Backoff to bigram
  3. Backoff to unigram

Model Performance

  • Model Size: 3 .rds files (~30MB)
  • Speed: Instant response in Shiny app (<1 sec)
  • Accuracy: Most predictions match context in common phrases
  • Example input: “I want to” → Predicts: “go”

Optimized for lightweight deployment.

App Demo

Why This Matters

  • Demonstrates core NLP + R skills: data wrangling, modeling, and deployment.
  • Reusable framework for SMS prediction, chatbot systems, etc.
  • Lightweight, fast, and open-source.

Thank you for visiting my app!