TEXT PREDICTION APP

Mohammed Teslim

2025-01-18

Introduction

This presentation introduces a predictive text application that suggests the next word a user might type.

The app uses an n-gram language model trained on a large corpus of text from blogs, news articles, and Twitter posts.

Goal: To provide a fast and accurate word prediction experience.

Algorithm

The app uses a statistical language model based on n-grams:

Prediction Logic:

  1. The app first looks for matching quadgrams based on the last 3 words entered.
  2. If no quadgram is found, it “backs off” to trigrams, then bigrams, and finally unigrams.
  3. A discount factor (lambda) is applied during backoff to adjust probabilities.

The App

The Shiny app provides a simple interface:

Instructions:

  1. Type a phrase in the input box.
  2. Click the “Predict” button.
  3. View the predicted next word(s).

Link to App: https://ml73o6-mohammed-teslim.shinyapps.io/Teslim_NLP_Project/

How it Works

Conclusion

This app demonstrates the power of n-gram models for next-word prediction.

Future Improvements:

Thank you!