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.



Model Description: Natural Language Processing II

Algorithm And Process Flow

Algorithm Used For Probablity Calculation:

  • Markov N-Gram Model
  • Good Turing Estimate (Discounted Counts)
  • Kneser Ney Algorithm
  • Stupid Back-off

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 and match words typed in N-gram data with N-1 words
  5. Choose Top 3 words with Highest Probablities