fix(industry): 审计收尾 — MEDIUM + LOW 全部清零
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M-1: Industries 创建弹窗添加 cold_start_template + pain_seed_categories M-3: industryStore console.warn → createLogger 结构化日志 B2: classify_with_industries 平局打破 + 归一化因子 3.0 文档化 S3: set_account_industries 验证移入事务内消除 TOCTOU T1: 4 个 SaaS 请求类型添加 deny_unknown_fields I3: store_trigger_experience Debug 格式 → signal_name 描述名 L-1: 删除 Accounts.tsx 死代码 editingIndustries L-3: Industries.tsx filters 类型补全 source 字段
This commit is contained in:
@@ -130,11 +130,15 @@ impl KeywordClassifier {
|
||||
if hits == 0 {
|
||||
return 0.0;
|
||||
}
|
||||
// Normalize: more hits = higher score, capped at 1.0
|
||||
// Normalize: 3 keyword hits → score 1.0 (saturated). Threshold 0.2 ≈ 0.6 hits.
|
||||
(hits as f32 / 3.0).min(1.0)
|
||||
}
|
||||
|
||||
/// Classify against dynamic industry keyword configs.
|
||||
///
|
||||
/// Tie-breaking: when two industries score equally, the *first* entry wins
|
||||
/// (keeps existing best on `<=`). Industries should be ordered by priority
|
||||
/// in the config array if specific tie-breaking is desired.
|
||||
fn classify_with_industries(query: &str, industries: &[IndustryKeywordConfig]) -> Option<RoutingHint> {
|
||||
let lower = query.to_lowercase();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user