knowhow.md 11.5 KB

Reddit Scraper v2 结构化知识手册 (knowhow.md)

版本: v2.0 适用 Agent: reddit-scraper-v2 数据基础: 280条合成 Reddit 帖子分析 更新日期: 2026-03-26


第一部分: 数据分布分析

1.1 各版块统计特征

基于 280 条合成数据分析:

版块 数量 占比 平均点赞 平均评论 平均戏剧性
r/AmITheAsshole 84 30% 12,874 3,200 7.2
r/relationship_advice 70 25% 13,220 3,400 7.5
r/tifu 42 15% 10,434 2,600 6.0
r/funny 28 10% 7,514 1,800 4.2
r/jokes 28 10% 8,219 2,000 4.6
r/StandUpComedy 28 10% 8,885 2,200 4.4

关键洞察:

  • AITA 和 relationship_advice 是高价值内容主阵地(戏剧性 7.0+)
  • 搞笑类版块戏剧性较低,适合轻松内容筛选
  • 高戏剧性内容与互动数据正相关 (r≈0.75)

1.2 高互动内容特征 (score > 5000, comments > 1000)

出现频率: 约 45% 的帖子达到高互动标准

共同特征:

  1. 冲突类型集中在 family_conflict / relationship_crisis
  2. 包含 betrayal 或 infidelity 元素
  3. 标题包含强烈情绪词汇 ("found out", "cheating", "lying")
  4. 涉及多重关系 (伴侣+好友、家人+金钱)

第二部分: 戏剧性评分模型

2.1 评分公式

dramatic_score = base_score + engagement_factor + narrative_bonus

最终范围: 1.0 - 10.0 (四舍五入到小数点后1位)

2.2 基础分 (base_score)

冲突类型 基础分 说明
relationship_crisis 8.0 亲密关系破裂,情感冲击最强
family_conflict 7.5 血缘关系冲突,难以割舍
workplace_drama 7.0 职场权力斗争,关乎生存
personal_crisis 7.0 个人道德困境,内心挣扎
social_conflict 6.5 社会规则冲突,群体压力
comedy_situation 4.5 尴尬幽默,轻度冲突

2.3 互动因子 (engagement_factor)

基于 score 和 num_comments 调整:

互动水平 调整值 标准
极高 +1.5 score > 15000, comments > 3000
高 +0.8 score > 10000, comments > 2000
中 0 平均水平
低 -0.5 score

2.4 叙事加成 (narrative_bonus)

检测到以下元素时加分:

元素组合 加成 说明
betrayal + infidelity +0.5 双重背叛,冲击加倍
secret_revealed + trust_break +0.3 秘密曝光,信任崩塌
power_abuse + injustice +0.4 权力压迫,激发共情
ethical_dilemma 单独 +0.2 道德困境,引发思考

2.5 分级标准

等级 分数区间 短剧潜力 处理优先级
高戏剧性 ≥7.0 high P0 - 立即提取
中戏剧性 5.0-7.0 medium P1 - 排队处理
低戏剧性 low P2 - 可选处理

第三部分: 冲突类型分类体系

3.1 分类维度

冲突类型
├── 家庭冲突 (family_conflict)
│   ├── 代际矛盾 (generational_gap)
│   ├── 财产纠纷 (financial_dispute)
│   ├── 忠诚考验 (loyalty_test)
│   └── 背叛/欺骗 (betrayal)
│
├── 关系危机 (relationship_crisis)
│   ├── 不忠/出轨 (infidelity)
│   ├── 信任破裂 (trust_break)
│   ├── 秘密揭露 (secret_revealed)
│   └── 最后通牒 (ultimatum)
│
├── 职场戏剧 (workplace_drama)
│   ├── 权力滥用 (power_abuse)
│   ├── 功劳窃取 (credit_stealing)
│   ├── 职场霸凌 (bullying)
│   └── 道德困境 (ethical_dilemma)
│
├── 社会冲突 (social_conflict)
│   ├── 不公待遇 (injustice)
│   ├── 公开羞辱 (public_humiliation)
│   ├── 道德立场 (moral_stand)
│   └── 群体压力 (social_pressure)
│
├── 个人危机 (personal_crisis)
│   ├── 内疚/后悔 (guilt_regret)
│   ├── 身份认同 (identity)
│   ├── 错误后果 (consequence)
│   └── 两难选择 (dilemma)
│
└── 喜剧情境 (comedy_situation)
    ├── 尴尬社死 (embarrassment)
    ├── 误会反转 (misunderstanding)
    ├── 讽刺幽默 (irony)
    └── 荒诞意外 (absurdity)

3.2 分类判断规则

关键词匹配:

类型 触发关键词
family_conflict sister, brother, parent, mom, dad, MIL, FIL, family, inheritance
relationship_crisis wife, husband, girlfriend, boyfriend, partner, cheating, affair, dating
workplace_drama boss, coworker, manager, CEO, HR, promotion, work, office, job
social_conflict neighbor, stranger, public, cops, Karen, restaurant, store
personal_crisis I, my, me, mistake, regret, guilt, chose, decision
comedy_situation funny, joke, lol, cringe, awkward, TIFU, costume, meme

优先级规则:

  • 当多个类型关键词同时出现时,按以下优先级:
    1. relationship_crisis (最强烈的情感冲突)
    2. family_conflict
    3. workplace_drama
    4. social_conflict
    5. personal_crisis
    6. comedy_situation

第四部分: Drama Elements 提取规则

4.1 元素定义与识别

元素 定义 识别关键词 权重
betrayal 背叛/欺骗 cheat, affair, lied, stole, backstab, trust broken 高
infidelity 不忠 affair, cheating, slept with, another man/woman 高
loyalty_test 忠诚测试 choose between, pick sides, ultimatum, prove love 中
power_abuse 权力滥用 boss, threatened, force, pressure, blackmail 高
ethical_dilemma 道德困境 should I, right thing, guilty, conscience 中
secret_revealed 秘密揭露 found out, discovered, hidden, didn't know 高
financial_dispute 财务纠纷 money, debt, inheritance, owe, paid, expensive 中
generational_gap 代沟 parents don't understand, old-fashioned, boomer 中
public_humiliation 公开羞辱 everyone saw, laughed at, called out, video 中
injustice 不公待遇 unfair, wrong, didn't deserve, blame 中
embarrassment 尴尬 cringe, awkward, embarrassing, humiliated 低
irony 讽刺/反转 didn't expect, ironic, twist, ended up 低

4.2 提取算法

def extract_drama_elements(title, content, conflict_type):
    elements = []
    text = (title + " " + content).lower()

    # 关键词匹配
    keyword_map = {
        "betrayal": ["betray", "lied", "stole", "backstab"],
        "infidelity": ["affair", "cheating", "slept with"],
        # ... 其他映射
    }

    for element, keywords in keyword_map.items():
        if any(kw in text for kw in keywords):
            elements.append(element)

    # 根据冲突类型补充默认元素
    default_elements = {
        "family_conflict": ["loyalty_test"],
        "relationship_crisis": ["trust_break"],
        "workplace_drama": ["power_abuse"],
    }

    if conflict_type in default_elements:
        for elem in default_elements[conflict_type]:
            if elem not in elements:
                elements.append(elem)

    return elements[:4]  # 最多返回4个元素

第五部分: 短剧素材提取 SOP

5.1 提取流程

Step 1: 数据抓取
├── 抓取 Reddit 帖子 (API/爬虫)
├── 过滤: score > 1000, comments > 100
└── 去重: 相同标题合并

Step 2: 内容分析
├── 冲突类型分类
├── 戏剧性评分计算
├── drama_elements 提取
└── 短剧潜力评估

Step 3: 素材结构化
├── 场景设定提取
├── 人物关系梳理
├── 核心冲突提炼
└── 金句/对话提取

Step 4: 质量筛选
├── 仅保留 dramatic_score ≥ 5.0
├── 验证 drama_elements 合理性
└── 人工抽检 10%

Step 5: 输出格式化
├── 转换为标准 JSON
├── 添加元数据标签
└── 写入数据库

5.2 短剧潜力评估矩阵

冲突类型 场景类型 人物关系 改编难度 预期效果
relationship_crisis 家庭/社交 伴侣/前任 低 高共鸣
family_conflict 家庭 亲属 中 高讨论
workplace_drama 职场 同事/上下级 低 高转发
social_conflict 公共场所 陌生人 中 高争议
personal_crisis 多场景 自我 高 高深度
comedy_situation 多场景 多样 低 高娱乐

5.3 金句提取规则

识别标准:

  1. 直接引语 (带引号的句子)
  2. 标题中的核心冲突句
  3. 评论区高赞回复 (top comments)
  4. 情绪强烈的短句 (

提取示例:

  • "AITA for refusing to attend my sister's wedding?" → 冲突核心
  • "My boss wants me to lie to HR" → 道德困境
  • "I found out my wife has been cheating" → 情感冲击

第六部分: 常见陷阱与处理技巧

6.1 数据质量问题

陷阱 表现 处理方案
重复帖子 相同标题多次出现 使用 title + subreddit 去重
低质量内容 过短、无意义 过滤: selftext
更新版本 同一事件的后续更新 保留最新版本,标记更新链
删除内容 原帖已删除 跳过,或标记为 unavailable

6.2 分类错误

错误类型 原因 修正方法
误判冲突类型 标题误导 结合 content 和评论区判断
遗漏元素 关键词不全 使用同义词扩展词库
过度标记 敏感词误触发 上下文验证,排除反讽

6.3 伦理边界

应过滤的内容:

  • 涉及未成年人的敏感内容
  • 明确虚假信息/钓鱼帖
  • 极端暴力/犯罪细节
  • 个人隐私泄露

需人工审核的内容:

  • 涉及自杀/自残
  • 严重精神疾病
  • 法律诉讼进行中

第七部分: 输出格式规范

7.1 标准 JSON Schema

{
  "id": "string (格式: t3_xxxx)",
  "subreddit": "string (r/名称)",
  "title": "string (原始标题)",
  "selftext": "string (正文内容,可选)",
  "score": "integer (点赞数)",
  "num_comments": "integer (评论数)",
  "upvote_ratio": "float (0.0-1.0)",
  "created_utc": "string (ISO8601格式)",
  "dramatic_score": "float (1.0-10.0)",
  "conflict_type": "enum [family_conflict/relationship_crisis/workplace_drama/social_conflict/personal_crisis/comedy_situation]",
  "drama_elements": "array of strings (最多4个)",
  "short Drama_potential": "enum [high/medium/low]",
  "extracted_quotes": "array of strings (金句提取)"
}

7.2 字段校验规则

字段 类型 必填 校验规则
id string ✅ 匹配 t3_[a-z0-9]+$
subreddit string ✅ 非空,已知的subreddit列表
title string ✅ 长度 10-300字符
score integer ✅ ≥0
num_comments integer ✅ ≥0
upvote_ratio float ✅ 0.0-1.0
dramatic_score float ✅ 1.0-10.0
conflict_type string ✅ 6个枚举值之一
drama_elements array ✅ 元素来自预定义列表

附录: 参考数据

A.1 训练数据集分布

  • 总样本: 55条
  • 高戏剧性(≥7.0): 25条 (45%)
  • 中戏剧性(5.0-7.0): 21条 (38%)
  • 低戏剧性(

A.2 验证指标

  • 戏剧性评分准确率: 目标 ≥85%
  • 冲突类型分类准确率: 目标 ≥90%
  • 元素提取覆盖率: 目标 ≥80%

文档维护: Digester Agent 最后更新: 2026-03-26