ソースを参照

the batch_size of cal title quality score decreases from 20 to 10

luojunhui 5 日 前
コミット
28157654c4

+ 0 - 6
src/domains/content_quality/_utils.py

@@ -1,6 +1,5 @@
 """内容质量评估工具函数 —— Prompt 构建 + LLM 响应解析"""
 
-import hashlib
 import logging
 from typing import Dict, List
 
@@ -11,10 +10,6 @@ from ._const import ContentQualityConst
 logger = logging.getLogger(__name__)
 
 
-def md5(text: str) -> str:
-    return hashlib.md5(text.encode("utf-8")).hexdigest()
-
-
 # ═══════════════════════════════════════════════════════════════
 # Prompt 构建
 # ═══════════════════════════════════════════════════════════════
@@ -103,7 +98,6 @@ def parse_category_response(
 
 
 __all__ = [
-    "md5",
     "build_title_quality_prompt",
     "build_category_prompt",
     "parse_title_quality_response",

+ 2 - 2
src/domains/content_supply/_utils.py

@@ -1,12 +1,12 @@
 """供给域工具函数 —— API 响应解析、数据转换、搜索/账号/文章通用工具"""
 
-import hashlib
 import logging
 import re
 from datetime import datetime
 from typing import Dict, List, Tuple
 from urllib.parse import parse_qs, urlparse
 
+from src.infra.shared.tools import str_to_md5
 from src.infra.spider.wechat.gzh import get_article_list_from_account
 
 logger = logging.getLogger(__name__)
@@ -94,7 +94,7 @@ def parse_search_result(
         "wx_sn": extract_wx_sn(article_url) or "",
         "biz": extract_biz(article_url) or "",
         "title": title,
-        "title_md5": hashlib.md5(title.encode("utf-8")).hexdigest() if title else "",
+        "title_md5": str_to_md5(title) if title else "",
         "cover_url": article.get("cover_url", ""),
         "publish_time": publish_time,
     }