The Problem

Smartphone users frequently type phrases that contain predictable next words.

The goal of this project is to build a next-word prediction system using the SwiftKey text dataset.

The application accepts a multi-word phrase and predicts one likely next word.

The Data

The model was developed using the SwiftKey dataset containing text from:

  • Blogs
  • News
  • Twitter

The text was cleaned and tokenized to identify word sequences.

Exploratory analysis was used to understand word frequencies and the distribution of words per line.

The Prediction Algorithm

The application uses an n-gram based approach.

  • A bigram model captures pairs of consecutive words.
  • Word frequencies are used to select likely predictions.
  • The unigram model provides a fallback when a suitable bigram is not available.

This provides a simple and efficient approach suitable for a real-time Shiny application.

The Shiny Application