Skip to content

sagar-grv/Predictive-word-Model

Repository files navigation

Predictive Keyword Model

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.

🚀 Features

  • 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.

🛠️ Installation

  1. Clone the repository:

    git clone https://github.com/sagar-grv/Predictive-word-Model.git
    cd Predictive-word-Model
  2. Install dependencies:

    pip install -r requirements.txt

🎮 Usage

Option 1: Streamlit Interface (Recommended)

Run the Streamlit app for a polished user experience.

streamlit run run_model_st.py

Access the app at: http://localhost:8501

Option 2: Gradio Interface

Run the Gradio interface for a simple testing environment.

python run_model.py

Access the app at: http://127.0.0.1:7860

📂 Project Structure

  • 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.

🧠 Model Architecture

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors