自动同步: 2026-03-22 02:10

This commit is contained in:
2026-03-22 02:10:03 +08:00
parent 85e7926f5e
commit eb6cd11e7c
65 changed files with 902 additions and 228 deletions
+7 -2
View File
@@ -26,7 +26,11 @@ class AIClientProtocol(Protocol):
# 纠错 Prompt 模板
CORRECTION_PROMPT = """你是一个文本校对专家。以下是语音识别生成的字幕,可能包含识别错误。
请只纠正明显的错误(如同音字、漏字、错字),不要改变原意和风格。
请执行以下任务:
1. 纠正明显的错误(如同音字、漏字、错字)
2. 添加适当的标点符号(逗号、句号、顿号等)
3. 不要改变原意和风格
原文:
{text}
@@ -100,7 +104,8 @@ class ASRCorrector:
"""
try:
prompt = CORRECTION_PROMPT.format(text=text)
result = self.ai_client.generate(prompt, max_tokens=len(text) + 500)
# ASR 纠错需要直接结果,不需要 AI 的分析过程,因此禁用思考模式
result = self.ai_client.generate(prompt, max_tokens=len(text) + 500, disable_reasoning=True)
return result.strip()
except Exception as e:
logger.warning(f"ASR correction failed: {e}, returning original text")