Text Prediction: Typing Easy and Fast

Deepak Kumar
16 July, 2016

Natural Language Processing

Text Prediction: Problem Description

Why We Need Text Prediction App

Current Difficulties:

  • Consume Time
  • Incorrect typing
  • Wrong choice of word


Solution As Predictive Text Model App:

  • Tap Suggested word instead of typing full text
  • Increase Typing Speed
  • Improve Accuracy
  • Help With Rich Vocabulary Database

Model Description: Natural Language Processing I

Introduction

Definition: N-Gram

An n-gram model is a type of probabilistic language model for predicting the next item in such a sequence in the form of a (n-1)-order Markov model.[2] n-gram models are now widely used in probability, communication theory, computational linguistics (for instance, statistical natural language processing), computational biology (for instance, biological sequence analysis), and data compression. Two benefits of n-gram models (and algorithms that use them) are simplicity and scalability - with larger n, a model can store more context with a well-understood space-time tradeoff, enabling small experiments to scale up efficiently.

    Training & Data
  • US english data source from blog, news and twitter, ~4 Million words used in training Model with N-grams where N=1 to 4
  • Preplexity Score Calculated On Test data To Choose Best Algorithm (Test data with ~20k words)
  • 15.67% Of Accuracy On test data
  • R 3.3.3 open source software used; Windows 7; 2 GB RAM DDR2


Model Description: Natural Language Processing II

Algorithm And Process Flow

    Process Steps For Text Prediction
  1. Created N-grams where N = 1 to 4
  2. Discount Actual counts to assign the mass to words Not Appeared In training Data
  3. Final Probablities With Kneser Ney
  4. Search words typed in N-gram data with N-1 words

App Description

How It Works

App
    App Using Instruction:
  • Type in text box given on the top right panel
  • App Will suggest 3 possible next words
  • Tap on the word it will automatically fills the textbox
  • App suggest correct spell of the last word typed if incorrectly in textbox