Next-Word Prediction Project

Panhapin Theang

Introduction

  • Objective:
    Create a Shiny app to predict the next word based on an input phrase.

  • Deliverables:

    • An interactive Shiny app hosted on shinyapps.io.
    • A 5-slide presentation explaining the app and algorithm.
  • Applications:

    • Typing assistance tools (e.g., predictive text).
    • Enhanced user experience for messaging platforms.

Algorithm Overview

  • Approach:
    • Built on a n-gram model that predicts the next word based on prior context.
    • The model uses a dataset of common word sequences (phrases) to compute probabilities.
  • Preprocessing Steps:
    • Text normalization: lowercasing, tokenization, and removal of special characters.
    • Creation of an n-gram dataset to map phrases to probable next words.

Shiny App Features

  • Interactive UI:
    • Input a phrase in the text box.
    • Press “Predict” to generate the next word.
  • Real-Time Predictions:
    • Minimal latency for quick results.
    • Handles phrases of varying lengths.
  • Deployment:
    • Hosted on shinyapps.io for public access.

Usage Instructions

  1. Open the Shiny app using the provided link.
  2. Enter a phrase in the input box (e.g., “how are”).
  3. Click the “Predict Next Word” button.
  4. The predicted word will appear in the output section.

Conclusion

  • Key Strengths:
    • Simple, user-friendly interface.
    • Real-time next-word predictions.
  • Future Enhancements:
    • Incorporate a larger dataset for improved accuracy.
    • Upgrade to transformer-based models for contextual understanding.
  • Potential Applications:
    • Typing tools, chatbots, and AI-driven messaging systems.

Thank you! Questions?