Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,19 @@ def predict(input_text):
|
|
37 |
output = data["output"]
|
38 |
metadata = data["metadata"]
|
39 |
|
|
|
|
|
|
|
|
|
40 |
# Create a simple result string
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
# Create the full JSON output
|
44 |
detailed_result = {
|
|
|
37 |
output = data["output"]
|
38 |
metadata = data["metadata"]
|
39 |
|
40 |
+
# Extract metadata details
|
41 |
+
difficulty = metadata.get("difficulty", "Unknown")
|
42 |
+
steps = metadata.get("steps", ["No steps available"])
|
43 |
+
|
44 |
# Create a simple result string
|
45 |
+
steps_text = "\n".join(f"- {step}" for step in steps)
|
46 |
+
simple_result = (
|
47 |
+
f"Category: {label}\n"
|
48 |
+
f"Confidence: {score:.2f}\n"
|
49 |
+
f"Result: {output}\n"
|
50 |
+
f"Difficulty: {difficulty}\n"
|
51 |
+
f"Steps:\n{steps_text}"
|
52 |
+
)
|
53 |
|
54 |
# Create the full JSON output
|
55 |
detailed_result = {
|