A RESTful API for performing core NLP tasks such as sentiment analysis, named entity recognition, text summarization, keyword extraction, and language detection. Built using FastAPI and state-of-the-art NLP models from Hugging Face and spaCy.
- ✅ Sentiment Analysis
- ✅ Named Entity Recognition (NER)
- ✅ Text Summarization
- ✅ Keyword Extraction
- ✅ Language Detection
- 🔒 CORS & error handling
- 📝 Auto-generated API docs with Swagger/OpenAPI
- Python 3.10+
- FastAPI
- spaCy / Hugging Face Transformers
- Pydantic
- Uvicorn (ASGI Server)
- Docker (optional)
git clone https://github.com/Lucifer88484/Natural-Language-Processing-API.git
cd nlp-apipython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtpython -m spacy download en_core_web_smuvicorn app.main:app --reloadThe API will be available at http://localhost:8000
uvicorn app.main:app --host 0.0.0.0 --port 8000Once the server is running, you can access:
- Interactive API documentation: http://localhost:8000/docs
- OpenAPI specification: http://localhost:8000/openapi.json
pytest| Endpoint | Method | Description |
|---|---|---|
/api/v1/sentiment |
POST | Analyze sentiment of text |
/api/v1/entities |
POST | Extract named entities |
/api/v1/summarize |
POST | Generate text summary |
/api/v1/language |
POST | Detect language of text |
/api/v1/keywords |
POST | Extract keywords from text |
Hrishikesh D. Mohite © 2025
Mail me at: [email protected]