Predict Next Word

P Bhanuprakash Reddy
02-Dec-2017

Context

  • Objective: Create an Application to predict next word based on the words provided by the user

  • Methodology: The Application is built on Shiny interface. The algorithm used is “Katz Back Off” algorithm, where we use upto 3 words - Unigrams, Bigrams & Tri grams, to predict the next word.

  • Dataset: The dataset used for the application is the data provided with the assignment.

Algorithm

The algortihm used is “Katz Back Off”. Definition ( from Wiki) is as given below

Katz back-off is a generative n-gram language model that estimates the conditional probability of a word given its history in the n-gram.It accomplishes this estimation by “backing-off” to models with smaller histories under certain conditions. By doing so, the model with the most reliable information about a given history is used to provide the better results.

We have used Unigrams, Bigrams & Trigrams for predicting next word. Hence, the application needs at lease two words to predict the next word.

App - Introduction

  • The Application is a Shiny App. It uses the Katz Back Off algorithm as explained in previous slides and the datasets provided with the assignment - samples from twitter feed, news articles and novels.
  • It needs at least two words for showing a output. The two words are provided by the user on the web interface as input.
  • Based on the input, the output is shown on the web interface itself.

App - Instructions

  • The app is hosted on https://bhanuprakash.shinyapps.io/CapstoneProject/
  • On clicking the link, the user is led to a web based interface.
  • The app asks the user for entering text on the left hand side - “Enter Your Input Text”
  • The next word predicted by the app is shown on the right hand side - “ Prediction”
  • The User needs to enter at least two words as Input else NULL is displayed as Output.

Practical Advantages & Uses of the App

  • The App has a very less response time.
  • Can be used in applications to help people write any content like “Swift Key”.
  • The App can also be extended to interact with the users. With its low response time it can help in chatbot applications.

                THANK YOU!