Spaces:
Runtime error
Runtime error
File size: 1,453 Bytes
ad4d4f6 27abab4 ad4d4f6 27abab4 ad4d4f6 27abab4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
---
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
|