Skip to content

rosesonfire/word-prediction

Repository files navigation

Word Prediction

A Python project for implementing word prediction algorithms.

Algorithms

  • Naive word prediction: A simple approach that predicts the next word or word sequence based on frequency counts of word sequences in the training corpus.

Caveates/Features:

  • Assumes there are no broken sentences, i.e. new line within a sentence.
  • Is case sensitive
  • Considers only as appostrope

Installation

Prerequisites

  • Python 3.13+
  • Redis server

Setup

  1. Install dependencies:
pip install -e .
  1. Start Redis server:
redis-server

Usage

Before running, update the FILE_NAME variable in src/config.py to point to your corpus text file.

Run the prediction script:

./predict-next-word.sh
./predict-next-word-sequence.sh

Demo

About

Attempting different algorithms for predicting the next word

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors