PHP Classes

PHP NGram Predictor: Predict the next characters based on the previous

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-04-30 (5 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 29 All time: 10,900 This week: 138Up
Version License PHP version Categories
ngrampredictor 1.0BSD License7Searching, Text processing, Artificia..., P..., P...


This package can predict the following characters based on the previous ones.

It can be trained with sentences with valid words to learn the most common words users may type when asking questions.

The package can parse a sequence of characters a user may have typed and predict the following letters based on what it learned during the training phase.

It uses an N-Gram model, where the probability of each character is calculated based on the previous N characters.

The class includes methods for converting text to integers, creating a dictionary of character sequences, finding the previous(todo) and following characters based on a given sequence, and predicting the most likely next character based on a given sequence.

Picture of JImmy Bo
  Performance   Level  
Name: JImmy Bo is available for providing paid consulting. Contact JImmy Bo .
Classes: 14 packages by
Country: United States United States
Age: ???
All time rank: 1250178 in United States United States
Week rank: 4 Up1 in United States United States Up
Innovation award
Innovation award
Nominee: 8x

Winner: 1x

  Files folder image Files  
File Role Description
Plain text file class.npredict.php Class PHP Class for N-Gram Prediction
Accessible without login Plain text file example.npredict.php Example example of using the NGramPredictor class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,900
This week:138Up