A comprehensive full-stack application for Natural Language Processing tasks including Sentiment Analysis, Named Entity Recognition, Text Classification, and Summarization.
🔗 Try it now: https://fullstack-nlp-sarvandani.onrender.com/
- FastAPI (0.104.1) - Modern, fast Python web framework for building APIs
- Uvicorn (0.24.0) - ASGI server for running FastAPI
- Transformers (4.35.2) - Hugging Face library for NLP models
- PyTorch (2.1.1) - Deep learning framework for model inference
- spaCy (3.7.2) - NLP library for Named Entity Recognition
- PyPDF2 (3.0.1) - PDF text extraction
- Python 3.9+ - Programming language
- HTML5 - Markup language
- CSS3 - Styling with modern features (gradients, animations)
- Vanilla JavaScript - No framework dependencies
- Fetch API - For HTTP requests
- DistilBERT - Sentiment Analysis (
distilbert-base-uncased-finetuned-sst-2-english) - spaCy Small - Named Entity Recognition (
en_core_web_sm) - DistilBART - Text Summarization (
sshleifer/distilbart-cnn-12-6) - DistilBERT-MNLI - Text Classification (Primary) (
typeform/distilbert-base-uncased-mnli)- Fast and lightweight (~250MB)
- Good accuracy for zero-shot classification
- Automatic recognition of 30+ categories
- Multi-label classification (detects multiple topics)
- DeBERTa-v3 - Text Classification (Fallback) (
MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli)- Best accuracy, trained on MNLI + FEVER + ANLI datasets
- Larger model (~500MB)
- BART-large - Text Classification (Fallback) (
facebook/bart-large-mnli)
- Git - Version control
- Docker (optional) - Containerization for deployment
- 📊 Sentiment Analysis - Analyze text sentiment (positive/negative)
- 🏷️ Named Entity Recognition - Extract entities like names, locations, organizations
- 📝 Text Classification - Classify text into categories (technology, business, science, etc.)
- ✂️ Summarization - Generate concise summaries of text
- 📄 PDF Support - Upload and process PDF files
- ⚡ Lightweight Models - Fast local inference using optimized models
- Python 3.9 or higher
- pip (Python package manager)
-
Clone or download the project
-
Install backend dependencies:
cd backend pip install -r requirements.txt -
Download spaCy model:
python -m spacy download en_core_web_sm
-
Download NLP models (optional - they download automatically on first use):
python setup_models.py
cd backend
python main.pyThe backend will start on an available port (default: 5000-5100).
cd frontend
python -m http.server 4000Then open http://localhost:4000 in your browser.
NLP_FULL-STACK_project/
├── backend/
│ ├── main.py # FastAPI application
│ ├── nlp_services.py # NLP model services
│ └── requirements.txt # Python dependencies
├── frontend/
│ └── index.html # Single-page frontend
├── models/ # Cached models (auto-created)
├── setup_models.py # Model download script
└── README.md # This file
Key Points:
- Don't upload the
models/folder (too large, ~2-3GB) - Models download automatically on first request
- Update frontend API URL to your backend URL
- Deployed on Render.com (free tier)
GET /health- Health checkPOST /api/sentiment- Analyze sentimentPOST /api/ner- Extract named entitiesPOST /api/classify- Classify textPOST /api/summarize- Summarize textPOST /api/process-all- Process all tasks at oncePOST /api/process-pdf- Process PDF file
-
Text Length Limits:
- Sentiment Analysis: ~1,800 characters (~450 words)
- Summarization: ~3,500 characters (~875 words)
- Longer texts are automatically truncated
-
Ports:
- Frontend: 4000 (fixed)
- Backend: 5000-5100 (auto-detected)
MIT License
This application is provided "as is" without any warranties or guarantees. The NLP models used are pre-trained and may not always produce 100% accurate results. Results are for informational purposes only and should not be used as the sole basis for important decisions. The author is not responsible for any consequences arising from the use of this application.
SARVANDANI
For questions, issues, or contributions, please open an issue on GitHub.