Slide 1 — Overview

We built a lightweight predictive text model using R.
The system predicts the next word based on what the user types, using n-gram language modeling.
The final product is a user-friendly Shiny app deployed on shinyapps.io.

Slide 2 — Data & Preprocessing

  • Cleaned the text corpus
  • Generated unigram, bigram, and trigram frequency tables
  • Removed punctuation, stopwords, and numbers
  • Stored the n-gram datasets in CSV format for fast lookup

Slide 3 — Prediction Algorithm

Our backoff logic:

  1. Check the last two words → trigram prediction
  2. If no match → check last one word → bigram prediction
  3. If still no match → return the most frequent unigram

Fast, deterministic, and lightweight.

Slide 4 — Shiny App

  • User types a phrase in the input box
  • App runs the prediction model
  • Displays the most probable next word
  • Deployed on shinyapps.io

Slide 5 — Why It Matters

  • Useful for keyboard suggestions, writing assistants, and chat apps
  • Lightweight → no GPU required
  • Extendable to advanced NLP / deep learning
  • Shows real-world usage of R + Shiny + NLP