| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- from __future__ import annotations
- from typing import Any
- def assess_risk(elements: dict[str, Any]) -> dict[str, Any]:
- """
- 输出:
- - level: 高/中/低
- - factors: list[str]
- """
- factors: list[str] = []
- cause = elements.get("case_cause")
- termination_reason = elements.get("termination_reason")
- month_salary = elements.get("month_salary") or 0
- claims = elements.get("claims") or {}
- amount_total = claims.get("amount_total") or 0
- overtime_desc = elements.get("overtime_desc") or ""
- # 规则示例:违法解除但原因为空 -> 风险升高
- if cause == "违法解除劳动合同" and not termination_reason:
- factors.append("案由为违法解除劳动合同但解除原因字段为空,争议事实支撑不足")
- # 请求金额超过月工资12倍 -> 支持可能性降低
- if month_salary and amount_total and amount_total > 12 * month_salary:
- factors.append("请求金额超过月工资标准的12倍,诉求支持可能性降低")
- # 加班事实存在但缺少具体记录 -> 证据不足
- if "加班" in str(overtime_desc) and len(str(overtime_desc).strip()) < 15:
- factors.append("加班事实存在但缺乏具体加班时间/记录,可能被认定证据不足")
- # 法条引用缺乏
- law_refs = elements.get("law_refs") or []
- if cause and len(law_refs) == 0:
- factors.append("未识别到法律条款引用,法律支撑可能不足(可人工补充)")
- # 风险
- # >= 3:
- level = "高"
- elif len(factors) >= 1:
- level = "中"
- else:
- level = "低"
- return {"level": level, "factors": factors}
|