Spaces:
Sleeping
Sleeping
|
Download README_HF.md from snvskiit/content_processor: direct link, hf CLI and curl.
- Browser
- Download file 2.9 kB
-
https://huggingface.co/spaces/snvskiit/content_processor/resolve/main/README_HF.md
- Command line
-
hf download hf://spaces/snvskiit/content_processor/README_HF.md
-
curl -L -o README_HF.md https://huggingface.co/spaces/snvskiit/content_processor/resolve/main/README_HF.md
2.9 kB
metadata
title: Address Detection and Summarization API
emoji: π π
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: mit
Address Detection and Summarization API
A FastAPI service that provides two main endpoints for AI-powered text processing:
π Features
- π Address Detection: Extracts and formats addresses from unstructured text
- π Text Summarization: Creates concise summaries with sentiment analysis
- π€ OpenAI Integration: Uses GPT-4 for natural language processing
- π Secure: API key required via
x-api-keyheader - π Sentiment Analysis: Returns sentiment label and score (-1.0 to 1.0)
π API Endpoints
Root & Health
GET /- API informationGET /health- Health checkGET /docs- Interactive API documentation
Address Detection
POST /address-detection
Extract addresses from text content.
Request:
{
"entity_urn": "unique_id",
"content": "Please send to 123 Main Street, New York, NY 10001"
}
Headers:
Content-Type: application/json
x-api-key: your_openai_api_key
Text Summarization
POST /summarize
Generate summary with sentiment analysis.
Request:
{
"entity_urn": "unique_id",
"content": "Your text content to summarize..."
}
π§ Usage Examples
Using curl:
# Address Detection
curl -X POST "https://your-space-name.hf.space/address-detection" \
-H "Content-Type: application/json" \
-H "x-api-key: your_openai_api_key" \
-d '{"entity_urn": "test", "content": "Send to 123 Main St, NYC"}'
# Summarization
curl -X POST "https://your-space-name.hf.space/summarize" \
-H "Content-Type: application/json" \
-H "x-api-key: your_openai_api_key" \
-d '{"entity_urn": "test", "content": "I love this product!"}'
Response Format:
{
"message": "success",
"result": "extracted_addresses || separated",
"action_type": "detect_address",
"entity_urn": "test",
"sentiment": null
}
For summarization, sentiment contains:
{
"label": "positive",
"score": 0.8
}
π Authentication
You need an OpenAI API key to use this service:
- Get your API key from OpenAI Platform
- Include it in the
x-api-keyheader with each request - No registration required - just use your own key
ποΈ Built With
- FastAPI 0.115.14 - Modern web framework
- OpenAI 1.92.1 - AI language models
- Pydantic 2.11.7 - Data validation
- Python 3.12 - Runtime
π Documentation
Visit /docs for interactive API documentation with request/response examples and testing interface.
π Security & Privacy
- Your OpenAI API key is required for each request
- No API keys are stored on our servers
- All requests are processed in real-time
- No conversation history is retained