文章预览
有一个50列的表格,里面都是英文,要翻译成中文: 在ChatGPT中输入提示词: 你是一个开发AI大模型应用的Python编程专家,要完成以下任务的Python脚本: 打开Excel文件:"F:\AI自媒体内容\AI行业数据分析\poetop50bots.xlsx" 读取A2到B51这个区域中的每一个单元格内容, 调用deepseek-chat模型(上下文长度32K,最大输出长度4K)来将单元格的内容翻译成中文; 模型的base_url为: https:// api.deepseek.com 模型的api_key为:XXX temperature 参数设置认为 1.1 提示词为:把英文内容翻译为中文 调用deepseek-chat模型API的示例参照【】里面的内容: 【# Please install OpenAI SDK first:`pip3 install openai` from openai import OpenAI client = OpenAI(api_key=" ", base_url=" https:// api.deepseek.com ") response = client.chat.completions.create( model="deepseek-chat", messages=[ {"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "conte
………………………………