00319f523f
- 创建 SemanticSegmentationEngine 类 - 实现 VideoSegment 和 SegmentationResult Pydantic 模型 - VideoSegment: title(可选), content(必填), start_index, end_index - SegmentationResult: video_type, segments[], actual_segment_count - 添加标题长度验证器(5-15字) - 实现 _infer_video_type() 方法 - 从元数据推断视频类型(知识类/故事类/访谈类/新闻类/vlog) - 支持从 title, category, tags 推断 - 默认类型为"知识类" - 实现 _build_prompt() 方法 - 包含视频类型信息 - 包含完整的分段要求(数量控制、句边界保护、标题生成等) - 包含 JSON 输出格式规范 - 添加 extract_json_from_llm_response() 工具函数 - 添加 AIClientProtocol 协议定义 - 添加 deferred-items.md 记录超出范围的测试 所有计划 13-01 测试通过(10个测试) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
1.6 KiB
Markdown
42 lines
1.6 KiB
Markdown
# Deferred Items - Phase 13
|
|
|
|
## Plan 13-01: 视频类型识别
|
|
|
|
### Deferred Tests (Out of Scope)
|
|
|
|
The following tests in `tests/test_semantic_engine.py` are outside the scope of Plan 13-01:
|
|
|
|
#### TestChineseSentenceBoundary Class (Lines 157-244)
|
|
These tests belong to Plan 13-05 (中文句边界检测):
|
|
- `test_chinese_sentence_boundary_punctuations` - Tests Chinese punctuation awareness
|
|
- `test_prompt_emphasizes_semantic_pause` - Tests semantic pause emphasis
|
|
- `test_prompt_not_only_punctuation` - Tests that boundaries aren't just punctuation
|
|
- `test_sentence_boundary_in_segmentation` - Tests sentence boundary in segmentation
|
|
|
|
**Reason:** These tests require implementing Chinese sentence boundary detection logic, which is part of Plan 13-05.
|
|
|
|
**Action:** Skip these tests in Plan 13-01. They will be addressed in Plan 13-05.
|
|
|
|
---
|
|
|
|
### Additional Tests Implemented
|
|
|
|
The following tests were added beyond the original plan but are reasonable extensions:
|
|
|
|
#### TestPydanticModels - Title Length Validation
|
|
- `test_title_length_validation_fails` - Tests that titles > 15 chars fail validation
|
|
- `test_title_exactly_15_chars_passes` - Tests that titles == 15 chars pass validation
|
|
|
|
**Reason:** The plan states "简洁描述型(5-15字)" for titles, so length validation is appropriate.
|
|
|
|
**Action:** Implemented in Plan 13-01 as part of Pydantic model validation.
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- Total tests in test_semantic_engine.py: 14
|
|
- Tests for Plan 13-01: 8 (VideoTypeDetection + VideoTypeInPrompt + PydanticModels)
|
|
- Deferred tests (Plan 13-05): 4 (TestChineseSentenceBoundary)
|
|
- Extra tests (beyond plan but implemented): 2 (title length validation)
|