✨ feat: 智能会话主题追踪+词典分词器+话题切换检测 - #217
Open
yu-zhy wants to merge 1 commit into
Open
Conversation
新增本地实时主题追踪系统(TopicGraph)和可插拔词典分词器: ### 分词器(Segmenter) - Segmenter 接口, 支持多语言扩展 - 中文词典分词(正向最大匹配, jieba 词典), 首次使用自动下载 - POS 词性标注过滤虚词(连词/介词/助词/代词等不纳入关键词) - 单字二元组合并(补偿词典未收录的复合词) - FMM 算法修复: 长词优先(修复前高频短词会错误替换长词) - 安全加固: HTTP 30s 超时, 32MB 响应体限制, 缓存目录 0700 ### 主题追踪(TopicGraph) - TF-IDF + 余弦相似度实时追踪对话主题 - 会话侧重点摘要(SessionFocus) - 话题切换检测: 与会话主导话题比对, 区分"切换"与"扩展" - 虚词过滤基于 jieba POS 标注(删除硬编码词表) - 会话隔离: /new 切换时 TopicGraph 自动重建 ### 配置 - segmenter.yaml 独立配置文件(不污染 model.yaml) - language: zh 启用中文词典分词(默认不启用,零开销) ### 交互增强 - 话题切换时提示创建新会话 - 状态栏显示会话侧重点 - F2 鼠标穿透模式切换 - 右键输入区粘贴 Fixes itmisx#211
Owner
|
@yu-zhy 你是不是想优化会话的名称?我之前是想单独增加一个agent调用,让llm自动完成这个任务。 |
Author
|
@itmisx 主要是为了对会话中的主题进行跟踪,当会话中执行的请求与当前会话基本无关时提醒用户,建议创建新的会话。避免污染当前会话的上下文,影响后续AI的分析结果 |
Owner
|
@yu-zhy 好主意! |
Owner
|
@yu-zhy 但我觉得,把这个检测放到对话上下文中,让llm处理会不会更好?你如果认可,我可以实现一版,到时候,你体验一下先,我觉得这个能力大模型应该比本地能力要强,你的想法我是很认可的。 |
Author
|
使用LLM来实现是要多跑一次,为了这个功能多交一次税吧~~如果能使用本地的上下文来实现,不用交税的话就好了 |
Owner
|
@yu-zhy 不需要单独跑一次,是加入到系统提示词中的。这样很多东西,我们不需要考虑,比如配置,语言等 |
Author
|
但还是加个启用与不启用的开关吧~~可能还是会增加费用消耗吧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增本地实时主题追踪系统(TopicGraph)和可插拔词典分词器:
分词器(Segmenter)
主题追踪(TopicGraph)
配置