Skip to content

Developing an AI model to predict next words of a text - Trained Tensorflow's Sequential model on text from fiction books

License

Notifications You must be signed in to change notification settings

RJ601/Next-Word-Prediction-Using-Word-Level-LSTM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📜 Next-Word Prediction Using Word-Level LSTM

An AI model that predicts the next word in a sentence using a word-level LSTM.


✨ Features

  • 🔠 Word-level tokenization for deeper semantic understanding. image

  • 🤖 LSTM-based Sequential model trained on Harry Potter and Percy Jackson books. image

  • 📊 Model comparison across different LSTM layers and architectures in Model_Comparisons.csv.

  • 📉 Loss graphs included for visualizing training performance. image

  • 💾 Demo predicts the next word based on custom input. demo11_n15_wholesent demo12_n15_wholesent demo14_n15_wholesent

    Note: Sometimes makes predictions that cannot be found in the original dictionary demo16_n15_wholesent


🛠 Installation and Setup

  1. Clone the repository:
git clone https://github.com/RJ601/Next-Word-Prediction-Using-Word-Level-LSTM.git
cd Next-Word-Prediction-Using-Word-Level-LSTM
  1. Install dependencies:
pip install -r requirements.txt

🚀 Usage

👉 Open LSTM_Model_Training.ipynb, optionally modify the hyperparameters, and run all cells.


🔧 Tools, Libraries, and Dataset

  • Platform: Jupyter Notebook
  • Language: Python 3.9.23

Libraries Used:

  • tensorflow==2.19.0
  • keras==3.10.0
  • scikit-learn==1.6.1
  • matplotlib==3.9.4
  • numpy==2.0.2
  • pandas==2.3.0
  • nltk==3.9.1

📝 License

This project is licensed under the MIT License. Feel free to use, modify, or share it with attribution.

About

Developing an AI model to predict next words of a text - Trained Tensorflow's Sequential model on text from fiction books

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published