2026-11-17

1. Introduction to NextWord

Predictive Text Mining Application

The Problem

Typing messages and sentences can take time, especially when using mobile devices.

Our Solution

NextWord is a predictive text application that suggests the next possible word based on the text entered by the user.

Project Objectives

  • Develop a next-word prediction model.
  • Analyze English text using the SwiftKey dataset.
  • Build an interactive application using R Shiny.
  • Improve typing speed and user convenience.

2. How Does NextWord Work?

N-gram Language Model

NextWord uses an N-gram language model trained using English text from three datasets:

  • Blogs
  • News
  • Twitter

How the prediction works:

  1. Unigram: Analyzes individual word frequencies.
  2. Bigram: Analyzes pairs of consecutive words.
  3. Trigram: Analyzes groups of three consecutive words.
  4. Interpolation: Combines unigram, bigram and trigram information to calculate prediction scores.

The model analyzes the user’s input and returns the highest-scoring next-word suggestions.

3. Predictive Performance

Comparing the Original and Improved Models

The project evaluates the models using prediction accuracy and other performance measurements.

## 
## 
## |Metric         | Original_Backoff| Improved_Interpolation|
## |:--------------|----------------:|----------------------:|
## |Top-1 Accuracy |            11.34|                   7.53|
## |Top-2 Accuracy |            17.01|                  11.65|
## |Top-3 Accuracy |            20.82|                  16.29|

Additional Model Evaluation

## 
## 
## |Model                          | Bigram_Count| Trigram_Count| Total_Parameters| Memory_MB| Prediction_Time_Seconds|
## |:------------------------------|------------:|-------------:|----------------:|---------:|-----------------------:|
## |Original Full Backoff          |       894617|       1854199|          2824984| 468.78311|                    1.72|
## |Improved Compact Interpolation |        10000|         10000|            96168|   8.59932|                    0.72|
## Perplexity results:[1] 2293.523

These measurements help us understand and compare the performance of the two models.

4. Demonstration of the NextWord Application

How the Application Works

  1. Enter a sentence or a few words.
  2. Select the number of predictions.
  3. Click the Predict button.
  4. View the suggested next words.

The application also includes a Data Dashboard.

Application Screenshot

```

5. Why NextWord?

Key Benefits

  • Interactive: Users can enter their own text and receive suggestions.
  • Data-driven: Predictions are based on patterns learned from real text.
  • User-friendly: A simple interface makes the application easy to use.
  • Expandable: The project can be improved using larger datasets and advanced language models.

Future Scope

  • Improve prediction accuracy.
  • Support additional languages.
  • Develop a mobile-friendly version.
  • Explore advanced machine learning and deep learning models.

NextWord

Making typing faster, smarter and easier!