補強 PChome 精準同款 total price 通道
This commit is contained in:
@@ -487,6 +487,18 @@ FOCUSED_IDENTITY_BRANDLESS_REVIEW_REASONS = {
|
||||
"the_forest_maple_diffuser_flower_brandless",
|
||||
}
|
||||
|
||||
FOCUSED_IDENTITY_TOTAL_PRICE_REASONS = {
|
||||
"3w_clinic_collagen_foundation_50ml_2pack",
|
||||
"hanamisui_moisture_original_gel_1_7g_3pack",
|
||||
"hanamisui_inclear_private_gel_1_7g_3pack",
|
||||
"the_ordinary_caffeine_egcg_30ml",
|
||||
"kussen_baby_butt_cream_50ml_3pack",
|
||||
"bone_diffuser_gift_3pack",
|
||||
"selection1990_half_dome_wax_lamp_white",
|
||||
"selection1990_bendable_wax_lamp_white",
|
||||
"canmake_tear_bag_palette",
|
||||
}
|
||||
|
||||
SEARCH_BROAD_ANCHORS = {
|
||||
"乳霜",
|
||||
"面霜",
|
||||
@@ -1807,13 +1819,24 @@ def _classify_match_quality(
|
||||
return "no_match", "none", "suppress"
|
||||
|
||||
direct_spec_evidence = spec_score >= 0.85 or bool(shared_models)
|
||||
focused_total_price_safe = "focused_exact_total_price_safe" in reason_set
|
||||
strong_identity_evidence = (
|
||||
brand_score >= 0.95
|
||||
and type_score >= 0.55
|
||||
and score >= 0.86
|
||||
and (direct_spec_evidence or (shared_anchor and token_score >= 0.62 and sequence_score >= 0.58))
|
||||
(
|
||||
brand_score >= 0.95
|
||||
and type_score >= 0.55
|
||||
and score >= 0.86
|
||||
and (direct_spec_evidence or (shared_anchor and token_score >= 0.62 and sequence_score >= 0.58))
|
||||
)
|
||||
or (
|
||||
focused_total_price_safe
|
||||
and brand_score >= 0.95
|
||||
and type_score >= 0.55
|
||||
and score >= 0.86
|
||||
)
|
||||
)
|
||||
if strong_identity_evidence and not catalog_count_omission:
|
||||
if focused_total_price_safe and "variant_selection_review" not in reason_set:
|
||||
return "exact", "total_price", "price_alert_exact"
|
||||
if multi_component_pair or "variant_selection_review" in reason_set:
|
||||
return "exact", "manual_review", "identity_review"
|
||||
return "exact", "total_price", "price_alert_exact"
|
||||
@@ -2024,6 +2047,22 @@ def score_marketplace_match(
|
||||
)
|
||||
)
|
||||
)
|
||||
focused_exact_total_price_safe = (
|
||||
focused_exact_line_reason in FOCUSED_IDENTITY_TOTAL_PRICE_REASONS
|
||||
and brand_score >= 0.95
|
||||
and not hard_veto
|
||||
and spec_score >= 0.45
|
||||
and token_score >= 0.30
|
||||
and sequence_score >= 0.40
|
||||
and (
|
||||
not variant_descriptor_conflict
|
||||
or focused_exact_line_reason == "hanamisui_inclear_private_gel_1_7g_3pack"
|
||||
)
|
||||
and "variant_selection_review" not in reasons
|
||||
)
|
||||
if focused_exact_total_price_safe:
|
||||
reasons.append("focused_exact_total_price_safe")
|
||||
reasons.append(f"focused_exact_identity_{focused_exact_line_reason}")
|
||||
|
||||
comparison_mode = "exact_identity"
|
||||
if _is_unit_comparable_candidate(
|
||||
@@ -3393,6 +3432,86 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro
|
||||
and "24張入" in right_text
|
||||
):
|
||||
return "gatsby_body_wipes_24"
|
||||
if (
|
||||
{"3w", "clinic"} <= (left.brand_tokens & right.brand_tokens)
|
||||
and "膠原蛋白粉底液" in left_text
|
||||
and "膠原蛋白粉底液" in right_text
|
||||
and _has_shared_volume(left, right, 50)
|
||||
and _has_exact_count_alignment(left, right)
|
||||
):
|
||||
return "3w_clinic_collagen_foundation_50ml_2pack"
|
||||
if (
|
||||
"花美水" in (left.brand_tokens & right.brand_tokens)
|
||||
and "moisture" in (left.brand_tokens & right.brand_tokens)
|
||||
and "保濕修護" in left_text
|
||||
and "保濕修護" in right_text
|
||||
and "精華凝膠" in left_text
|
||||
and "精華凝膠" in right_text
|
||||
and ("原黃金" in left_text and "原黃金" in right_text)
|
||||
and _has_shared_weight(left, right, 1.7)
|
||||
and _has_exact_count_alignment(left, right)
|
||||
):
|
||||
return "hanamisui_moisture_original_gel_1_7g_3pack"
|
||||
if (
|
||||
"花美水" in (left.brand_tokens & right.brand_tokens)
|
||||
and "inclear" in (left.brand_tokens & right.brand_tokens)
|
||||
and ("櫻克麗兒" in left_text and "櫻克麗兒" in right_text)
|
||||
and ("私密淨化凝膠" in left_text and "私密淨化凝膠" in right_text)
|
||||
and _has_shared_weight(left, right, 1.7)
|
||||
and _has_exact_count_alignment(left, right)
|
||||
):
|
||||
return "hanamisui_inclear_private_gel_1_7g_3pack"
|
||||
if (
|
||||
"ordinary" in (left.brand_tokens & right.brand_tokens)
|
||||
and "咖啡因" in left_text
|
||||
and "咖啡因" in right_text
|
||||
and "egcg" in left_raw
|
||||
and "egcg" in right_raw
|
||||
and "兒茶眼部配方" in left_text
|
||||
and "兒茶眼部配方" in right_text
|
||||
and _has_shared_volume(left, right, 30)
|
||||
):
|
||||
return "the_ordinary_caffeine_egcg_30ml"
|
||||
if (
|
||||
{"kussen", "葵森"} & (left.brand_tokens & right.brand_tokens)
|
||||
and "寶寶益菌屁屁膏" in left_text
|
||||
and "寶寶益菌屁屁膏" in right_text
|
||||
and _has_shared_volume(left, right, 50)
|
||||
and _has_exact_count_alignment(left, right)
|
||||
):
|
||||
return "kussen_baby_butt_cream_50ml_3pack"
|
||||
if (
|
||||
"bone" in (left.brand_tokens & right.brand_tokens)
|
||||
and "擴香禮盒三入組" in left_text
|
||||
and "擴香禮盒三入組" in right_text
|
||||
and all(component in left_text and component in right_text for component in ("原木麋鹿", "搖搖貓頭鷹", "薰衣草精油"))
|
||||
and _has_exact_count_alignment(left, right)
|
||||
):
|
||||
return "bone_diffuser_gift_3pack"
|
||||
if (
|
||||
{"1990", "選物"} <= (left.brand_tokens & right.brand_tokens)
|
||||
and "現代簡約半圓罩融燭燈" in left_text
|
||||
and "現代簡約半圓罩融燭燈" in right_text
|
||||
and "白色款" in left_text
|
||||
and "白色款" in right_text
|
||||
):
|
||||
return "selection1990_half_dome_wax_lamp_white"
|
||||
if (
|
||||
{"1990", "選物"} <= (left.brand_tokens & right.brand_tokens)
|
||||
and "歐式可彎融燭燈" in left_text
|
||||
and "歐式可彎融燭燈" in right_text
|
||||
and "白色款" in left_text
|
||||
and "白色款" in right_text
|
||||
):
|
||||
return "selection1990_bendable_wax_lamp_white"
|
||||
if (
|
||||
"canmake" in (left.brand_tokens & right.brand_tokens)
|
||||
and "淚袋專用盤" in left_text
|
||||
and "淚袋專用盤" in right_text
|
||||
and "淚袋眼影盤" in left_text
|
||||
and "淚袋眼影盤" in right_text
|
||||
):
|
||||
return "canmake_tear_bag_palette"
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user