u
This commit is contained in:
parent
8c24ff4e54
commit
739b5a80f3
@ -322,7 +322,7 @@ async def _extract_calculation_params_b1(data: UserValuationCreate) -> Dict[str,
|
||||
# 创新投入比 = (研发费用/营收) * 100
|
||||
try:
|
||||
rd_investment = float(data.rd_investment) or 0
|
||||
annual_revenue = float(data.annual_revenue) or 1# 避免除零
|
||||
annual_revenue = float(data.annual_revenue) or 1 # 避免除零
|
||||
innovation_ratio = (rd_investment / annual_revenue) * 100 if annual_revenue > 0 else 0
|
||||
except (ValueError, TypeError):
|
||||
innovation_ratio = 0.0
|
||||
@ -424,9 +424,9 @@ async def _extract_calculation_params_b2(data: UserValuationCreate) -> Dict[str,
|
||||
"likes": safe_float(info.get("likes")),
|
||||
}
|
||||
# 以下调用API douyin\bilibili\kuaishou
|
||||
douyin_views = safe_float(rs.get("douyin",None).get("likes",0)) if rs.get("douyin",None) else 0
|
||||
kuaishou_views = safe_float(rs.get("kuaishou",None).get("likes",0)) if rs.get("kuaishou",None) else 0
|
||||
bilibili_views = safe_float(rs.get("bilibili",None).get("likes",0)) if rs.get("bilibili",None) else 0
|
||||
douyin_views = safe_float(rs.get("douyin", None).get("likes", 0)) if rs.get("douyin", None) else 0
|
||||
kuaishou_views = safe_float(rs.get("kuaishou", None).get("likes", 0)) if rs.get("kuaishou", None) else 0
|
||||
bilibili_views = safe_float(rs.get("bilibili", None).get("likes", 0)) if rs.get("bilibili", None) else 0
|
||||
|
||||
# 跨界合作深度 品牌联名0.3,科技载体0.5,国家外交礼品1.0
|
||||
cross_border_depth = float(data.cooperation_depth)
|
||||
@ -434,7 +434,8 @@ async def _extract_calculation_params_b2(data: UserValuationCreate) -> Dict[str,
|
||||
# 纹样基因值B22相关参数
|
||||
|
||||
# 以下三项需由后续模型/服务计算;此处提供默认可计算占位
|
||||
historical_inheritance = 0.8
|
||||
|
||||
historical_inheritance = sum([safe_float(i) for i in data.historical_evidence])
|
||||
structure_complexity = 0.75
|
||||
normalized_entropy = 0.85
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user