This project implements a word-level Next Word Prediction and Search Autocomplete system using an LSTM neural network. The model is trained on real-world search-style questions from the Quora Question Pairs dataset and deployed using Streamlit for interactive usage.
- Dataset Name : Quora Question Pairs
- Total Questions : 150,000 (subset used)
- Total Tokens : ~1.4 million (14 lakh)
- Language : English
- Data Type : Natural user-generated questions
- Use Case : Search queries & autocomplete
The Quora dataset is well-suited for autocomplete tasks because it closely resembles real Google search queries: short, natural, and intent-driven questions.
- Model Type : Word-level LSTM
- Embedding Size : 128
- LSTM Hidden Units : 256
- Number of Layers : 1
- Sequence Length : 4 words
- Loss Function : CrossEntropyLoss
- Optimizer : Adam
The model predicts the next word based on the previous N words and is capable of generating coherent query continuations.
✔ Progressive Query Expansion
- Predicts words one-by-one
- Expands the original query step-by-step
✔ Alternative Sentence Suggestions
- Generates multiple full sentences
- Predicts the next 4 words for each alternative
- Same base query, diverse completions
✔ Single Input, Dual Output
- One search bar
- One Predict button
- Parallel outputs on the same page
✔ Clean & Wide UI
- Built entirely with Streamlit
- Side-by-side results for better readability
- Framework : Streamlit
- Runtime : CPU
- UI Style : Wide layout with parallel columns
- Interaction:
- User types a query once
- Clicks "Predict"
- Sees progressive + alternative suggestions
- Search engine autocomplete demo
- NLP / Deep Learning portfolio project
- Understanding sequence modeling with LSTM
- Real-world text generation example
- LinkedIn / resume showcase
- Implement live autocomplete for instant suggestions as the user types.
- Train on larger and more diverse datasets to improve generalization.
- Enhance the UI with progressive word highlights and interactive features.
- Built by: Aman Verma
- Domain : Deep Learning | NLP | PyTorch
Give a Star to repo if you like it!