03 December 2025

Overview - A Shiny application to predict the next word - Uses a simple Bigram language model - Input: English phrase - Output: Most likely next word - Deployed online using shinyapps.io

Data & Algorithm - Small English text sample used for training

  • Text cleaned: lowercase, removed punctuation/spaces

  • Build word pairs (bigrams)

  • For user input:

    • Take last word
    • Find most common next word in training data
    • If no match → return fallback word

The Shiny App

  • User interface:
    • Text input (phrase without last word)
    • Predict Next Word button
  • Server logic:
    • Calls predict_next_word() from model.R
  • Hosted online for public access

App Link:
https://sanjanagowda.shinyapps.io/NextWordApp/

How to Use

  1. Open the app in your browser
  2. Enter a phrase (e.g., "i love")
  3. Click Predict Next Word
  4. View model output instantly

Example input / output: i love"data"

Evaluation & Future Work

Evaluation - App loads properly ✔️

  • Predicts one word for all valid inputs ✔️
  • Tested using 5 tweet/news style phrases ✔️
  • Simple and fast ✔️

Future Enhancements

  • Larger corpus for better accuracy
  • Add trigrams & backoff model
  • Neural network based language model

Thank you!