/Word-Prediction-Using-Ngrams

A simple NLP project for word prediction using N-grams.

Primary LanguageJupyter NotebookMIT LicenseMIT

Word Predictor using N-Gram

A simple NLP project for word prediction using N-grams.

Step 0: Importing our Corpus

Read the text corpus from a local file using Python.

Step 1: Preprocessing

Remove specific patterns from the text for preprocessing.

Step 2: Creating Our Standard Dataset

Create a clean text file as the standard dataset for further processing.

Step 3: Create Our Matrices

Create matrices for tokens, bigrams, and trigrams from the clean dataset.

Step 4: Word Predicting

4-1: Bigram

Predict the next word based on the last word entered by the user using bigrams.

4-2: Trigram

Predict the next word based on the last two words entered by the user using trigrams.

Step 5: Final Results

Display the final results of word prediction with probabilities for bigrams and trigrams.