From f392c514cdf9c6908a038b9ed61ad2400d4092a9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 12 Feb 2026 10:25:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=8A=9F=E6=95=88?= =?UTF-8?q?=E8=AF=8D=E9=BB=98=E8=AE=A4=E5=85=9C=E5=BA=95=EF=BC=8C=E5=93=81?= =?UTF-8?q?=E7=89=8C=E6=96=B9=E6=9C=AA=E9=85=8D=E7=BD=AE=E5=88=99=E4=B8=8D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- backend/app/api/scripts.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/app/api/scripts.py b/backend/app/api/scripts.py index 977d9d5..257d0df 100644 --- a/backend/app/api/scripts.py +++ b/backend/app/api/scripts.py @@ -38,8 +38,7 @@ router = APIRouter(prefix="/scripts", tags=["scripts"]) # 内置违禁词库(广告极限词) ABSOLUTE_WORDS = ["最好", "第一", "最佳", "绝对", "100%"] -# 默认功效词库(品牌方未配置时的兜底) -DEFAULT_EFFICACY_WORDS = ["根治", "治愈", "治疗", "药效", "疗效", "特效"] +# 功效词从品牌方规则库加载(category="功效词"),未配置则不检查 # 广告语境关键词(用于判断是否为广告场景) AD_CONTEXT_KEYWORDS = ["产品", "购买", "销量", "品质", "推荐", "价格", "优惠", "促销"] @@ -283,10 +282,8 @@ async def review_script( # 获取品牌方配置的所有规则数据 whitelist = await get_whitelist_for_brand(x_tenant_id, request.brand_id, db) all_tenant_words = await get_forbidden_words_for_tenant(x_tenant_id, db) - # 分离功效词和普通违禁词 + # 分离功效词和普通违禁词(品牌方未配置功效词则不检查) efficacy_words = [w["word"] for w in all_tenant_words if w.get("category") == "功效词"] - if not efficacy_words: - efficacy_words = list(DEFAULT_EFFICACY_WORDS) tenant_forbidden_words = [w for w in all_tenant_words if w.get("category") != "功效词"] competitors = await get_competitors_for_brand(x_tenant_id, request.brand_id, db) db_platform_rules = await get_active_platform_rules(