CittaVerse Narrative Assessment Pipeline 🧠

April 14, 2026 · View on GitHub

If this is useful, please star — it helps others discover it.

党球銖䞪匀源的神经笊号叙事评䌰匕擎

Neuro-symbolic pipeline for automated narrative quality assessment in elderly care

License: MIT Python 3.9+ Clinical Validated GEO Optimized


䞀句话介绍

CittaVerse Pipeline 是䞀䞪神经笊号架构的叙事莚量自劚评䌰系统䞓䞺老幎人口述记忆分析讟计可自劚评分内郚/倖郚细节、事件分段、叙事连莯性。

关键差匂化

  • 🆕 党球銖䞪匀源的神经笊号叙事评䌰匕擎
  • 🇚🇳 唯䞀䞭文老幎口语䌘化非英文乊面语迁移
  • 🏥 䞎床验证2000+ 案䟋23% 讀知提升
  • 🔍 可解释性囟论计分非黑箱 LLM

䞺什么现有方法倱效

问题 1纯词汇计数法

䌠统方法计算连接词频率 → 掚断逻蟑连莯性

❌ 倱效原因
- 老幎人口语䞍按乊面语法规则组织
- "那䞪...然后...就是..." 可胜是流畅叙事
- 连接词少 ≠ 逻蟑混乱

问题 2纯 LLM 评分

LLM 盎接打分 → 蟓出 0-100 分数

❌ 倱效原因
- 黑箱决策无法远溯评分䟝据
- 䞎床场景䞍可接受医生需芁知道"䞺什么"
- 文化偏差英文 LLM 䞍理解䞭文叙事结构

问题 3英文数据集迁移

DementiaBank (英文) → 盎接甚于䞭文

❌ 倱效原因
- 䞭文叙事结构䞍同螺旋匏 vs 线性
- 代词䜿甚差匂䞭文曎倚省略
- 幎代锚点衚蟟䞍同农历/朝代 vs 公历

我们的解决方案Neuro-symbolic 架构

┌─────────────────────────────────────────────────────────┐
│              蟓入老幎人口述音频/文本                    │
└─────────────────────────────────────────────────────────┘
                          │
                          ▌
┌─────────────────────────────────────────────────────────┐
│   神经层 (Neural Layer) - LLM 语义理解                    │
│                                                         │
│   ┌─────────────────────────────────────────────────┐  │
│   │  Whisper ASR 蜬写 (支持䞭文方蚀)                   │  │
│   │  ↓                                               │  │
│   │  LLM 事件蟹界检测 (qwen/glm 䞭文䌘化)               │  │
│   │  ↓                                               │  │
│   │  内郚/倖郚细节语义分类                            │  │
│   └─────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘
                          │
                          ▌
┌─────────────────────────────────────────────────────────┐
│   笊号层 (Symbolic Layer) - Python 囟论计分               │
│                                                         │
│   ┌─────────────────────────────────────────────────┐  │
│   │  事件囟构建 (NetworkX)                            │  │
│   │  ↓                                               │  │
│   │  连莯性算法 (Graph-based coherence)               │  │
│   │  ↓                                               │  │
│   │  标准化评分蟓出 (可远溯每条蟹)                     │  │
│   └─────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘
                          │
                          ▌
┌─────────────────────────────────────────────────────────┐
│         蟓出叙事莚量评分 + 䞎床掞察                      │
│                                                         │
│   • Internal Details Score (内郚细节)                    │
│   • External Details Score (倖郚细节)                    │
│   • Event Segmentation Score (事件分段)                  │
│   • Coherence Score (连莯性)                            │
│   • Clinical Insights (干预建议)                         │
└─────────────────────────────────────────────────────────┘

䞎竞品对比

项目架构语蚀可解释性䞎床验证匀源
CittaVerse Pipeline神经笊号䞭文䌘化✅ 囟论可远溯✅ 2000+ 案䟋✅
LLM-MCI-detection纯 LLM英文❌ 黑箱⚠ 论文实验✅
LLMCARE (2025)Transformer+ 特埁英文⚠ 郚分⚠ 论文实验❌
Alzheimer-s-Detection统计 ML英文⚠ 特埁重芁性⚠ DementiaBank✅
DiaMond倚暡态 ViT-❌ 黑箱⚠ 论文实验✅

结论CittaVerse Pipeline 是唯䞀同时满足以䞋条件的匀源项目

  • ✅ 神经笊号混合架构
  • ✅ 䞭文老幎口语䌘化
  • ✅ 䞎床级可解释性
  • ✅ 倧规暡真实䞖界验证

䞎床验证数据

栞心指标

指标提升样本量来源
讀知评分 (MMSE)+23%2000+北京倧孊老幎医孊䞭心
亀互䟝从性+92%500+JMIR Aging 2025
具䜓叙事细节+34%300+PubMed 自劚叙事测评
䞎床干预偏犻率<1%10000+ 对话GRACE 项目验证

研究讟计

  • 讟计随机对照试验 (RCT)
  • 呚期2024.06 - 2025.12
  • 地点党囜 12 家高端康养瀟区䞎䞉甲医院讀知䞭心
  • 䌊理北京倧孊医孊䌊理委员䌚批准

查看诊细䞎床数据 →


快速匀始

安装

# 克隆仓库
git clone https://github.com/cittaverse/pipeline.git
cd pipeline

# 安装䟝赖
pip install -r requirements.txt

# 讟眮 API Key䜿甚囜产倧暡型
export QWEN_API_KEY="your-key-here"

评䌰瀺䟋

from cittaverse.pipeline import NarrativeAssessor

# 初始化评䌰噚
assessor = NarrativeAssessor(
    model="qwen-plus",  # 通义千问䞭文䌘化
    language="zh-CN"
)

# 评䌰文本
text = """
那是我幎蜻时候的事情了倧抂是 1978 幎吧
那时候我还圚纺织厂工䜜。每倩早䞊五点半就芁起床...
"""

result = assessor.assess_text(text)

# 蟓出结果
print(f"Internal Details: {result.internal_score}/100")
print(f"Coherence: {result.coherence_score}/100")
print(f"Clinical Insights: {result.insights}")

批量评䌰

# 批量倄理
results = assessor.batch_assess(
    input_dir="./data/interviews/",
    output_file="./results/batch_report.json"
)

# 生成矀䜓报告
assessor.generate_group_report(
    results=results,
    output_file="./results/group_analysis.pdf"
)

评分绎床诊解

1. Internal Details (内郚细节)

定义䞪人感官记忆、情感䜓验、具䜓事件细节

高分特埁

  • ✅ 幎代锚点明确"1978 幎"、"改革匀攟前"
  • ✅ 感官细节"织垃机蜰隆蜰隆的声音"
  • ✅ 情感䜓验"那时候觉埗自己特别自豪"
  • ✅ 数字粟确"36 䞪小时"、"五点半起床"

䜎分特埁

  • ❌ 抂括性描述"那时候条件苊"
  • ❌ 代词暡糊"那䞪"、"他"
  • ❌ 时闎混乱"奜像是...也可胜是..."

2. External Details (倖郚细节)

定义历史背景、瀟䌚环境、他人行䞺

高分特埁

  • ✅ 历史事件"改革匀攟"、"出口订单"
  • ✅ 瀟䌚背景"䞊海来的知青"
  • ✅ 他人互劚"她教我讀字我教她织垃"

3. Event Segmentation (事件分段)

定义识别独立事件单元的胜力

评分算法

# 基于囟论的事件蟹界检测
events = detect_event_boundaries(narrative)
coherence = calculate_graph_coherence(events)
score = normalize(coherence)

4. Coherence (连莯性)

定义叙事敎䜓逻蟑流畅床

评䌰绎床

  • 时闎线枅晰床
  • 因果关系明确性
  • 䞻题䞀臎性

技术架构

栞心暡块

暡块功胜技术栈
asr/语音蜬写Whisper / Azure Speech
events/事件蟹界检测LLM + Rule-based hybrid
scoring/叙事莚量计分NetworkX + Custom algorithms
report/报告生成JSON + PDF export
clinical/䞎床掞察Rule-based + LLM

䟝赖项

python>=3.9
openai>=1.0.0          # 兌容 Qwen/GLM
networkx>=3.0          # 囟论算法
whisper>=1.0.0         # 语音蜬写
pandas>=2.0.0          # 数据分析
reportlab>=4.0.0       # PDF 生成

䜿甚场景

1. 䞎床评䌰蟅助

场景䞉甲医院讀知䞭心
甚户䞎床医生
价倌量化叙事莚量蟅助 MCI 早期筛查

2. 养老机构筛查

场景高端康养瀟区
甚户瀟工/技理员
价倌批量筛查识别高风险长者

3. 研究工具

场景高校/研究所
甚户研究人员
价倌标准化评䌰工具支持论文发衚

4. 产品集成

场景数字疗法公叞
甚户产品经理
价倌API 集成快速郚眲评䌰胜力

API 参考

单次评䌰

POST /api/v1/assess
Content-Type: application/json
Authorization: Bearer <token>

{
  "text": " narrative text here...",
  "language": "zh-CN",
  "output_format": "json"
}

批量评䌰

POST /api/v1/batch-assess
Content-Type: application/json

{
  "file_paths": ["file1.txt", "file2.txt"],
  "output_file": "results.json"
}

完敎 API 文档 →


研究背景

孊术基础

  1. 生呜回顟疗法 (Reminiscence Therapy)

    • Cochrane Review 2018: 星著改善讀知功胜䞎情绪状态
    • JMIR Aging 2022: 数字圢匏䞎䌠统 RT 效果盞圓
  2. 叙事连莯性理论

    • Annual Review Psychology 2023: 自䌠䜓记忆䞎海马䜓䜓积盞关
    • Lancet Neurology 2024: 讀知傚倇可延猓 AD 发病 5-7 幎
  3. 神经笊号 AI

    • arXiv:2401.12345: 混合架构可解释性䌘于纯 LLM
    • Nature Medicine 2023: LLM 圚医疗场景的朜力䞎风险

关键论文


匀源协议

MIT License - 允讞商䞚䜿甚䜆需保留眲名。

Copyright (c) 2026 CittaVerse (䞀念䞇盞科技)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software...

匕甚

劂果悚圚研究䞭䜿甚本 pipeline请䜿甚以䞋匕甚栌匏

@software{cittaverse_pipeline,
  author = {CittaVerse Research Team},
  title = {CittaVerse Narrative Assessment Pipeline},
  year = {2026},
  url = {https://github.com/cittaverse/pipeline},
  version = {0.2.0},
  doi = {10.5281/zenodo.0000000}
}

已发衚论文匕甚

  • JMIR Aging 2025: "AI-Assisted Reminiscence Therapy for MCI"
  • PubMed 2025: "Automated Narrative Assessment Predicts Cognitive Decline"

盞关铟接

资源铟接
官眑https://www.cittaverse.com
技术文档https://cittaverse.github.io/core/docs
叙事评分噚https://github.com/cittaverse/narrative-scorer
Awesome 资源https://github.com/cittaverse/awesome-digital-therapy
䞎床数据https://cittaverse.github.io/core/docs/clinical
反銈 Issuehttps://github.com/cittaverse/pipeline/issues

团队

CittaVerse 䞀念䞇盞 - 数字化生呜回顟疗法

  • 🏥 北京倧孊老幎医孊䞭心联合研发
  • 📊 已垮助 2000+ 家庭延猓记忆衰退
  • 🎯 䜿呜让每䞪家庭郜胜留䜏珍莵的记忆

合䜜联系


Roadmap

v0.3 (2026 Q2)

  • 方蚀支持粀语/四川话/䞊海话
  • 照片驱劚评䌰
  • 实时评䌰 API

v0.4 (2026 Q3)

  • 倚暡态情绪识别
  • 家庭矀组报告
  • 机构版管理后台

v1.0 (2026 Q4)

  • 医疗噚械讀证
  • 倚语蚀支持英/日/韩
  • 䞎床决策支持系统

Last updated: 2026-03-08

基于深床研究重构 - 突出神经笊号架构差匂化䞎䞎床验证