nlp-analysis-api / README.md
karim323's picture
Add NLP Analysis API backend with FastAPI and transformers
e4eb82b
metadata
title: NLP Analysis API
emoji: 🤖
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false

NLP Analysis API

A FastAPI-based backend service for:

  • 💬 Sentiment Analysis
  • 🏷️ Named Entity Recognition (NER)
  • 🌍 Translation (multiple languages)
  • ✍️ Text Paraphrasing
  • 📝 Text Summarization

Features

  • Real-time text analysis using Hugging Face transformers
  • RESTful API with comprehensive documentation
  • Rate limiting and input validation
  • CORS enabled for web apps
  • Professional error handling

API Endpoints

  • GET / - API status
  • GET /health - Health check with model status
  • POST /analyze - Sentiment analysis
  • POST /ner - Named entity recognition
  • POST /translate - Text translation
  • POST /paraphrase - Text paraphrasing
  • POST /summarize - Text summarization

Usage

Once deployed, visit the /docs endpoint for interactive API documentation (Swagger UI).

Example request:

curl -X POST "https://huggingface.co/spaces/karim323/nlp-analysis-api/analyze" \
  -H "Content-Type: application/json" \
  -d '{"text": "I love this product!"}'

Tech Stack

  • FastAPI
  • Hugging Face Transformers
  • PyTorch
  • Python 3.11

Built with ❤️ for the ML community