Spaces:
Runtime error
Runtime error
Create company_score.py
Browse files- modules/company_score.py +30 -0
modules/company_score.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
from dataclasses import dataclass
|
| 3 |
+
|
| 4 |
+
@dataclass
|
| 5 |
+
class CompanyScore:
|
| 6 |
+
fit: float
|
| 7 |
+
urgency: float # 直近のニーズ感
|
| 8 |
+
size: float # 事業規模
|
| 9 |
+
tech_readiness: float # 技術導入度
|
| 10 |
+
overall: float #総合
|
| 11 |
+
|
| 12 |
+
def score_company(name: str, website: str) -> dict:
|
| 13 |
+
"""
|
| 14 |
+
実務ではCRMや外部データを加味。ここではダミー(サイトURL有→導入度↑など)。
|
| 15 |
+
"""
|
| 16 |
+
base = 50.0
|
| 17 |
+
fit = base + (10.0 if name else 0)
|
| 18 |
+
urgency = base + (5.0 if "contact" in (website or "") else 0)
|
| 19 |
+
size = base + (10.0 if website and len(website) > 12 else 0)
|
| 20 |
+
tech = base + (10.0 if website and website.startswith("https") else 0)
|
| 21 |
+
overall = round((fit + urgency + sie + tech) / 4.0, 1)
|
| 22 |
+
return {
|
| 23 |
+
"name": name,
|
| 24 |
+
"websaite": website,
|
| 25 |
+
"fit": round(fit,1),
|
| 26 |
+
"urgency": round(urgency,1),
|
| 27 |
+
"size": round(size, 1),
|
| 28 |
+
"tech_readiness": round(tech, 1),
|
| 29 |
+
"overall": overall
|
| 30 |
+
}
|