Spaces:
Sleeping
Sleeping
Update app/routers/analyzer.py
Browse files- app/routers/analyzer.py +3 -3
app/routers/analyzer.py
CHANGED
|
@@ -19,12 +19,12 @@ class AnalyzeResponse(BaseModel):
|
|
| 19 |
points: List[Dict[str, Any]] # [{x,y,cluster,text}]
|
| 20 |
topics: List[TopicOut]
|
| 21 |
|
|
|
|
|
|
|
| 22 |
@router.post("/analyze", response_model=AnalyzeResponse)
|
| 23 |
def analyze(req: AnalyzeRequest):
|
| 24 |
try:
|
| 25 |
-
|
| 26 |
-
engine = TopicEngine()
|
| 27 |
-
r = engine.analyze(req.texts, req.n_clusters)
|
| 28 |
except Exception as e:
|
| 29 |
raise HTTPException(status_code=500, detail=str(e))
|
| 30 |
return AnalyzeResponse(
|
|
|
|
| 19 |
points: List[Dict[str, Any]] # [{x,y,cluster,text}]
|
| 20 |
topics: List[TopicOut]
|
| 21 |
|
| 22 |
+
_engine = TopicEngine()
|
| 23 |
+
|
| 24 |
@router.post("/analyze", response_model=AnalyzeResponse)
|
| 25 |
def analyze(req: AnalyzeRequest):
|
| 26 |
try:
|
| 27 |
+
r = _engine.analyze(req.texts, req.n_clusters)
|
|
|
|
|
|
|
| 28 |
except Exception as e:
|
| 29 |
raise HTTPException(status_code=500, detail=str(e))
|
| 30 |
return AnalyzeResponse(
|