11/13/2020

Word Prediction

Prediction of of subsuquent words while a user types on a keyboard cannot be over emphasised.

In this presentation I outline how the word prediction algoirithm works. An attemp to explain how the app is to be used is also made.

Description of the Algorithm

This work implements Markov algorithm is based Were weuse n-moments of the past as the basis for predicting the future.

Markov Model recieves a phrase such as a “I like a blind” then it find the words that have the highest probablity to follow after the given string of text.

Therefore the algorithm performas the following tasks:

  • gets the current phrase and searches for the appropriate combination.
  • Computes probabilities of possible phrases.
  • Then the algorithm peaks the best options for the entered text.

Functionality of The Program

To implement the algorith I used Shiny which is a web application framework for R. The interface is not very complicated but is sufficient for use as proof of concerpt. The shiny app has the following components: 1. The menu which has the instructions and also the input field for text. 2. The main contet area where the predictions are desplayed 3. The UI code that interacts with the user 4. It also has the server coder that processes input from the UI and other server side logic 5. There is a file called predict.R that does all the computations such as calling the n-gram models to do the actual prediction

Show to Use The app

All you need to do is type you words in the the only input field shown on the user interface. You can type the requied number of words in the input and then wait for the server to gues the rest.To work with the app follow this link https://diskava.shinyapps.io/capstone-week-7/

The word predictor UI