https://github.com/amarnarayandwivedi/lstm_text_predictor
NextWordPredictor is an advanced natural language processing (NLP) model designed to predict the next word in a sequence of text using a Recurrent Neural Network (RNN) with Long Short-Term Memory (LSTM) cells.
https://github.com/amarnarayandwivedi/lstm_text_predictor
lstm-neural-networks python rnn-tensorflow streamlit
Last synced: 7 months ago
JSON representation
NextWordPredictor is an advanced natural language processing (NLP) model designed to predict the next word in a sequence of text using a Recurrent Neural Network (RNN) with Long Short-Term Memory (LSTM) cells.
- Host: GitHub
- URL: https://github.com/amarnarayandwivedi/lstm_text_predictor
- Owner: AmarNarayanDwivedi
- Created: 2025-01-12T13:58:26.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-12T14:04:44.000Z (9 months ago)
- Last Synced: 2025-01-20T09:13:39.216Z (9 months ago)
- Topics: lstm-neural-networks, python, rnn-tensorflow, streamlit
- Language: Jupyter Notebook
- Homepage: https://rnn-lstm-text-predictor.streamlit.app/
- Size: 12.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Project Description: Next Word Prediction Using LSTM
#### Project Overview:This project aims to develop a deep learning model for predicting the next word in a given sequence of words. The model is built using Long Short-Term Memory (LSTM) networks, which are well-suited for sequence prediction tasks. The project includes the following steps:
1- Data Collection: We use the text of Shakespeare's "Hamlet" as our dataset. This rich, complex text provides a good challenge for our model.
2- Data Preprocessing: The text data is tokenized, converted into sequences, and padded to ensure uniform input lengths. The sequences are then split into training and testing sets.
3- Model Building: An LSTM model is constructed with an embedding layer, two LSTM layers, and a dense output layer with a softmax activation function to predict the probability of the next word.
4- Model Training: The model is trained using the prepared sequences, with early stopping implemented to prevent overfitting. Early stopping monitors the validation loss and stops training when the loss stops improving.
5- Model Evaluation: The model is evaluated using a set of example sentences to test its ability to predict the next word accurately.
6- Deployment: A Streamlit web application is developed to allow users to input a sequence of words and get the predicted next word in real-time.