intent-classifier-chatbot / src /fastapi_server.py
SaherMuhamed's picture
add the fine tuned BERT model with FAST API integrated in the Flask app
11576c7
raw
history blame contribute delete
406 Bytes
from fastapi import FastAPI, Request
from pydantic import BaseModel
app = FastAPI()
class PredictRequest(BaseModel):
text: str
@app.post("/predict")
def predict(req: PredictRequest):
# Dummy implementation for testing
# Replace with your model inference logic
if "alarm" in req.text.lower():
intent = "set_alarm"
else:
intent = "unknown"
return {"intent": intent}