Word prediction with Natural Language Processing

author: yatinm

date: December 02, 2017

Credits:
The Coursera Data Science Team
SwiftKey, San Francisco, CA

The Problem Statement

Every mobile device (tablet or smart phone) needs a keyboard that predicts the next word to be typed:

  • Mobile Keyboards are small
  • Human fingers are relatively stubby
  • Users unable to use all fingers for typing as they hold the phone
  • Most people are only able to use their thumbs for typing

Predictive keyboards are therefore a neccessity for a meaningful typing experience on mobile devices

Word prediction is possible using Machine Learning, Natural Language Processing and a text database (called “corpus”)

Machine Learning (training) with a corpus

  • Swiftkey is a supplier of mobile keyboard technology
    • Their corpus is proven, diverse and large (~600Mb)
  • The data is cleaned by removing profanity, punctuations, ..
  • The training phase begins by converting the corpus to ngrams
    • An ngram is a sequence of words that appear together
      Eg.: “The brown”, “The brown dog”, “The brown dog jumped”, ..
  • A dictionary is created with ngram frequencies for prediction
Ngrams Prediction Score
The brown dog jumped on 283
The brown dog jumped out 270
The brown dog jumped in 221
Hello welcome to 5051
Hello welcome back 954

The prediction/inference Application

  • The prediction stage uses the pre-created dictionary
  • The app provides an input textbox and provides predictions
    • It will predict a minimum of 3 words in all cases alt text
  • Accuracy using random 10 blog/news/tweets from today: 60%

In Conclusion

  • We have an app developed using a sophisticated corpus
    • Provides 60% accuracy without self-learning
  • It is quick to load and quick to predict
  • It provides a simple and intuitive user-interface
  • Can be easily enhanced for learning user's preferences
  • Can be easily adapted for other context-specific corpuses

Live link to the app: https://yatinm3.shinyapps.io/NLPpredictorFinal/

We look forward to your investment in our copmany.

!!! THANK YOU !!!