How jayanthcsv/nextwordpredictor works
This is a Shakespeare-text next-word prediction application: users enter text in a Streamlit interface, which tokenizes and pads it, runs the saved LSTM, and displays the predicted word. The README also documents the data-preparation, training, and evaluation stages; those stages are represented at the notebook path, but its contents were not sampled. The app’s model and tokenizer loading and prediction calls are visible in app.py.
Main entry points: app.py Next-word prediction · experiment.ipynb Text preprocessing · hamlet.txt Hamlet text · nextwordlstm.h5 Saved LSTM
Components 9
Data and training
- Hamlet text
hamlet.txt - Text preprocessing
experiment.ipynb - LSTM training
experiment.ipynb - Model evaluation
experiment.ipynb
Prediction app
- Saved LSTM
nextwordlstm.h5 - Saved tokenizer
tokenizer.pickle - Text input and results
app.py - Next-word prediction
app.py
Other components
- User
Connections 8
- Hamlet text → Text preprocessing: provides text
README.md - Text preprocessing → LSTM training: prepares sequences
README.md - LSTM training → Model evaluation: evaluated by
README.md - User → Text input and results: enters text
app.py - Text input and results → Next-word prediction: invokes
app.py - Next-word prediction → Saved tokenizer: loads and encodes
app.py - Next-word prediction → Saved LSTM: loads and predicts
app.py - Next-word prediction → Text input and results: returns word
app.py