This is a simple web app that uses a trained LSTM model to predict the next few words in a sentence using deep learning. It’s built with TensorFlow, Keras, and Streamlit, and supports live prediction with a modern UI.
- 🔮 Predict up to 5 next words using a trained model
- 🎯 Top 3 predicted completions (beam search style)
- 🖌️ Modern and responsive UI
- 🔁 Live prediction as you type
- ⚡ Fast loading with model caching
You can try the app here: streamlit.app
├── app.py # Streamlit app
├── NextWordPredictor.ipynb # Training Model
├── nwp_model.keras # Trained Keras model
├── tokenizer.pkl # Tokenizer used for training
├── requirements.txt # Python dependencies
└── README.md # (This file)
- Clone the repo:
git clone https://github.com/ArmanSinghOP/NWP.git
cd NWP- Install dependencies:
pip install -r requirements.txt- Run the app:
streamlit run app.py- Push this repo to GitHub (public repo required for free tier)
- Go to Streamlit Cloud
- Click "New App" > Connect to your GitHub repo
- Set
app.pyas the main file and deploy!
Make sure your model (
.keras) andtokenizer.pklare both under 100 MB each for free hosting.
streamlit
tensorflow==2.15.0
numpy
The model is a trained LSTM built on a general English sentence corpus for word-level prediction. Make sure the tokenizer used here matches the one used during training.