业务文档分析
作为 Polaris Investments 的投资者关系分析师,您需要在明天的董事会电话前,为高管简要汇报最新的 Q3 报告。将文档交给 Claude,并请求一份面向高管的摘要:几分钟内就能生成您的简报!
anthropic 库、client 和 quarterly_report 已预加载。
本练习是课程的一部分
Claude 模型入门
练习说明
- 创建文档分析提示,并要求给出 3 条关键业绩亮点。
- 将
max_tokens设置在 200 - 300 之间,以获得更全面的分析。 - 在内容中传入该分析提示。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create document analysis prompt and ask for 3 key performance highlights
analysis_prompt = f"""
Analyze this quarterly report and provide:
1. ___
2. Two biggest concerns that need immediate attention
3. Actionable recommendations for next quarter
Document: {quarterly_report}
"""
# Set max_tokens between 200 - 300 for a comprehensive analysis and pass the analysis prompt in the content.
response = client.messages.create(model="claude-sonnet-4-6", max_tokens=____, messages=[{"role": "user", "content": ____}])
print("Executive Summary:")
print(response.content[0].text)