10/10/2020

The Problem

How to predict the next word of a phrase.

The Solution

The PreDict algorithm. You can access the demo here.

Just type your phrase and click in Predict

The Tech Stuff

  • The algorithm analyses the biggest n-gram that it can, from one to three.
  • It tries to guess the next word based on the most frequent next word for that n-gram.
  • If it does not know that n-gram, it will fall back to the next smallest one, ie, from 3-gran to 2-gran, from 2-gran to 1-gran, from 1-gran to 0-gran.
  • 0-gran always predict the word ‘the’.

The Thanks!