Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -312,7 +312,25 @@ async def fast_classify_text(statement: str = Form(...)):
|
|
312 |
# Handle general errors
|
313 |
return JSONResponse(content=f"Error in classification pipeline: {str(e)}", status_code=500)
|
314 |
|
315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
async def fast_classify_text(statement: str = Form(...)):
|
317 |
try:
|
318 |
# Use run_in_executor to handle the synchronous model call asynchronously
|
|
|
312 |
# Handle general errors
|
313 |
return JSONResponse(content=f"Error in classification pipeline: {str(e)}", status_code=500)
|
314 |
|
315 |
+
# Predefined classifications
|
316 |
+
labels = [
|
317 |
+
"All Pricing copy quote requested",
|
318 |
+
"Change to quote",
|
319 |
+
"Change to quote & Status Check",
|
320 |
+
"Change to quote (Items missed?)",
|
321 |
+
"Confirmation",
|
322 |
+
"Copy quote requested",
|
323 |
+
"Cost copy quote requested",
|
324 |
+
"MRSP copy quote requested",
|
325 |
+
"MSRP & All Pricing copy quote requested",
|
326 |
+
"MSRP & Cost copy quote requested",
|
327 |
+
"No narrative in email",
|
328 |
+
"Notes not clear",
|
329 |
+
"Retail copy quote requested",
|
330 |
+
"Status Check (possibly)"
|
331 |
+
]
|
332 |
+
|
333 |
+
@app.post("/fast_classify_v2/", description="Quickly classify text into predefined categories.")
|
334 |
async def fast_classify_text(statement: str = Form(...)):
|
335 |
try:
|
336 |
# Use run_in_executor to handle the synchronous model call asynchronously
|