V10.398 recover true low confidence matches
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s

This commit is contained in:
OoO
2026-05-24 12:05:30 +08:00
committed by AiderHeal Bot
parent 8cc197aba2
commit 4622be3441
4 changed files with 146 additions and 2 deletions

View File

@@ -352,6 +352,16 @@ SEARCH_IDENTITY_ANCHORS = (
"麗駐蘭修復舒緩面膜",
"濕度數顯智能加濕器",
"新艷陽夏水離子熱防禦隔離露",
"3d極細防水眼線膠筆",
"恆久完美透膚煙染腮紅",
"私密植萃美白緊緻凝露",
"學習刷牙漱口水",
"羅馬柱智慧居家車用香氛機",
"經典菲菲染唇液",
"染唇液",
"晨霧純精油擴香儀",
"天然植物香氛精油",
"爆水擦澡濕巾",
"3d立體持色眉彩盤",
"細芯睛彩雙頭眉筆",
"雙頭旋轉極細眉筆",
@@ -598,6 +608,7 @@ BRAND_ALIAS_OVERRIDES = {
"jo malone": ("jo malone",),
"prada": ("prada", "普拉達"),
"za": ("za",),
"hh": ("hh", "草本新淨界"),
"小浪": ("小浪",),
"xiaomi": ("小米有品", "小米", "xiaomi"),
"mac": ("m.a.c", "mac", "m a c"),
@@ -1649,6 +1660,7 @@ def _classify_match_quality(
shared_anchor: str,
shared_models: set[str],
catalog_count_omission: bool,
multi_component_pair: bool,
) -> tuple[str, str, str]:
"""Map raw matcher scores into operator-facing price comparison lanes."""
reason_set = set(reasons)
@@ -1670,6 +1682,8 @@ def _classify_match_quality(
and (direct_spec_evidence or (shared_anchor and token_score >= 0.62 and sequence_score >= 0.58))
)
if strong_identity_evidence and not catalog_count_omission:
if multi_component_pair:
return "exact", "manual_review", "identity_review"
return "exact", "total_price", "price_alert_exact"
if score >= 0.76:
@@ -2288,6 +2302,7 @@ def score_marketplace_match(
shared_anchor=shared_anchor,
shared_models=shared_models,
catalog_count_omission=catalog_count_omission,
multi_component_pair=_has_multi_component(left) and _has_multi_component(right),
)
evidence_flags = _build_evidence_flags(
brand_score=brand_score,
@@ -2571,6 +2586,20 @@ def _has_baan_baby_lip_catalog_alignment(left: ProductIdentity, right: ProductId
)
def _has_pavaruni_40_scent_oil_alignment(left: ProductIdentity, right: ProductIdentity) -> bool:
left_text = left.searchable_name
right_text = right.searchable_name
return (
"pavaruni" in (left.brand_tokens & right.brand_tokens)
and "天然植物" in f"{left_text} {right_text}"
and "精油" in left_text
and "精油" in right_text
and _has_shared_volume(left, right, 10)
and ("40香味" in left_text or "40種香味" in left_text)
and ("40香味" in right_text or "40種香味" in right_text)
)
def _has_shared_count(left: ProductIdentity, right: ProductIdentity, count: int, unit: str) -> bool:
return (count, unit) in set(left.counts) and (count, unit) in set(right.counts)
@@ -2677,6 +2706,63 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro
and "隔離露" in right_text
):
return "shiseido_blue_sunscreen"
if (
{"baan", "貝恩"} & (left.brand_tokens & right.brand_tokens)
and "嬰兒修護唇膏" in left_text
and "嬰兒修護唇膏" in right_text
and left.product_type == right.product_type == "護唇膏"
):
return "baan_baby_lip_base_catalog"
if (
{"shu uemura", "植村秀"} & (left.brand_tokens & right.brand_tokens)
and "3d極細防水眼線膠筆" in left_text
and "3d極細防水眼線膠筆" in right_text
):
return "shu_3d_eyeliner"
if (
{"ysl", "聖羅蘭"} & (left.brand_tokens & right.brand_tokens)
and "恆久完美透膚煙染腮紅" in left_text
and "恆久完美透膚煙染腮紅" in right_text
):
return "ysl_blush_catalog"
if (
{"hh", "草本新淨界"} & (left.brand_tokens & right.brand_tokens)
and "私密植萃美白緊緻凝露" in left_text
and "私密植萃美白緊緻凝露" in right_text
and _has_shared_volume(left, right, 30)
):
return "hh_private_gel"
if (
{"lab52", "齒妍堂"} & (left.brand_tokens & right.brand_tokens)
and "學習刷牙漱口水" in left_text
and "學習刷牙漱口水" in right_text
and _has_overlapping_base_spec(left, right)
):
return "lab52_mouthwash"
if (
"benefit" in (left.brand_tokens & right.brand_tokens)
and "染唇液" in left_text
and "染唇液" in right_text
and "唇頰兩用" in pair_text
):
return "benefit_lip_tint"
if (
{"herb24", "草本"} & (left.brand_tokens & right.brand_tokens)
and "晨霧純精油擴香儀ii" in left_text
and "晨霧純精油擴香儀ii" in right_text
and (("霧黑" in left_text and "黑色" in right_text) or ("霧黑" in right_text and "黑色" in left_text))
):
return "herb24_mist_diffuser_black"
if _has_pavaruni_40_scent_oil_alignment(left, right):
return "pavaruni_40_scent_oil"
if (
"gatsby" in (left.brand_tokens & right.brand_tokens)
and "爆水擦澡濕巾" in left_text
and "爆水擦澡濕巾" in right_text
and "24張入" in left_text
and "24張入" in right_text
):
return "gatsby_body_wipes_24"
return ""
@@ -2735,6 +2821,8 @@ def _has_variant_descriptor_conflict(left: ProductIdentity, right: ProductIdenti
return False
if _has_baan_baby_lip_catalog_alignment(left, right):
return False
if _has_pavaruni_40_scent_oil_alignment(left, right):
return False
if _is_relove_private_cleanser_line(left, right):
return False
if (