A deep learning-based text prediction tool trained on Sherlock Holmes stories. This project utilizes an LSTM (Long Short-Term Memory) neural network to predict the next word in a sequence, offering a smart "predictive keyboard" experience.
- Next-Word Prediction: Suggests the most likely next words based on input text.
- Deep Learning Core: Built with PyTorch using Embedding and LSTM layers.
- Interactive Web UI:
- Streamlit: A modern, clean web interface.
- Gradio: An alternative quick-prototyping interface.
- Customizable: Easy to retrain on different datasets.
-
Clone the repository:
git clone https://github.com/sagar-grv/Predictive-word-Model.git cd Predictive-word-Model -
Install dependencies:
pip install -r requirements.txt
Run the Streamlit app for a polished user experience.
streamlit run run_model_st.pyAccess the app at: http://localhost:8501
Run the Gradio interface for a simple testing environment.
python run_model.pyAccess the app at: http://127.0.0.1:7860
run_model_st.py: Main Streamlit application file.run_model.py: Gradio application file.predictive_keyword_model.ipynb: Original research and training notebook.predictive_keyboard_model.pth: Pre-trained model weights.requirements.txt: Python package dependencies.sherlock-holm.es_stories_plain-text_advs.txt: Training dataset.
- Embedding Layer: Converts words into dense vectors.
- LSTM Layer: Captures sequential dependencies in the text.
- Fully Connected Layer: Maps LSTM output to vocabulary size for prediction.
Created by Sagar grv