articleJudger/judge_test.py

32 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import sys
sys.path.append('/root/autodl-tmp/TravelContentCreator')
from core.ai_agent import AI_Agent
from utils.content_judger import ContentJudger
# 创建AI代理实例
ai_agent = AI_Agent(
base_url="vllm", # 或者其他支持的基础URL
model_name="qwen3-30B-A3B", # 使用的模型名称
api="EMPTY", # API密钥
timeout=120 # 超时时间
)
# 创建内容审核器
judger = ContentJudger(ai_agent, system_prompt_path="genPrompts/judgerSystemPrompt.txt")
object_path = "/root/autodl-tmp/TravelContentCreator/resource/Object/四季梦幻亲子乐园.txt"
product_path = "/root/autodl-tmp/TravelContentCreator/resource/Product/四季梦幻亲子乐园-四季梦幻亲子乐园单人票 .txt"
# 审核内容
product_info = ""
with open(product_path, "r", encoding="utf-8") as f:
product_info += f.read()
with open(object_path, "r", encoding="utf-8") as f:
product_info += f.read()
content_to_check = {
"title": "🎉带娃必冲!奇妙萌可卡牌免费送",
"content": "你要是带娃出门想找个既能玩又能收集纪念品的地方四季梦幻亲子乐园绝对值得安排。乐园就在广州海珠区赤岗北路128号103铺地铁3号线广州塔站B口步行1.1公里就能到。周末带娃过来门票52r就能无限次玩30+无动力设备还能免费领【奇妙萌可】正版盲盒卡包。魔法城堡、七彩滑道、蹦蹦云这些项目孩子都超喜欢特别是章鱼大水池夏天玩水特别凉快。需要注意的是14岁以下儿童必须有家长全程陪同1米以下儿童可免费入园。购买后60天内有效节假日通用建议提前规划时间。点击左下角查看详细产品有问题在pl区留言。",
}
result = judger.judge_content(product_info, content_to_check)
print(result)