spam-detection / app /main.py
abhinavvvvv's picture
updated spam dict
fd849c0
raw
history blame contribute delete
559 Bytes
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"
)
@app.get("/")
def status():
return {
"status": "ok",
"model": "all-MiniLM-L6-v2",
"method": "semantic similarity"
}
@app.post("/predict", response_model=PredictResponse)
def predict(request: PredictRequest):
return predict_spam(request.text)