V10.580 強化重複單品組安全比價

This commit is contained in:
OoO
2026-06-04 11:55:25 +08:00
parent 03d60c202f
commit 69fa191097
6 changed files with 57 additions and 10 deletions

View File

@@ -2195,9 +2195,28 @@ def _has_safe_multi_component_exact_total_price(
}
if reason_set & blocked:
return False
if brand_score < 0.95 or type_score < 0.95 or spec_score < 0.85:
if brand_score < 0.95 or spec_score < 0.85:
return False
if _has_exact_count_alignment(left, right):
exact_count_alignment = _has_exact_count_alignment(left, right)
same_base_spec = _has_overlapping_base_spec(left, right)
if (
exact_count_alignment
and type_score >= 0.55
and token_score >= 0.80
and sequence_score >= 0.75
and (
same_base_spec
or (
token_score >= 0.90
and sequence_score >= 0.90
and "strong_product_line_match" in reason_set
)
)
):
return True
if type_score < 0.95:
return False
if exact_count_alignment:
return token_score >= 0.50 and sequence_score >= 0.50
return (
token_score >= 0.62
@@ -3862,6 +3881,7 @@ def _has_core_ingredient_line_conflict(left: ProductIdentity, right: ProductIden
"coconut_oil": ("椰子油", "coconut"),
"shea_butter": ("乳木果油", "shea"),
"sweet_almond_oil": ("甜杏仁油", "sweet almond"),
"apricot_kernel_oil": ("杏桃核仁油", "杏核仁油", "apricot kernel"),
"avocado_oil": ("酪梨油", "avocado"),
}
left_groups = {