吴恩达提示工程实战演练 - 如何引导GPT主动思考

策略:明确完成任务所需的步骤

接下来的任务我想让GPT处理一段文本,且需要完成一下一系列任务:

1)将文本总结成摘要 
2)将摘要翻译成英文
3)提取英文摘要中的名字
4)将翻译的英文摘要和提取的名字以JSON格式输出

每一步任务都是紧密相关的,且都是依赖上一步任务的结果,我们jupyter实战演练下:

GPT的任务执行结果:

1 - 兄妹杰克和吉尔在山顶井中取水的探险中遭遇不幸,但他们的冒险精神仍然没有减弱,继续充满喜悦地探索着。
2 - Jack and Jill had an unfortunate accident while exploring a well on a mountaintop, but their adventurous spirit remained undiminished as they continued to explore with joy.
3 - Jack, Jill
4 - {"eng_summary": "Jack and Jill had an unfortunate accident while exploring a well on a mountaintop, but their adventurous spirit remained undiminished as they continued to explore with joy.", "num_names": 2}

可见执行结果非常精确!我们只需设置好任务规则,GPT就可以依据自己的‘思考’结果逐步往下执行!

我们还可以设置多种输出格式,还是以上面文本为例:

我想将以上四项任务分别以不同格式输出:

 指定格式的输出如下:

摘要: 杰克和吉尔在山顶井中取水的探险中遭遇不幸,但他们的冒险精神没有减弱,继续探索着。
翻译: Jack and Jill had an unfortunate accident while exploring the well on the mountaintop, but their adventurous spirit remained strong as they continued to explore with joy.
名字: Jack, Jill
JSON: {"eng_summary": "Jack and Jill had an unfortunate accident while exploring the well on the mountaintop, but their adventurous spirit remained strong as they continued to explore with joy.", "num_names": 2}

依然理解的非常到位,yyds~~

限时福利:大家如果没有api_key或者本机能访问openAI的URL,可以拉取3位好友关注公众号:奇点涌现,公众号已对接ChatGPT,发消息即可体验。

关注后加作者微信:dyrslds,发送关注截图确认,作者发送教程中使用的api_key及访问openAI的URL,只限前60名,先到先得!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值