Files
audiobook/backend/services/ollama_service.py
Paul Bailey 73dc5695ca Improve Ollama speaker detection with multi-sample strategy
- Sample up to 4 chunks of 5000 characters from different text positions
- Distribute samples evenly across beginning, middle, and end of text
- Deduplicate speakers across all samples for comprehensive detection
- Log individual sample results for debugging
- Handle short texts efficiently (single sample)
- Updated tests to verify multi-sample behavior

This ensures speakers introduced anywhere in long texts are detected,
not just those appearing in the first 2000 characters.
2025-12-09 10:40:59 +00:00

8.1 KiB