{"id":26455063,"url":"https://github.com/harmeshgv/lstm-nextwordpredictor","last_synced_at":"2026-05-11T03:48:55.847Z","repository":{"id":281534517,"uuid":"898649659","full_name":"harmeshgv/LSTM-NextWordPredictor","owner":"harmeshgv","description":"An LSTM-based next-word prediction model leveraging tokenized text sequences and an embedding layer. The model employs stacked LSTM layers with dense softmax classification for vocabulary prediction. Includes data preprocessing, model training, and an interactive CLI for real-time inference.","archived":false,"fork":false,"pushed_at":"2025-03-18T10:30:57.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T10:35:52.825Z","etag":null,"topics":["containerization","docker-container","lstm-neural-networks","nlp-machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harmeshgv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T19:19:40.000Z","updated_at":"2025-03-18T10:31:00.000Z","dependencies_parsed_at":"2025-03-09T21:32:40.986Z","dependency_job_id":null,"html_url":"https://github.com/harmeshgv/LSTM-NextWordPredictor","commit_stats":null,"previous_names":["harmeshgv/lstm-nextwordpredictor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmeshgv%2FLSTM-NextWordPredictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmeshgv%2FLSTM-NextWordPredictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmeshgv%2FLSTM-NextWordPredictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmeshgv%2FLSTM-NextWordPredictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harmeshgv","download_url":"https://codeload.github.com/harmeshgv/LSTM-NextWordPredictor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244300964,"owners_count":20430842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containerization","docker-container","lstm-neural-networks","nlp-machine-learning","tensorflow"],"created_at":"2025-03-18T20:29:52.293Z","updated_at":"2026-05-11T03:48:55.817Z","avatar_url":"https://github.com/harmeshgv.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here’s how to use the project both manually and with Docker.\n\n---\n\n# 🚀 Next Word Prediction using LSTM\n\n## Overview\nThis project implements a next-word prediction model using LSTM (Long Short-Term Memory) networks. It trains on the text from `blue_castle.txt` and learns to predict the next word based on the given input sequence.\n\n---\n\n## 🔹 Option 1: Manual Setup\n\n### 1️⃣ Clone the Repository\n```sh\ngit clone https://github.com/harmeshgv/LSTM-NextWordPredictor.git\ncd LSTM-NextWordPredictor\n```\n\n### 2️⃣ Create and Activate Virtual Environment  \n#### ➤ Windows (cmd or PowerShell):\n```sh\npython -m venv venv\nvenv\\Scripts\\activate\n```\n#### ➤ macOS/Linux:\n```sh\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### 3️⃣ Install Dependencies\n```sh\npip install -r requirements.txt\n```\n\n### 4️⃣ Train the Model  \nRun the training script to generate `next_word.keras`:\n```sh\npython train_model.py\n```\n\n### 5️⃣ Run Predictions  \nOnce trained, test the next-word prediction:\n```sh\npython predict.py\n```\nTry:\n```sh\nEnter your line: The book was\n```\nExpected output:\n```sh\ncastle\n```\nTo exit, type `0`.\n\n---\n\n## 🔹 Option 2: Using Docker 🐳\n\n### 1️⃣ Clone the Repository  \n```sh\ngit clone https://github.com/harmeshgv/LSTM-NextWordPredictor.git\ncd LSTM-NextWordPredictor\n```\n\n### 2️⃣ Build the Docker Image  \n```sh\ndocker build -t lstm-nextword-predictor .\n```\n\n### 3️⃣ Run the Container  \n```sh\ndocker run --rm -it lstm-nextword-predictor\n```\n\nThis will automatically train the model and start the prediction script.\n\n---\n\n## 📝 Project Files\n- `Next_word_prediction_using_LSTM_walkthrough.ipynb` - Jupyter Notebook with explanations\n- `train_model.py` - Preprocesses text, trains the LSTM model, and saves it\n- `predict.py` - Loads the trained model and makes predictions\n- `requirements.txt` - Required dependencies\n- `Dockerfile` - Docker setup for running the project\n- `README.md` - This guide\n\n---\n\n## 🔥 Notes\n- **For manual setup**, train the model before running predictions.\n- **With Docker**, everything is automated! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmeshgv%2Flstm-nextwordpredictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmeshgv%2Flstm-nextwordpredictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmeshgv%2Flstm-nextwordpredictor/lists"}