Skip to content

Natural-Language-Processing-API is a RESTful API built with FastAPI that offers core NLP tasks like sentiment analysis, entity recognition, summarization, and language detection. It uses Hugging Face and spaCy models, supports Docker, and provides easy integration for NLP features.

Notifications You must be signed in to change notification settings

Lucifer88484/Natural-Language-Processing-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Natural Language Processing API

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.


🚀 Features

  • ✅ Sentiment Analysis
  • ✅ Named Entity Recognition (NER)
  • ✅ Text Summarization
  • ✅ Keyword Extraction
  • ✅ Language Detection
  • 🔒 CORS & error handling
  • 📝 Auto-generated API docs with Swagger/OpenAPI

🛠️ Tech Stack

  • Python 3.10+
  • FastAPI
  • spaCy / Hugging Face Transformers
  • Pydantic
  • Uvicorn (ASGI Server)
  • Docker (optional)

📦 Installation

1. Clone the repository

git clone https://github.com/Lucifer88484/Natural-Language-Processing-API.git
cd nlp-api

2. Create a virtual environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Download required models

python -m spacy download en_core_web_sm

🚀 Running the API

Development server

uvicorn app.main:app --reload

The API will be available at http://localhost:8000

Production server

uvicorn app.main:app --host 0.0.0.0 --port 8000

📚 API Documentation

Once the server is running, you can access:


🧪 Running Tests

pytest

📝 API Endpoints

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

📄 License

Hrishikesh D. Mohite © 2025


🤝 Contributing

Mail me at: [email protected]

About

Natural-Language-Processing-API is a RESTful API built with FastAPI that offers core NLP tasks like sentiment analysis, entity recognition, summarization, and language detection. It uses Hugging Face and spaCy models, supports Docker, and provides easy integration for NLP features.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published