This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-skills/memory/2026-02-13.md
T
starmen1265 b7b40b1ece feat(deep_analyzer): 使用SRT简化时间格式 + 分块分析 + 纯文本AI
- 添加 load_srt() 支持 SRT 字幕格式
- 时间格式简化为 HH:MM:SS
- 超过3000字自动分块分析
- _merge_summaries 改用纯文本而非JSON
- 添加提取函数解析AI响应
2026-02-13 12:28:21 +08:00

68 lines
2.1 KiB
Markdown
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.
# 2026-02-13 语音识别工作记录
## 目标
整合说话者分离(speaker diarization)到 kb-whisper 工作流,替换 OCR 为 Whisper 视频转文字
## glm-4.7 AI 分析返回问题(2026-02-13 新增)
### 发现
- deep_analyzer 使用 `.json` 文件传给 AI
- 实际传给 AI 的是 `text` 字段的前 3000 字
- json 文件结构:
```
├── text: "為什麼我要說美國就變了..." (~4500字)
└── segments: 168段 (带时间戳)
```
### 三种字幕格式对比
| 格式 | 大小 | 特点 |
|------|------|------|
| .json | 55KB | 完整元数据 + segments |
| .srt | 23KB | 带时间戳的字幕格式 |
| .txt | 9KB | 纯文本,无时间戳 |
### 问题分析
1. **截断问题**:只取前 3000 字传给 AI,可能不够全面
2. **未利用时间轴**:segments 有 168 段时间信息未使用
3. **格式问题**:传给 AI 是纯文本,没有分段结构
### 待用户确认改进方案
- A. 用 `.txt` (9KB) 更简洁的格式?
- B. 用 `.srt` (23KB) 带时间戳的格式?
- C. 改进 json 解析,把 segments 整理成更易读的格式?
- D. 其他方案?
---
## Passwordless Sudo 配置成功
```bash
sudo visudo -f /etc/sudoers.d/nopasswd
# 内容:starmen1265 ALL=(ALL) NOPASSWD: ALL
sudo chmod 0440 /etc/sudoers.d/nopasswd
sudo visudo -c # 验证:parsed OK
```
## 降级操作(解决兼容性问题)
| 库 | 从 | 到 | 原因 |
|---|---|---|---|
| torch | 2.10.0 | 2.8.0 | speechbrain 需要旧 API |
| torchaudio | 2.10.0 | 2.8.0 | speechbrain 需要 list_audio_backends() |
| NumPy | 2.x | 1.26.4 | pyannote 3.1.1 需要 |
| huggingface_hub | 1.4.1 | 0.19.4 | pyannote 3.1.1 需要 use_auth_token |
| pyannote.audio | 4.0.4 | 3.1.1 | 4.x 与 torch 2.10 兼容性问题 |
## 用户指令
- 只允许修改 `speaker_diarization.py` 中的 segmentation 配置
- 停止所有其他修改
- 暂停说话者分离工作
## 下一步
- 使用已有的 kb-whisper 方案(Whisper.cpp)
- 暂停说话者分离(speaker diarization)
- 等待后续指令
## 当前环境
- whisper.cpp: ~/whisper.cpp
- whisper 模型: ggml-base.bin
- kb-whisper 脚本: skills/kb-whisper/whisper.py