stklen commited on
Commit
b462898
·
verified ·
1 Parent(s): e9a420e

feat: 加入 Value Scoring 自動估值

Browse files
Files changed (1) hide show
  1. app.py +37 -5
app.py CHANGED
@@ -403,16 +403,48 @@ def generate_l0_l8(file_path: str, file_bytes: bytes) -> dict:
403
  }
404
 
405
  # L7: 分發決策 (黃金數據管線 + SN13 標準)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  result["L7_distribution_decision"] = {
407
  "ai_value_score": 72.5,
408
  "human_value_score": 68.0,
409
- "quality_tier": "platinum", # diamond/platinum/silver/legacy
410
- "recommended_track": "Dual_Track", # AI_Track/Human_Track/Dual_Track
411
 
412
  # ⭐ SN13 標準欄位
413
- "uniqueness_score": 0.72, # 稀缺性 (SN13: 越少礦工擁有越高)
414
- "desirability_match": 0.85, # 需求匹配度 (是否在熱門需求列表)
415
- "miner_demand_level": "high", # 礦工需求等級
 
 
 
 
 
 
 
 
 
 
 
416
 
417
  "priority_distribution": ["Bittensor_SN13", "HuggingFace", "SNS"],
418
  "distribution_rationale": "高稀缺性+高需求匹配,優先供應 SN13"
 
403
  }
404
 
405
  # L7: 分發決策 (黃金數據管線 + SN13 標準)
406
+ # 取得 L5 支柱分數用於估值
407
+ pillar_scores = result["L5_content_strategy"]["pillar_details"]
408
+ uniqueness = 0.72
409
+ desirability = 0.85
410
+ demand_level = "high"
411
+ quality = "platinum"
412
+
413
+ # ⭐ Value Scoring 自動估值
414
+ pillar_weights = {"P1_Hook": 0.30, "P2_Series": 0.25, "P3_Bond": 0.25, "P4_Lifestyle": 0.20}
415
+ pillar_value = sum(pillar_weights[k] * pillar_scores.get(k, 0) for k in pillar_weights)
416
+
417
+ demand_mult = {"high": 2.0, "medium": 1.0, "low": 0.5}.get(demand_level, 1.0)
418
+ scarcity_bonus = 1.0 + (uniqueness * 0.5)
419
+ demand_bonus = 1.0 + (desirability * 0.5)
420
+ total_demand_mult = min(max(demand_mult * scarcity_bonus * demand_bonus, 0.3), 4.0)
421
+
422
+ quality_mult = {"diamond": 3.0, "platinum": 2.0, "silver": 1.0, "legacy": 0.3}.get(quality, 1.0)
423
+ freshness_factor = 1.0 # 新上傳 = 最新鮮
424
+
425
+ base_value = pillar_value * total_demand_mult * quality_mult * freshness_factor
426
+
427
  result["L7_distribution_decision"] = {
428
  "ai_value_score": 72.5,
429
  "human_value_score": 68.0,
430
+ "quality_tier": quality, # diamond/platinum/silver/legacy
431
+ "recommended_track": "Dual_Track", # AI_Track/Human_Track/Dual_Track
432
 
433
  # ⭐ SN13 標準欄位
434
+ "uniqueness_score": uniqueness, # 稀缺性 (SN13: 越少礦工擁有越高)
435
+ "desirability_match": desirability, # 需求匹配度 (是否在熱門需求列表)
436
+ "miner_demand_level": demand_level, # 礦工需求等級
437
+
438
+ # ⭐ Value Scoring 自動估值 (NEW!)
439
+ "valuation": {
440
+ "price_ai_training_usd": round(base_value * 0.50, 4), # AI 訓練價
441
+ "price_commercial_usd": round(base_value * 2.00, 4), # 商用授權價
442
+ "price_exclusive_usd": round(base_value * 10.00, 4), # 獨家授權價
443
+ "demand_multiplier": round(total_demand_mult, 2),
444
+ "quality_multiplier": quality_mult,
445
+ "freshness_factor": freshness_factor,
446
+ "valuation_formula": "pillar_value × demand_mult × quality_mult × freshness"
447
+ },
448
 
449
  "priority_distribution": ["Bittensor_SN13", "HuggingFace", "SNS"],
450
  "distribution_rationale": "高稀缺性+高需求匹配,優先供應 SN13"