V10.517 強化近門檻商品比對防線

This commit is contained in:
OoO
2026-05-31 22:44:56 +08:00
parent ea1043ef7c
commit c91d20f26b
5 changed files with 94 additions and 1 deletions

View File

@@ -495,6 +495,7 @@ FOCUSED_IDENTITY_VARIANT_REVIEW_BYPASS_REASONS = {
"cetaphil_long_lotion_237ml",
"cetaphil_long_lotion_473ml",
"clarins_double_serum_eye_20ml",
"lab52_paw_patrol_baby_toothbrush_2pack",
"derma_baby_wash_150ml",
"derma_baby_wash_500ml",
"physiogel_ai_ice_essence_200ml_2pack",
@@ -528,6 +529,7 @@ FOCUSED_IDENTITY_TOTAL_PRICE_REASONS = {
"cetaphil_long_lotion_237ml",
"cetaphil_long_lotion_473ml",
"clarins_double_serum_eye_20ml",
"lab52_paw_patrol_baby_toothbrush_2pack",
"derma_baby_wash_150ml",
"derma_baby_wash_500ml",
"physiogel_ai_ice_essence_200ml_2pack",
@@ -606,6 +608,9 @@ VARIANT_OPTION_COLOR_WORDS = {
"海鹽",
"檸檬草",
"茶樹",
"英國梨",
"小蒼蘭",
"英國梨小蒼蘭",
"櫻花",
"繡球花",
"魔髮奇緣",
@@ -2104,6 +2109,9 @@ def score_marketplace_match(
selection1990_wax_lamp_design_conflict = _has_selection1990_wax_lamp_design_conflict(left, right)
if selection1990_wax_lamp_design_conflict:
reasons.append("selection1990_wax_lamp_design_conflict")
aroma_lamp_style_selection_gap = _has_aroma_lamp_style_selection_gap(left, right)
if aroma_lamp_style_selection_gap:
reasons.append("aroma_lamp_style_selection_gap")
hooome_wax_lamp_design_gap = _has_hooome_wax_lamp_design_gap(left, right)
if hooome_wax_lamp_design_gap:
reasons.append("hooome_wax_lamp_design_gap")
@@ -2146,6 +2154,7 @@ def score_marketplace_match(
or relove_private_cleanser_variant_gap
or candle_catalog_selection_gap
or bath_additive_variant_gap
or aroma_lamp_style_selection_gap
or hooome_wax_lamp_design_gap
or makeup_catalog_selection_gap
or loreal_serum_variant_gap
@@ -3325,6 +3334,49 @@ def _has_aroma_scent_variant_conflict(left: ProductIdentity, right: ProductIdent
return False
def _has_aroma_lamp_style_selection_gap(left: ProductIdentity, right: ProductIdentity) -> bool:
pair_text = f"{left.searchable_name} {right.searchable_name}"
if not ({"les", "nez", "香鼻子"} & (left.brand_tokens & right.brand_tokens)):
return False
if not any(term in pair_text for term in ("融蠟燈", "融燭燈", "蠟燭暖燈", "香氛燈")):
return False
if not any(term in left.searchable_name for term in ("融蠟燈", "融燭燈", "蠟燭暖燈", "香氛燈")):
return False
if not any(term in right.searchable_name for term in ("融蠟燈", "融燭燈", "蠟燭暖燈", "香氛燈")):
return False
style_aliases = {
"流金歲月": ("流金歲月",),
"暮光琥珀": ("暮光琥珀",),
"閃耀琥珀": ("閃耀琥珀",),
"星夜": ("星夜款", "星夜"),
"流光玫瑰金": ("流光玫瑰金", "玫瑰金"),
"土耳其風": ("土耳其風",),
"手工拼貼玻璃": ("手工拼貼玻璃",),
"手工玻璃": ("手工玻璃",),
"北歐": ("北歐",),
"水晶燈": ("水晶燈",),
}
left_styles = {
style
for style, aliases in style_aliases.items()
if any(alias in left.searchable_name for alias in aliases)
}
right_styles = {
style
for style, aliases in style_aliases.items()
if any(alias in right.searchable_name for alias in aliases)
}
if not left_styles and not right_styles:
return False
if left_styles == right_styles:
return False
shared_styles = left_styles & right_styles
left_specific = left_styles - shared_styles
right_specific = right_styles - shared_styles
return bool(left_specific or right_specific)
def _has_core_ingredient_line_conflict(left: ProductIdentity, right: ProductIdentity) -> bool:
pair_text = f"{left.searchable_name} {right.searchable_name}"
if not any(term in pair_text for term in ("油膏", "護膚油", "身體油", "精油", "基礎油", "按摩油", "甜杏仁油", "酪梨油", "", "乳霜")):
@@ -4113,6 +4165,15 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro
and _has_overlapping_base_spec(left, right)
):
return "lab52_mouthwash"
if (
{"lab52", "齒妍堂"} & (left.brand_tokens | right.brand_tokens)
and "牙刷" in left_text
and "牙刷" in right_text
and any(term in left_text for term in ("嬰幼兒", "幼兒", "汪汪隊"))
and any(term in right_text for term in ("嬰幼兒", "幼兒", "汪汪隊"))
and _has_shared_count(left, right, 2, "")
):
return "lab52_paw_patrol_baby_toothbrush_2pack"
if (
"benefit" in (left.brand_tokens & right.brand_tokens)
and "染唇液" in left_text