import React, { useState } from "react"; import "./styles.css"; const App = () => { const [query, setQuery] = useState(""); const [output, setOutput] = useState(null); const [loading, setLoading] = useState(false); const fetchPrediction = async () => { setLoading(true); setOutput(null); const response = await fetch("https://your-space-url.hf.space/predict/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query }), }); const data = await response.json(); setOutput(data.output); setLoading(false); }; return (

Luxury NER Extractor

Enter a sentence and extract structured data

setQuery(e.target.value)} className="input-box" />
{output && (

Extracted Information

{Object.entries(output).map(([key, value]) => (
{key}:{" "} {value.join(", ")}
))}
)}
); }; export default App;