feat(config): align content strategy with brand direction
initial_data: field descriptions humanized, collector search queries include long-tail keywords, platform formats updated collector.py: DEFAULT_CHINA_PAINS expanded with specific pain questions (e.g. '35岁学AI来得及吗') topic_selector.py: domain mapping 11->18 entries (Prompt/AI编程/AI写作/数据隐私/AI教育/一人企业) Ultraworked with Sisyphus Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -105,7 +105,7 @@ def import_initial_data():
|
|||||||
"default_format": "深度分析 3000-8000字,数据驱动",
|
"default_format": "深度分析 3000-8000字,数据驱动",
|
||||||
"compliance_rules": {
|
"compliance_rules": {
|
||||||
"max_title_len": 100,
|
"max_title_len": 100,
|
||||||
"allowed_tags": ["科技", "生活", "职场", "教育", "可持续", "AI", "远程工作", "个人成长"],
|
"allowed_tags": ["科技", "AI", "效率", "职场", "教育", "远程工作", "未来工作", "工具"],
|
||||||
"forbidden_patterns": ["加微信", "私聊", "付费咨询", "点击领取"]
|
"forbidden_patterns": ["加微信", "私聊", "付费咨询", "点击领取"]
|
||||||
},
|
},
|
||||||
"is_active": True,
|
"is_active": True,
|
||||||
@@ -124,7 +124,7 @@ def import_initial_data():
|
|||||||
"default_format": "个人叙事 2000-4000字,对话感",
|
"default_format": "个人叙事 2000-4000字,对话感",
|
||||||
"compliance_rules": {
|
"compliance_rules": {
|
||||||
"max_title_len": 32,
|
"max_title_len": 32,
|
||||||
"allowed_tags": ["科技", "生活", "职场", "教育", "可持续", "AI", "远程工作", "个人成长"],
|
"allowed_tags": ["科技", "AI", "效率", "职场", "教育", "远程工作", "未来工作", "工具"],
|
||||||
"forbidden_patterns": ["诱导分享", "朋友圈", "转发群"]
|
"forbidden_patterns": ["诱导分享", "朋友圈", "转发群"]
|
||||||
},
|
},
|
||||||
"is_active": True,
|
"is_active": True,
|
||||||
@@ -143,7 +143,7 @@ def import_initial_data():
|
|||||||
"default_format": "精炼干货 400-1000字,实用优先",
|
"default_format": "精炼干货 400-1000字,实用优先",
|
||||||
"compliance_rules": {
|
"compliance_rules": {
|
||||||
"max_title_len": 50,
|
"max_title_len": 50,
|
||||||
"allowed_tags": ["生活方式", "可持续", "AI", "个人成长", "极简", "环保"],
|
"allowed_tags": ["AI", "效率", "科技", "工具", "职场", "生活", "学习方法"],
|
||||||
"forbidden_patterns": ["私信", "加群", "导流"]
|
"forbidden_patterns": ["私信", "加群", "导流"]
|
||||||
},
|
},
|
||||||
"is_active": True,
|
"is_active": True,
|
||||||
@@ -163,9 +163,9 @@ def import_initial_data():
|
|||||||
else:
|
else:
|
||||||
# 更新已有平台配置的字数要求(迁移:2026-06 内容质量升级)
|
# 更新已有平台配置的字数要求(迁移:2026-06 内容质量升级)
|
||||||
platform_updates = {
|
platform_updates = {
|
||||||
"zhihu": {"min_words": 3000, "max_words": 8000, "default_format": "深度分析 3000-8000字,数据驱动"},
|
"zhihu": {"min_words": 3000, "max_words": 8000, "default_format": "深度分析 3000-8000字,数据驱动+观点交锋,用一手数据和独特视角切入"},
|
||||||
"wechat": {"min_words": 2000, "max_words": 4000, "default_format": "个人叙事 2000-4000字,对话感"},
|
"wechat": {"min_words": 2000, "max_words": 4000, "default_format": "科技人文叙事 2000-4000字,个人反思+情感共鸣,记录人与技术之间的故事"},
|
||||||
"xiaohongshu": {"min_words": 400, "max_words": 1000, "default_format": "精炼干货 400-1000字,实用优先"},
|
"xiaohongshu": {"min_words": 400, "max_words": 1000, "default_format": "精炼干货 400-1000字,亲测数据+实操结果,每个结论配真实对比"},
|
||||||
}
|
}
|
||||||
for p in db.query(PlatformConfig).all():
|
for p in db.query(PlatformConfig).all():
|
||||||
if p.platform in platform_updates:
|
if p.platform in platform_updates:
|
||||||
@@ -178,41 +178,36 @@ def import_initial_data():
|
|||||||
|
|
||||||
if db.query(TopicField).count() == 0:
|
if db.query(TopicField).count() == 0:
|
||||||
fields = [
|
fields = [
|
||||||
{"name": "未来工作方式", "icon": "💼", "color": "#667eea", "description": "远程工作、零工经济、职业转型", "sort_order": 1},
|
{"name": "AI与效率", "icon": "🤖", "color": "#764ba2", "description": "AI工具实测对比、工作流效率方法、前沿资讯解读——关注技术如何改变人的工作方式", "sort_order": 1},
|
||||||
{"name": "AI与效率", "icon": "🤖", "color": "#764ba2", "description": "AI工具、数字助手、效率方法", "sort_order": 2},
|
{"name": "科技人文", "icon": "🔬", "color": "#f56c6c", "description": "AI伦理困境、数字生活反思、人机关系探索——科技的温度与边界", "sort_order": 2},
|
||||||
{"name": "可持续生活", "icon": "🌿", "color": "#67c23a", "description": "环保、低碳、自然生活方式", "sort_order": 3},
|
{"name": "未来工作方式", "icon": "💼", "color": "#667eea", "description": "远程协作实践、AI时代职业转型、一人企业模式——未来不是等来的", "sort_order": 3},
|
||||||
{"name": "数字游民", "icon": "🌍", "color": "#409eff", "description": "旅行、地理自由、海外生活", "sort_order": 4},
|
|
||||||
{"name": "个人成长", "icon": "📚", "color": "#e6a23c", "description": "学习、技能、认知升级", "sort_order": 5},
|
|
||||||
{"name": "科技人文", "icon": "🔬", "color": "#f56c6c", "description": "科技伦理、数字生活反思", "sort_order": 6},
|
|
||||||
]
|
]
|
||||||
for f in fields:
|
for f in fields:
|
||||||
db.add(TopicField(**f))
|
db.add(TopicField(**f))
|
||||||
db.commit()
|
db.commit()
|
||||||
print("✅ 插入默认领域配置")
|
print("✅ 插入默认领域配置(聚焦AI×人文×未来工作)")
|
||||||
|
|
||||||
if db.query(CollectorCategory).count() == 0:
|
if db.query(CollectorCategory).count() == 0:
|
||||||
default_cats = [
|
default_cats = [
|
||||||
{"name": "循环消费", "search_query": "以旧换新 二手交易 闲置 循环 2026", "description": "以旧换新/二手交易/租赁经济 | 2025年二手交易额1.69万亿", "sort_order": 1, "is_active": True},
|
{"name": "AI前沿资讯", "search_query": "AI 人工智能 大模型 2026 前沿 突破 论文解读", "description": "AI行业动态、大模型发布、技术突破 | 2026年AI全面嵌入产业", "sort_order": 1, "is_active": True},
|
||||||
{"name": "低碳出行", "search_query": "新能源车 骑行 绿色通勤 低碳出行 2026", "description": "新能源车/骑行/绿色出行 | 年产销破1000万辆", "sort_order": 2, "is_active": True},
|
{"name": "AI工具实测", "search_query": "AI工具 效率提升 工作流 prompt教程 Cursor Copilot 2026", "description": "AI工具评测、效率工作流、实操指南 | 2026年AI工具爆发", "sort_order": 2, "is_active": True},
|
||||||
{"name": "干净饮食", "search_query": "干净饮食 有机食品 植物基 本地食材 2026", "description": "有机食品/植物基/本地食材 | 有机食品1247亿", "sort_order": 3, "is_active": True},
|
{"name": "AI与职场", "search_query": "AI 裁员 职业转型 AI技能 远程工作 一人企业 2026", "description": "AI对就业影响、职业转型、技能升级 | 2026年AI重塑就业结构", "sort_order": 3, "is_active": True},
|
||||||
{"name": "零浪费生活", "search_query": "零浪费 自带杯 极简生活 可持续时尚 2026", "description": "自带杯/极简/可持续时尚 | 自带杯笔记277万篇", "sort_order": 4, "is_active": True},
|
{"name": "AI生活化", "search_query": "AI陪伴 AI心理咨询 生活助手 AI写作 智能体 2026", "description": "AI心理咨询/生活搭子/AI人格化 | 商业笔记互动增长263%", "sort_order": 4, "is_active": True},
|
||||||
{"name": "绿色家电与节能", "search_query": "绿色家电 一级能效 以旧换新 节能 2026", "description": "一级能效/国补政策 | 一级能效占比90%+", "sort_order": 5, "is_active": True},
|
{"name": "科技人文", "search_query": "AI伦理 数字生活 科技反思 人机关系 数据隐私 2026", "description": "AI伦理/数字生活反思/科技温度 | AI从工具到共生", "sort_order": 5, "is_active": True},
|
||||||
{"name": "碳普惠", "search_query": "碳账户 碳普惠 个人碳减排 蚂蚁森林 2026", "description": "碳账户/碳普惠/个人减排 | 武汉200万碳账户", "sort_order": 6, "is_active": True},
|
|
||||||
{"name": "环保科技产品", "search_query": "环保科技 绿色产品 可持续材料 2026", "description": "可持续材料/绿色产品 | 购买占比超32%", "sort_order": 7, "is_active": True},
|
|
||||||
{"name": "AI与效率", "search_query": "AI工具 人工智能 效率提升 2026", "description": "AI工具/效率方法/数字助手 | 2026年AI深度融入消费与生活", "sort_order": 8, "is_active": True},
|
|
||||||
]
|
]
|
||||||
for cd in default_cats:
|
for cd in default_cats:
|
||||||
existing = db.query(CollectorCategory).filter(CollectorCategory.name == cd["name"]).first()
|
existing = db.query(CollectorCategory).filter(CollectorCategory.name == cd["name"]).first()
|
||||||
if not existing:
|
if not existing:
|
||||||
db.add(CollectorCategory(**cd))
|
db.add(CollectorCategory(**cd))
|
||||||
db.commit()
|
db.commit()
|
||||||
print("✅ 插入默认采集类别和信息源")
|
print("✅ 插入默认采集类别(聚焦AI×科技人文)")
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
# 补充缺失的类别和信息源(对已有数据库的迁移)
|
# 补充缺失的采集源(对已有数据库的迁移)
|
||||||
for sd in [
|
for sd in [
|
||||||
{"name": "AI工具搜索", "source_type": "web_search", "query": "AI工具 人工智能 效率提升 2026", "credibility": "medium", "focus": "AI与效率", "sort_order": 99, "is_active": True},
|
{"name": "AI前沿搜索", "source_type": "web_search", "query": "AI 人工智能 大模型 前沿 2026", "credibility": "medium", "focus": "AI前沿资讯", "sort_order": 1, "is_active": True},
|
||||||
|
{"name": "AI工具搜索", "source_type": "web_search", "query": "AI工具 效率提升 AI工作流 2026", "credibility": "medium", "focus": "AI工具实测", "sort_order": 2, "is_active": True},
|
||||||
]:
|
]:
|
||||||
if not db.query(CollectorSource).filter(CollectorSource.name == sd["name"]).first():
|
if not db.query(CollectorSource).filter(CollectorSource.name == sd["name"]).first():
|
||||||
db.add(CollectorSource(**sd))
|
db.add(CollectorSource(**sd))
|
||||||
|
|||||||
+28
-23
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
内容采集:趋势抓取 → 选题生成 → 存入选题库
|
内容采集管道:趋势抓取 → 分析 → 选题生成 → 存入选题库
|
||||||
收集热点趋势信息,经LLM分析后生成选题建议并存入数据库
|
聚焦AI与科技人文领域,从RSS搜索和Web搜索采集信息,经LLM分析后生成选题
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -42,14 +42,11 @@ logging.basicConfig(
|
|||||||
)
|
)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
DEFAULT_CHINA_PAINS = {
|
DEFAULT_CHINA_PAINS = {
|
||||||
"循环消费": "以旧换新流程繁琐、二手商品信任缺失、租赁市场不规范",
|
"AI工具实测": "AI工具选择困难、免费版功能太受限、ChatGPT不如国产好用、学习曲线陡峭、不知道哪些AI工具真正值得付费、看了测评还是不知道怎么用",
|
||||||
"低碳出行": "新能源车充电设施不足、城市规划不支持骑行、通勤距离长",
|
"AI前沿资讯": "AI更新太快跟不上、论文太多看不完、不知道哪些是真突破、被营销号带偏、每天刷AI新闻但感觉什么都没学到",
|
||||||
"干净饮食": "有机食品价格高、真伪难辨、外卖为主的生活方式难以改变",
|
"未来工作方式": "AI裁员焦虑加剧、远程协作效率打折、职业方向看不清、技能更新压力大、35岁学AI来得及吗、转行AI需要什么技能",
|
||||||
"零浪费生活": "环保产品溢价高、可持续选择不便、漂绿营销难以分辨",
|
"科技人文反思": "AI伦理边界模糊、数据隐私被侵蚀、数字依赖越来越重、人机关系困惑、孩子该不该用AI写作业、AI生成的内容能信吗",
|
||||||
"绿色家电与节能": "绿色家电初期投入高、节能效果难量化、老旧小区改造难",
|
"AI职场应用": "AI替代担心、岗位技能要求变了、职场竞争加剧、缺乏AI实操指导、怎么用AI写周报、怎么用AI做数据分析、AI提示词怎么写才有效",
|
||||||
"碳普惠": "碳账户普及率低、减排量兑换吸引力不足、公众认知有限",
|
|
||||||
"环保科技产品": "绿色产品溢价68%难以承受、缺乏统一认证标准、担心漂绿",
|
|
||||||
"AI与效率": "AI工具选择困难、数据隐私担忧、学习成本高、实际效果难验证"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cached_china_pains = None
|
_cached_china_pains = None
|
||||||
@@ -87,22 +84,22 @@ def _get_china_pain(category: str) -> str:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SustainabilitySource:
|
class SustainabilitySource:
|
||||||
"""可持续性信息源"""
|
"""内容采集源"""
|
||||||
name: str
|
name: str
|
||||||
type: str # rss, web_search, web, api, local
|
type: str # rss, web_search, web, api, local
|
||||||
url: Optional[str] = None # RSS URL 或通用链接
|
url: Optional[str] = None # RSS URL 或通用链接
|
||||||
update_frequency: str = "daily"
|
update_frequency: str = "daily"
|
||||||
credibility: str = "medium"
|
credibility: str = "medium"
|
||||||
focus: str = "可持续性"
|
focus: str = "AI与科技"
|
||||||
keywords: Optional[List[str]] = None # 源特定关键词
|
keywords: Optional[List[str]] = None # 源特定关键词
|
||||||
query: Optional[str] = None # 搜索查询词(w eb_search类型用)
|
query: Optional[str] = None # 搜索查询词(w eb_search类型用)
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SustainabilityCase:
|
class SustainabilityCase:
|
||||||
"""可持续性案例"""
|
"""内容案例"""
|
||||||
id: str
|
id: str
|
||||||
country: str
|
country: str
|
||||||
category: str # 子领域:零浪费生活、循环消费等
|
category: str # 类别:AI前沿资讯、AI工具实测等
|
||||||
title: str
|
title: str
|
||||||
core_idea: str
|
core_idea: str
|
||||||
data_facts: str
|
data_facts: str
|
||||||
@@ -118,7 +115,7 @@ class SustainabilityCase:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SustainabilityTopic:
|
class SustainabilityTopic:
|
||||||
"""可持续性选题"""
|
"""AI与科技选题"""
|
||||||
id: str
|
id: str
|
||||||
title: str
|
title: str
|
||||||
cases: List[str] # 关联的案例ID列表
|
cases: List[str] # 关联的案例ID列表
|
||||||
@@ -128,7 +125,7 @@ class SustainabilityTopic:
|
|||||||
mvp_actions: str
|
mvp_actions: str
|
||||||
estimated_length: int
|
estimated_length: int
|
||||||
priority_score: float
|
priority_score: float
|
||||||
field: str = "可持续生活系统" # 内容领域
|
field: str = "AI与效率" # 内容领域
|
||||||
format: str = "趋势洞察 + 实操指南" # 内容形式
|
format: str = "趋势洞察 + 实操指南" # 内容形式
|
||||||
core_concept: str = "" # 核心理念
|
core_concept: str = "" # 核心理念
|
||||||
audience_pain: str = "" # 受众痛点
|
audience_pain: str = "" # 受众痛点
|
||||||
@@ -150,7 +147,7 @@ class SustainabilityTopic:
|
|||||||
self.platform_urls = {}
|
self.platform_urls = {}
|
||||||
|
|
||||||
class SustainabilityCollector:
|
class SustainabilityCollector:
|
||||||
"""可持续性内容收集器"""
|
"""AI与科技内容采集器"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.load_config()
|
self.load_config()
|
||||||
@@ -191,7 +188,7 @@ class SustainabilityCollector:
|
|||||||
url=s.url or '',
|
url=s.url or '',
|
||||||
query=s.query or '',
|
query=s.query or '',
|
||||||
credibility=s.credibility or 'medium',
|
credibility=s.credibility or 'medium',
|
||||||
focus=s.focus or '可持续性',
|
focus=s.focus or 'AI与科技',
|
||||||
))
|
))
|
||||||
logger.info(f"从DB加载 {len(cats)} 个类别, {len(self.sources)} 个信息源")
|
logger.info(f"从DB加载 {len(cats)} 个类别, {len(self.sources)} 个信息源")
|
||||||
db.close()
|
db.close()
|
||||||
@@ -209,7 +206,7 @@ class SustainabilityCollector:
|
|||||||
if 'base_url' in source_info and 'url' not in source_info:
|
if 'base_url' in source_info and 'url' not in source_info:
|
||||||
source_info['url'] = source_info.pop('base_url')
|
source_info['url'] = source_info.pop('base_url')
|
||||||
source_info.setdefault('update_frequency', 'daily')
|
source_info.setdefault('update_frequency', 'daily')
|
||||||
source_info.setdefault('focus', '可持续性')
|
source_info.setdefault('focus', 'AI与科技')
|
||||||
source_info.setdefault('keywords', None)
|
source_info.setdefault('keywords', None)
|
||||||
allowed_keys = {'name', 'type', 'url', 'update_frequency', 'credibility', 'focus', 'keywords', 'query'}
|
allowed_keys = {'name', 'type', 'url', 'update_frequency', 'credibility', 'focus', 'keywords', 'query'}
|
||||||
filtered_info = {k: v for k, v in source_info.items() if k in allowed_keys}
|
filtered_info = {k: v for k, v in source_info.items() if k in allowed_keys}
|
||||||
@@ -379,7 +376,7 @@ class SustainabilityCollector:
|
|||||||
'source_name': source.name
|
'source_name': source.name
|
||||||
})
|
})
|
||||||
|
|
||||||
logger.info(f"从 {source.name} 获取到 {len(articles)} 篇可持续性文章")
|
logger.info(f"从 {source.name} 获取到 {len(articles)} 篇文章")
|
||||||
return articles
|
return articles
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -720,8 +717,16 @@ class SustainabilityCollector:
|
|||||||
return topic
|
return topic
|
||||||
|
|
||||||
def map_category_to_field(self, category: str) -> str:
|
def map_category_to_field(self, category: str) -> str:
|
||||||
"""将案例类别映射到内容领域的字段"""
|
"""将采集类别映射到内容领域"""
|
||||||
return "可持续生活系统"
|
mapping = {
|
||||||
|
"AI前沿资讯": "AI与效率",
|
||||||
|
"AI工具实测": "AI与效率",
|
||||||
|
"AI趋势分析": "AI与效率",
|
||||||
|
"AI职场应用": "未来工作方式",
|
||||||
|
"科技人文反思": "科技人文",
|
||||||
|
"未来工作方式": "未来工作方式",
|
||||||
|
}
|
||||||
|
return mapping.get(category, "AI与效率")
|
||||||
|
|
||||||
def save_results(self):
|
def save_results(self):
|
||||||
"""保存收集结果"""
|
"""保存收集结果"""
|
||||||
@@ -851,7 +856,7 @@ class SustainabilityCollector:
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""主运行流程"""
|
"""主运行流程"""
|
||||||
logger.info("开始可持续性内容收集")
|
logger.info("开始AI与科技内容收集")
|
||||||
|
|
||||||
existing_titles = self._get_existing_titles()
|
existing_titles = self._get_existing_titles()
|
||||||
|
|
||||||
|
|||||||
@@ -24,18 +24,25 @@ TODAY = __import__('datetime').datetime.now().strftime("%Y-%m-%d")
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_TREND_DOMAIN_MAP = {
|
DEFAULT_TREND_DOMAIN_MAP = {
|
||||||
"远程工作": "未来工作方式",
|
|
||||||
"AI工具": "AI与效率",
|
"AI工具": "AI与效率",
|
||||||
"可持续生活": "可持续生活系统",
|
|
||||||
"知识管理": "个人知识工厂",
|
|
||||||
"数字生活": "科技人文交叉",
|
|
||||||
"科技人文": "科技人文交叉",
|
|
||||||
"个人成长": "个人成长",
|
|
||||||
"副业": "个人成长",
|
|
||||||
"AI创作": "AI与效率",
|
"AI创作": "AI与效率",
|
||||||
"未来工作": "未来工作方式",
|
"AI职场": "AI与效率",
|
||||||
"效率工具": "AI与效率",
|
"效率工具": "AI与效率",
|
||||||
"家庭教育": "科技人文交叉",
|
"Prompt": "AI与效率",
|
||||||
|
"提示词": "AI与效率",
|
||||||
|
"AI编程": "AI与效率",
|
||||||
|
"AI写作": "AI与效率",
|
||||||
|
"未来工作": "未来工作方式",
|
||||||
|
"远程工作": "未来工作方式",
|
||||||
|
"AI就业": "未来工作方式",
|
||||||
|
"一人企业": "未来工作方式",
|
||||||
|
"副业": "未来工作方式",
|
||||||
|
"科技人文": "科技人文",
|
||||||
|
"数字生活": "科技人文",
|
||||||
|
"AI伦理": "科技人文",
|
||||||
|
"AI情感": "科技人文",
|
||||||
|
"数据隐私": "科技人文",
|
||||||
|
"AI教育": "科技人文",
|
||||||
}
|
}
|
||||||
|
|
||||||
_cached_trend_domain_map = None
|
_cached_trend_domain_map = None
|
||||||
|
|||||||
Reference in New Issue
Block a user