Update output.py
Browse files
output.py
CHANGED
|
@@ -7,7 +7,7 @@ Aphasia classification inference (cleaned).
|
|
| 7 |
- Adds predict_from_chajson(json_path, ...) helper
|
| 8 |
"""
|
| 9 |
|
| 10 |
-
import json as
|
| 11 |
import os
|
| 12 |
import math
|
| 13 |
from dataclasses import dataclass
|
|
@@ -598,7 +598,7 @@ def predict_from_chajson(model_dir: str, chajson_path: str, output_file: Optiona
|
|
| 598 |
def format_result(pred: dict, style: str = "json") -> str:
|
| 599 |
"""Back-compat formatter. 'pred' is the dict returned by predict_*."""
|
| 600 |
if style == "json":
|
| 601 |
-
return
|
| 602 |
# simple text summary
|
| 603 |
if isinstance(pred, dict) and "summary" in pred:
|
| 604 |
s = pred["summary"]
|
|
|
|
| 7 |
- Adds predict_from_chajson(json_path, ...) helper
|
| 8 |
"""
|
| 9 |
|
| 10 |
+
import json as json
|
| 11 |
import os
|
| 12 |
import math
|
| 13 |
from dataclasses import dataclass
|
|
|
|
| 598 |
def format_result(pred: dict, style: str = "json") -> str:
|
| 599 |
"""Back-compat formatter. 'pred' is the dict returned by predict_*."""
|
| 600 |
if style == "json":
|
| 601 |
+
return json.dumps(pred, ensure_ascii=False, indent=2)
|
| 602 |
# simple text summary
|
| 603 |
if isinstance(pred, dict) and "summary" in pred:
|
| 604 |
s = pred["summary"]
|