CoolFace
Apppublic

rcwell/filter-parser

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

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 /parse with 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

sh
pip install -r requirements.txt
uvicorn app:app --reload --port 7860

Hugging Face Space Deployment

  • —The included Dockerfile and README.md are 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.