2025-07-03

Next Word Prediction App

How the Prediction Works

  • Uses the N-gram model (specifically, trigrams)
    • Trains on a small sample corpus of English sentences
    • Breaks sentences into 3-word sequences (“trigrams”)
    • When a user enters two words, the app searches for matching trigrams to predict the next word
  • Algorithm chooses the most frequent matching next word

How to Use the App

  • Open the app link
  • Enter a phrase of at least two words (e.g., “I love”)
  • Click “Predict Next Word”
  • The app displays its prediction instantly!

Examples: - I lovedata - machine learningis - books aresources

Experience & Reflections

  • Learned to deploy Shiny apps publicly using shinyapps.io
  • Overcame technical issues with R versions and package dependencies
  • Gained hands-on experience with text prediction using N-gram models
  • Realized the importance of clean data and reproducible environments
  • If I had more time/data, I’d train on a much larger corpus for improved accuracy

Why My App & What’s Next?

  • Easy to use, responsive, and demonstrates the fundamentals of NLP
  • Clean, simple code—ready for further development
  • I’m confident in deploying real data science products
  • Would love to take this further with larger datasets, better models, or as part of a real product team

Thank you for viewing my project!