Problem & Goal

  • Predict the next word for any given phrase
  • Demonstrate NLP modeling using R and Shiny
  • Provide an interactive web app accessible online
  • Inspired by predictive text systems like keyboards and chatbots

Algorithm Overview

  • Text cleaning and tokenization of English corpus
  • Created n-gram frequency tables (uni-, bi-, tri-gram)
  • Implemented back-off logic: trigram → bigram → unigram
  • Simple prediction model for real-time response

The App

User Experience

  • Fast, minimal, and intuitive
  • Example predictions:
    • “data” → science
    • “artificial” → intelligence
    • “machine” → learning
  • Real-time feedback using reactive components

Future Work

  • Add top-3 suggestions
  • Integrate deep learning models (LSTM / transformer)
  • Train on larger text corpora
  • Optimize performance for mobile devices