Slide 1: Title Slide

Next Word Prediction System using R & Shiny

Capstone Project - Data Science with R
Developed by: Annappa Madiwal

Slide 2: Problem Statement

Typing long sentences is time-consuming and error-prone.

Users often struggle with: - Slow typing speed - Repetitive word entry - Lack of smart prediction tools

This project builds a system that predicts the next word based on input text using Natural Language Processing.

Slide 3: Methodology (N-gram Model Approach)

The system uses statistical language modeling:

  • Bigram Model: predicts next word using 1 previous word
  • Trigram Model: predicts next word using 2 previous words
  • Frequency-based prediction using dataset counts
  • Data stored in:
    • bigram_freq.rds
    • trigram_freq.rds

Prediction logic selects the highest frequency matching word.

Slide 4: Implementation (Shiny App)

Built using R Shiny framework:

Features: - User text input (textInput) - Prediction button (actionButton) - Real-time output display (textOutput)

Core function: - Uses dplyr for filtering frequency tables - Returns most probable next word - Fallback: “the” if no match found

Technology Stack: - R Programming - Shiny - dplyr - NLP (N-gram model)

Slide 5: Conclusion & Future Scope

Conclusion: The system successfully predicts the next word using statistical NLP models in R.

Future Improvements: - Use deep learning (LSTM models) - Improve accuracy with larger datasets - Add mobile-friendly UI - Multi-word prediction suggestions

Thank You!