rcwell/filter-parser
0
This repository contains a FastAPI app that parses natural language real estate queries into structured JSON filters using a language model (Flan-T5).
Usage
- Deploy this repo as a Hugging Face Space (Docker SDK).
- POST to
/parsewith a JSON body:{ "query": "3 bedroom apartment near Central Park under $3000" } - Response:
{ "filters": { ... } }
Example
Request:
POST /parse
{
"query": "pet-friendly 2 bedroom house in Brooklyn with parking, max $4000/month"
}Response:
{
"filters": {
"types": ["house"],
"bedrooms": 2,
"baths": null,
"landmark": "Brooklyn",
"price": { "min": null, "max": 4000, "unit": "monthly" },
"pet_friendly": true,
"parking": true
}
}Local Development
pip install -r requirements.txt
uvicorn app:app --reload --port 7860Hugging Face Space Deployment
- The included
DockerfileandREADME.mdare ready for Hugging Face Spaces (Docker SDK). - The app will be available at
/parse.
Notes
- Model:
google/flan-t5-base(can be swapped for a more advanced model if needed) - For production, consider adding error handling and input validation.
