Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
def extract_metadata(contract_text):
|
| 5 |
+
# Placeholder extraction (replace with model pipeline later)
|
| 6 |
+
metadata = {
|
| 7 |
+
"parties": ["Landlord", "Tenant"],
|
| 8 |
+
"property_address": "123 Main Street",
|
| 9 |
+
"lease_term": "12 months",
|
| 10 |
+
"start_date": "2025-06-01",
|
| 11 |
+
"rent_amount": 1500,
|
| 12 |
+
"clauses": {
|
| 13 |
+
"termination": True,
|
| 14 |
+
"liability": True,
|
| 15 |
+
"indemnity": False
|
| 16 |
+
},
|
| 17 |
+
"jurisdiction": "US"
|
| 18 |
+
}
|
| 19 |
+
return json.dumps(metadata, indent=2)
|
| 20 |
+
|
| 21 |
+
demo = gr.Interface(
|
| 22 |
+
fn=extract_metadata,
|
| 23 |
+
inputs=gr.Textbox(lines=12, placeholder="Paste lease or contract here..."),
|
| 24 |
+
outputs="json",
|
| 25 |
+
title="🏠 ProofAssets: Real Estate Tokenizer",
|
| 26 |
+
description="Extract metadata from real estate contracts and convert into structured format for tokenization."
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
if __name__ == "__main__":
|
| 30 |
+
demo.launch()
|