feat(SDE): 优化剧情分析提示词和解说文案生成

- 在 generate_short_summary.py 中添加 temperature 参数,用于控制生成文案的随机性- 修改 prompt.py 中的段落数要求,改为与字幕长度成正比
- 在 short_drama_explanation.py 中添加日志输出,记录使用的模型和温度
This commit is contained in:
linyq 2025-05-12 11:20:31 +08:00
parent 342a4ac1a8
commit c0e0b8ec6d
3 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,7 @@ subtitle_plot_analysis_v1 = """
1. **整体剧情分析**简要概括整个短剧的核心剧情脉络主要冲突和结局如果有的话
2. **分段剧情解析与时间戳定位**
* 将整个短剧划分为若干个关键的剧情段落例如开端发展转折高潮结局或根据具体情节自然划分
* 段落数不得少于 20
* 段落数应该与字幕长度成正比
* 对于每一个剧情段落
* **概括该段落的主要内容**用简洁的语言描述这段剧情发生了什么
* **标注对应的时间戳范围**明确指出该剧情段落对应的开始字幕时间戳和结束字幕时间戳请直接从字幕中提取时间信息

View File

@ -351,7 +351,7 @@ def analyze_subtitle(
base_url=base_url,
custom_prompt=custom_prompt
)
logger.debug(f"使用模型: {analyzer.model} 开始分析, 温度: {analyzer.temperature}")
# 分析字幕
if subtitle_content:
result = analyzer.analyze_subtitle(subtitle_content)

View File

@ -60,7 +60,8 @@ def generate_script_short_sunmmary(params, subtitle_path, video_theme, temperatu
api_key=text_api_key,
model=text_model,
base_url=text_base_url,
save_result=True
save_result=True,
temperature=temperature
)
"""
3. 根据剧情生成解说文案