Spaces:
Running
Running
| from fastapi import FastAPI | |
| from .schemas import PredictRequest, PredictResponse | |
| from .detector import predict_spam | |
| app = FastAPI( | |
| title="Semantic SMS Spam Detection API", | |
| description="Embedding-based spam detection using sentence transformers", | |
| version="1.0.0" | |
| ) | |
| def status(): | |
| return { | |
| "status": "ok", | |
| "model": "all-MiniLM-L6-v2", | |
| "method": "semantic similarity" | |
| } | |
| def predict(request: PredictRequest): | |
| return predict_spam(request.text) | |