小智头像图片
AI教程 2025年01月16日
0 收藏 0 点赞 466 浏览 3505 个字
摘要 :

面向开发者的LLM入门课程-评估英文版提(3): 英文版提示 3.通过LLM进行评估实例 langchain.debug = False #为所有不同的示例创建预测 predictions = qa.apply(example……

哈喽!伙伴们,我是小智,你们的AI向导。欢迎来到每日的AI学习时间。今天,我们将一起深入AI的奇妙世界,探索“面向开发者的LLM入门课程-评估英文版提(3)”,并学会本篇文章中所讲的全部知识点。还是那句话“不必远征未知,只需唤醒你的潜能!”跟着小智的步伐,我们终将学有所成,学以致用,并发现自身的更多可能性。话不多说,现在就让我们开始这场激发潜能的AI学习之旅吧。

面向开发者的LLM入门课程-评估英文版提(3)

面向开发者的LLM入门课程-评估英文版提(3):

英文版提示

3.通过LLM进行评估实例

langchain.debug = False

#为所有不同的示例创建预测
predictions = qa.apply(examples)

# 对预测的结果进行评估,导入QA问题回答,评估链,通过语言模型创建此链
from langchain.evaluation.qa import QAEvalChain #导入QA问题回答,评估链

#通过调用chatGPT进行评估
llm = ChatOpenAI(temperature=0)
eval_chain = QAEvalChain.from_llm(llm)

#在此链上调用evaluate,进行评估
graded_outputs = eval_chain.evaluate(examples, predictions)

#我们将传入示例和预测,得到一堆分级输出,循环遍历它们打印答案
for i, eg in enumerate(examples):
print(f”Example {i}:”)
print(“Question: ” + predictions[i][‘query’])
print(“Real Answer: ” + predictions[i][‘answer’])
print(“Predicted Answer: ” + predictions[i][‘result’])
print(“Predicted Grade: ” + graded_outputs[i][‘results’])
print()

> Entering new RetrievalQA chain…

> Finished chain.
Example 0:
Question: Do the Cozy Comfort Pullover Set have side pockets?
Real Answer: Yes
Predicted Answer: Yes, the Cozy Comfort Pullover Set does have side pockets.
Predicted Grade: CORRECT

Example 1:
Question: What collection is the Ultra-Lofty 850 Stretch Down Hooded Jacket from?
Real Answer: The DownTek collection
Predicted Answer: The Ultra-Lofty 850 Stretch Down Hooded Jacket is from the
DownTek collection.
Predicted Grade: CORRECT

Example 2:
Question: What is the description of the Women’s Campside Oxfords?
Real Answer: The description of the Women’s Campside Oxfords is that they are an
ultracomfortable lace-to-toe Oxford made of super-soft canvas. They have thick
cushioning and quality construction, providing a broken-in feel from the first
time they are worn.
Predicted Answer: The description of the Women’s Campside Oxfords is: “This
ultracomfortable lace-to-toe Oxford boasts a super-soft canvas, thick cushioning,
and quality construction for a broken-in feel from the first time you put them
on.”
Predicted Grade: CORRECT

Example 3:
Question: What are the dimensions of the small and medium sizes of the Recycled
Waterhog Dog Mat, Chevron Weave?
Real Answer: The dimensions of the small size of the Recycled Waterhog Dog Mat,
Chevron Weave are 18″ x 28″. The dimensions of the medium size are 22.5″ x 34.5″.
Predicted Answer: The dimensions of the small size of the Recycled Waterhog Dog
Mat, Chevron Weave are 18″ x 28″. The dimensions of the medium size are 22.5″ x
34.5″.
Predicted Grade: CORRECT

Example 4:
Question: What are the features of the Infant and Toddler Girls’ Coastal Chill
Swimsuit, Two-Piece?
Real Answer: The swimsuit has bright colors, ruffles, and exclusive whimsical
prints. It is made of four-way-stretch and chlorine-resistant fabric, which keeps
its shape and resists snags. The fabric is UPF 50+ rated, providing the highest
rated sun protection possible by blocking 98% of the sun’s harmful rays. The
swimsuit also has crossover no-slip straps and a fully lined bottom for a secure
fit and maximum coverage.
Predicted Answer: The features of the Infant and Toddler Girls’ Coastal Chill
Swimsuit, Two-Piece are:

– Bright colors and ruffles
– Exclusive whimsical prints
– Four-way-stretch and chlorine-resistant fabric
– UPF 50+ rated fabric for sun protection
– Crossover no-slip straps
– Fully lined bottom for a secure fit and maximum coverage
– Machine washable and line dry for best results
– Imported
Predicted Grade: CORRECT

Example 5:
Question: What is the fabric composition of the Refresh Swimwear, V-Neck Tankini
Contrasts?
Real Answer: The Refresh Swimwear, V-Neck Tankini Contrasts is made of 82%
recycled nylon and 18% Lycra® spandex for the body, and 90% recycled nylon with
10% Lycra® spandex for the lining.
Predicted Answer: The fabric composition of the Refresh Swimwear, V-Neck Tankini
Contrasts is 82% recycled nylon with 18% Lycra® spandex for the body, and 90%
recycled nylon with 10% Lycra® spandex for the lining.
Predicted Grade: CORRECT

Example 6:
Question: What is the fabric composition of the EcoFlex 3L Storm Pants?
Real Answer: The EcoFlex 3L Storm Pants are made of 100% nylon, exclusive of
trim.
Predicted Answer: The fabric composition of the EcoFlex 3L Storm Pants is 100%
nylon, exclusive of trim.
Predicted Grade: CORRECT

面向开发者的LLM入门课程-llm-math和wikipedia
面向开发者的LLM入门课程-llm-math和wikipedia:代理 大型语言模型(LLMs)非常强大,但它们缺乏“最笨”的计算机程序可以轻松处理的特...

嘿,伙伴们,今天我们的AI探索之旅已经圆满结束。关于“面向开发者的LLM入门课程-评估英文版提(3)”的内容已经分享给大家了。感谢你们的陪伴,希望这次旅程让你对AI能够更了解、更喜欢。谨记,精准提问是解锁AI潜能的钥匙哦!如果有小伙伴想要了解学习更多的AI知识,请关注我们的官网“AI智研社”,保证让你收获满满呦!

微信打赏二维码 微信扫一扫

支付宝打赏二维码 支付宝扫一扫

版权: 转载请注明出处:https://www.ai-blog.cn/2730.html

相关推荐

AI写作-DeepSeek高阶提示词之自媒体爆款创作篇: 自媒体爆款创作篇 6.10W+标题生成器 “生成20个关…

小智头像图片
466

AI写作-DeepSeek高阶提示词之职场打工人必备篇: 职场打工人必备篇 1.会议纪要秒整理 “将以下会议…

小智头像图片
466

AI绘画-即梦3.0提示词示例之场景化种草型​: 场景化种草型​ 公式:产品+使用场景+氛围渲染+情感化…

小智头像图片
64

AI绘画-即梦3.0提示词示例之限时折扣型​: 限时折扣型​ 公式:产品+价格锚点+紧迫感元素+霓虹灯风…

小智头像图片
466

AI绘画-即梦3.0提示词示例之新品发布型: 新品发布型​ 公式:产品+核心卖点+高级质感+极简排版 ​ …

小智头像图片
466

AI绘画-即梦3.0提示词示例之节日促销型​: 节日促销型​ 公式:产品+节日主题+视觉元素+动态文字+风…

小智头像图片
466

AI绘画-即梦3.0提示词示例之暗黑哥特​: 暗黑哥特​ 提示词: 哥特体、烛光照明、高反差,荆棘十字…

小智头像图片
466

AI绘画-即梦3.0提示词示例之奶油治愈​: 奶油治愈​ 提示词: 奶乎乎、柔焦镜头、低对比,猫咪蜷缩…

小智头像图片
466
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力原创内容

快速提升站内名气成为大牛

扫描二维码

手机访问本站

二维码
vip弹窗图片