Next Word Prediction App

  • A Shiny app that predicts the next word in a phrase
  • Built using an n-gram language model in R
  • Designed to be fast, simple, and user-friendly

Why this matters

  • Predictive text helps users type faster
  • Used in messaging, email, and search engines
  • Improves user experience and efficiency
  • Goal: build a simple and practical prediction tool

Data and Model

  • Training data from blogs, news, and Twitter
  • Text cleaned by removing punctuation, links, and symbols

Model approach:
- Uses n-grams: bigrams, trigrams, fourgrams

How the app works

  • User enters a phrase
  • App cleans the input text
  • Model predicts the next word using backoff:
    • 4-word → 3-word → 2-word → fallback

Example:
- Input: “I love”
- Output: “you”

Why this app is effective

  • Fast and responsive
  • Simple interface
  • Clear prediction logic
  • Scalable with more data

Future improvements:
- Better smoothing
- Larger datasets
- Multiple word predictions