Next Word Predictor

A Shiny App for Predicting the Next Word in a Phrase

Why Predict Words?

  • Smart keyboards and messaging apps often suggest the next word
  • Useful for:
    • Improving typing speed
    • Assisting accessibility tools
    • Autocomplete features

Goal: Build a model that can predict the next word from a given phrase using real-world language data.

How It Works

Data Source: - SwiftKey Dataset - Text from blogs, news, and Twitter

Method: - Tokenize text into Bigrams - Clean and normalize input - Match user input to known patterns

Prediction Logic:

```r predict_next_word <- function(input, ngram_data_list) { # match user phrase to bigrams }

đź–Ą The App (Demo Instructions)

About the App

  • Built with Shiny
  • Loads cleaned N-gram data
  • Input: Any phrase (e.g. “hello”)
  • Output: Predicted next word

How to Use:

  1. Enter a phrase (at least one word)
  2. Click “Predict Next Word”
  3. View the predicted result

👉 Hosted on shinyapps.io

Results & Next Steps

Performance: - Predicts common word pairs well - Example: - Input: "hello" → Output: "world"

Next Improvements: - Add Trigram & Quadgram support - Implement Katz Backoff or Stupid Backoff - Allow mobile deployment

Final Thoughts

  • Simple but effective model

Foundation for more advanced NLP apps