2026-06-14

Slide 1: Introduction

  • This project builds a Next Word Prediction App using R Shiny
  • The goal is to predict the next word based on a given phrase
  • Useful for:
    • Text auto-completion
    • Messaging apps
    • Search engines

Slide 2: Algorithm

  • Implemented a simple n-gram model (bi-gram approach)
  • The model:
    • Takes the last two words from input
    • Matches with stored word pairs
    • Returns the most likely next word
  • Example:
    • Input: “I am” → Output: “happy”

Slide 3: Application

  • Built using Shiny (R)
  • Features:
    • Text input box
    • Predict button
    • Displays next word instantly
  • User enters a phrase → clicks predict → result appears

Slide 4: How It Works

  • Input text is cleaned (lowercase, trimmed)

  • Last two words are extracted

  • Compared with n-gram dataset

  • Matching result is displayed

  • If no match:

    • Displays: “No prediction”

Slide 5: Conclusion

  • Simple and effective text prediction system
  • Easy to use and fast response
  • Can be improved by:
    • Using larger datasets
    • Applying advanced NLP models
    • Adding multiple predictions
  • Demonstrates practical use of data science + Shiny apps