Spaces:
Sleeping
Sleeping
Update models/screening_models.py
Browse files- models/screening_models.py +13 -6
models/screening_models.py
CHANGED
|
@@ -79,11 +79,14 @@ class ScreeningService:
|
|
| 79 |
|
| 80 |
except Exception as e:
|
| 81 |
logger.error(f"{model_type}筛查失败: {str(e)}")
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
results[model_type] = {
|
| 84 |
-
'probability': 0.
|
| 85 |
'risk_level': 'low',
|
| 86 |
-
'threshold':
|
| 87 |
'model_type': f"{model_type}_screening"
|
| 88 |
}
|
| 89 |
advisory_results[model_type] = None
|
|
@@ -126,12 +129,16 @@ class ScreeningService:
|
|
| 126 |
|
| 127 |
except Exception as e:
|
| 128 |
logger.error(f"筛查评估失败: {str(e)}")
|
| 129 |
-
|
|
|
|
|
|
|
| 130 |
return ScreeningResponse(
|
| 131 |
sarcoI_risk=RiskLevel.LOW,
|
| 132 |
-
sarcoI_probability=0.
|
|
|
|
| 133 |
sarcoII_risk=RiskLevel.LOW,
|
| 134 |
-
sarcoII_probability=0.
|
|
|
|
| 135 |
overall_risk=RiskLevel.LOW,
|
| 136 |
confidence=0.5,
|
| 137 |
processing_time=time.time() - start_time
|
|
|
|
| 79 |
|
| 80 |
except Exception as e:
|
| 81 |
logger.error(f"{model_type}筛查失败: {str(e)}")
|
| 82 |
+
import traceback
|
| 83 |
+
logger.error(f"详细错误信息: {traceback.format_exc()}")
|
| 84 |
+
# 使用默认低风险结果,但使用正确的阈值
|
| 85 |
+
default_threshold = 0.15 if model_type == 'sarcoI' else 0.09
|
| 86 |
results[model_type] = {
|
| 87 |
+
'probability': 0.05, # 使用明显的低风险概率
|
| 88 |
'risk_level': 'low',
|
| 89 |
+
'threshold': default_threshold,
|
| 90 |
'model_type': f"{model_type}_screening"
|
| 91 |
}
|
| 92 |
advisory_results[model_type] = None
|
|
|
|
| 129 |
|
| 130 |
except Exception as e:
|
| 131 |
logger.error(f"筛查评估失败: {str(e)}")
|
| 132 |
+
import traceback
|
| 133 |
+
logger.error(f"详细错误信息: {traceback.format_exc()}")
|
| 134 |
+
# 返回默认安全结果,使用明显的低风险概率
|
| 135 |
return ScreeningResponse(
|
| 136 |
sarcoI_risk=RiskLevel.LOW,
|
| 137 |
+
sarcoI_probability=0.05, # 明显低于所有阈值
|
| 138 |
+
sarcoI_threshold=0.15, # 使用正确的阈值
|
| 139 |
sarcoII_risk=RiskLevel.LOW,
|
| 140 |
+
sarcoII_probability=0.05, # 明显低于所有阈值
|
| 141 |
+
sarcoII_threshold=0.09, # 使用正确的阈值
|
| 142 |
overall_risk=RiskLevel.LOW,
|
| 143 |
confidence=0.5,
|
| 144 |
processing_time=time.time() - start_time
|