A Django-based web application that predicts the next word in a 50-word sentence using a TensorFlow model. The interface follows a cyberpunk aesthetic with neon animations and a dynamic particle background.
- Overview
- Features
- Technologies
- Setup and Installation
- Usage
- Project Structure
- Design Highlights
- Contributing
- License
"Predict the Next Word" is a web app built with Django and TensorFlow. Users input a 50-word sentence, and the app predicts the next word using a trained ML model. The frontend includes a futuristic cyberpunk design with glitch effects and interactive backgrounds.
- Predicts the next word(s) for a 50-word sentence
- Displays real-time word count with warning if over 50
- Cyberpunk-themed UI with neon/glitch styling
- Responsive design for both mobile and desktop
- Visual "Processing..." feedback during predictions
- Backend: Django 5.2.3, Python 3.8+
- ML: TensorFlow (for predictions)
- Frontend: HTML, CSS, JavaScript
- Libraries: Font Awesome, Roboto Mono font
- Database: SQLite (default)
-
Clone the repository: git clone cd myproject
-
Set up virtual environment: python -m venv venv On Windows: .\venv\Scripts\activate On Linux/macOS: source venv/bin/activate
-
Install dependencies: pip install django==5.2.3 tensorflow
-
Apply database migrations: python manage.py migrate
-
Ensure static files exist: style.css in myapp/static/css/ script.js in myapp/static/js/
-
Check settings.py includes: STATIC_URL = '/static/' STATICFILES_DIRS = [BASE_DIR / 'myapp/static']
-
Set up templates: Place index.html in myapp/templates/ Or update settings.py to: TEMPLATES = [ { 'DIRS': [BASE_DIR / 'templates'], ... } ]
-
Start development server: python manage.py runserver
-
Access app at: http://127.0.0.1:8000/
- Open http://127.0.0.1:8000/ in your browser
- Enter a 50-word sentence in the input field
- Word counter turns red if you exceed 50 words
- Click "Predict" to see the TensorFlow model's suggestion
- Result appears with glitch animation
Note: Sentence must be exactly 50 words for accurate output.
myproject/
├── manage.py
├── requirements.txt
├── README.md
├── .gitignore
├── myproject/
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
├── myapp/
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── models.py
│ ├── views.py
│ ├── tests.py
│ ├── urls.py
│ ├── onehotencoder.pkl
│ ├── sustain.py
│ ├── migrations/
│ │ ├── __init__.py
│ │ ├── 0001_initial.py
│ ├── static/
│ │ ├── css/
│ │ │ ├── style.css
│ │ ├── js/
│ │ │ ├── script.js
│ │ ├── images/
│ └── templates/
│ ├── index.html
- Cyberpunk Colors: Neon pink (#ff6fd7), neon blue (#5bc0f8)
- Particle Background: Simulates neural network activity
- Holographic Container: Glassmorphism with neon glow
- Animations: Glitch text, pulsing titles, hover swipes
- Typography: Uses Roboto Mono for technical look
- Mobile Friendly: Fully responsive on all screen sizes
- Fork the repo
- Create a branch: git checkout -b feature-name
- Make your changes
- Commit: git commit -m "Add feature"
- Push: git push origin feature-name
- Open a pull request
Follow PEP 8 and include tests if applicable.
This project is licensed under the MIT License. See the LICENSE file for details.
If you need to disable oneDNN optimizations for reproducibility: On Windows: set TF_ENABLE_ONEDNN_OPTS=0 On Linux/macOS: export TF_ENABLE_ONEDNN_OPTS=0 Run this before launching the app.