james-river-api / README.md
ityndall's picture
Update API with FastAPI implementation, Docker support, and improved documentation
27abab4
---
title: James River API
emoji: 🏗️
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: apache-2.0
short_description: James River Survey Classification API
---
# James River Survey Classification API
This is a FastAPI-based text classification API that categorizes survey-related messages into different job types for James River surveying services.
## Model
The API uses the `ityndall/james-river-classifier` model, which is a BERT-based classifier trained to categorize survey requests into:
- Boundary Survey
- Construction Survey
- Fence Staking
- Other/General
- Real Estate Survey
- Subdivision Survey
## API Usage
### Endpoint: POST /predict
Send a JSON payload with a "message" field:
```json
{
"message": "I need a boundary survey for my property"
}
```
Response:
```json
{
"label": "Boundary Survey",
"confidence": 0.85
}
```
### Example using curl:
```bash
curl -X POST "https://ityndall-james-river-api.hf.space/predict" \
-H "Content-Type: application/json" \
-d '{"message": "I need a boundary survey for my property"}'
```
### Example using Python:
```python
import requests
url = "https://ityndall-james-river-api.hf.space/predict"
data = {"message": "I need a boundary survey for my property"}
response = requests.post(url, json=data)
print(response.json())
```
## Local Development
```bash
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 7860