【Prompting】ChatGPT Prompt Engineering开发指南(2)

news2024/11/30 20:37:37

ChatGPT Prompt Engineering开发指南2

  • 从产品概况表生成营销产品描述
    • 问题1:文本太长
    • 问题2: 文本聚焦于错误的细节
    • 问题3:描述需要一个尺寸表
  • 加载Python库查看HTML
  • 内容来源

在本教程中,学习迭代分析并完善给出的提示,以从结果概况表中生成营销副本。
基本条件设定与 ChatGPT Prompt Engineering开发指南1中相同。

从产品概况表生成营销产品描述

fact_sheet_chair = """
OVERVIEW
- Part of a beautiful family of mid-century inspired office furniture, 
including filing cabinets, desks, bookcases, meeting tables, and more.
- Several options of shell color and base finishes.
- Available with plastic back and front upholstery (SWC-100) 
or full upholstery (SWC-110) in 10 fabric and 6 leather options.
- Base finish options are: stainless steel, matte black, 
gloss white, or chrome.
- Chair is available with or without armrests.
- Suitable for home or business settings.
- Qualified for contract use.

CONSTRUCTION
- 5-wheel plastic coated aluminum base.
- Pneumatic chair adjust for easy raise/lower action.

DIMENSIONS
- WIDTH 53 CM | 20.87”
- DEPTH 51 CM | 20.08”
- HEIGHT 80 CM | 31.50”
- SEAT HEIGHT 44 CM | 17.32”
- SEAT DEPTH 41 CM | 16.14”

OPTIONS
- Soft or hard-floor caster options.
- Two choices of seat foam densities: 
 medium (1.8 lb/ft3) or high (2.8 lb/ft3)
- Armless or 8 position PU armrests 

MATERIALS
SHELL BASE GLIDER
- Cast Aluminum with modified nylon PA6/PA66 coating.
- Shell thickness: 10 mm.
SEAT
- HD36 foam

COUNTRY OF ORIGIN
- Italy
"""

给出提示语:

prompt = f"""
Your task is to help a marketing team create a 
description for a retail website of a product based 
on a technical fact sheet.

Write a product description based on the information 
provided in the technical specifications delimited by 
triple backticks.

Technical specifications: ```{fact_sheet_chair}```
"""
response = get_completion(prompt)
print(response)

执行结果:
执行结果

问题1:文本太长

限制单词/句子/字符的数量。

prompt = f"""
Your task is to help a marketing team create a 
description for a retail website of a product based 
on a technical fact sheet.

Write a product description based on the information 
provided in the technical specifications delimited by 
triple backticks.

Use at most 50 words.

Technical specifications: ```{fact_sheet_chair}```
"""
response = get_completion(prompt)
print(response)

执行结果

len(response)  # 317

问题2: 文本聚焦于错误的细节

要求它专注于与预期受众相关的方面。

prompt = f"""
Your task is to help a marketing team create a 
description for a retail website of a product based 
on a technical fact sheet.

Write a product description based on the information 
provided in the technical specifications delimited by 
triple backticks.

The description is intended for furniture retailers, 
so should be technical in nature and focus on the 
materials the product is constructed from.

Use at most 50 words.

Technical specifications: ```{fact_sheet_chair}```
"""
response = get_completion(prompt)
print(response)

执行结果:

Introducing our mid-century inspired office chair, perfect for both home and business settings. With a range of shell colors and base finishes to choose from, this chair is available with or without armrests and in 10 fabric and 6 leather options. Constructed with a 5-wheel plastic coated aluminum base and HD36 foam seat, it also features pneumatic chair adjust for easy raise/lower action. Made in Italy and qualified for contract use.
prompt = f"""
Your task is to help a marketing team create a 
description for a retail website of a product based 
on a technical fact sheet.

Write a product description based on the information 
provided in the technical specifications delimited by 
triple backticks.

The description is intended for furniture retailers, 
so should be technical in nature and focus on the 
materials the product is constructed from.

At the end of the description, include every 7-character 
Product ID in the technical specification.

Use at most 50 words.

Technical specifications: ```{fact_sheet_chair}```
"""
response = get_completion(prompt)
print(response)

执行结果:

Introducing our mid-century inspired office chair, perfect for home or business settings. With a range of shell colors and base finishes, including stainless steel and matte black, this chair is available with or without armrests and in 10 fabric and 6 leather options. Constructed with a 5-wheel plastic coated aluminum base and HD36 foam seat, it also features pneumatic chair adjust for easy raise/lower action. Every 7-character Product ID: SWC-100, SWC-110.

问题3:描述需要一个尺寸表

要求它提取信息并在表中组织。

prompt = f"""
Your task is to help a marketing team create a 
description for a retail website of a product based 
on a technical fact sheet.

Write a product description based on the information 
provided in the technical specifications delimited by 
triple backticks.

The description is intended for furniture retailers, 
so should be technical in nature and focus on the 
materials the product is constructed from.

At the end of the description, include every 7-character 
Product ID in the technical specification.

After the description, include a table that gives the 
product's dimensions. The table should have two columns.
In the first column include the name of the dimension. 
In the second column include the measurements in inches only.

Give the table the title 'Product Dimensions'.

Format everything as HTML that can be used in a website. 
Place the description in a <div> element.

Technical specifications: ```{fact_sheet_chair}```
"""

response = get_completion(prompt)
print(response)

执行结果:

<div>
<h2>Mid-Century Inspired Office Chair</h2>
<p>This mid-century inspired office chair is part of a beautiful family of furniture that includes filing cabinets, desks, bookcases, meeting tables, and more. It comes in several options of shell color and base finishes, allowing you to customize it to your liking. You can choose between plastic back and front upholstery or full upholstery in 10 fabric and 6 leather options. The base finish options are stainless steel, matte black, gloss white, or chrome. The chair is available with or without armrests, making it suitable for both home and business settings. Plus, it's qualified for contract use, so you know it's built to last.</p>
<p>The chair features a 5-wheel plastic coated aluminum base and pneumatic chair adjust for easy raise/lower action. You can also choose between soft or hard-floor caster options and two choices of seat foam densities: medium (1.8 lb/ft3) or high (2.8 lb/ft3). The armless option is available, or you can choose 8 position PU armrests for added comfort.</p>
<p>The shell base glider is made of cast aluminum with modified nylon PA6/PA66 coating, and the shell thickness is 10 mm. The seat is made of HD36 foam, ensuring maximum comfort during long work sessions. This chair is made in Italy, so you know it's crafted with care and precision.</p>
<h3>Product ID(s): SWC-100, SWC-110</h3>
<table>
  <caption>Product Dimensions</caption>
  <tr>
    <th>Width</th>
    <td>53 cm | 20.87"</td>
  </tr>
  <tr>
    <th>Depth</th>
    <td>51 cm | 20.08"</td>
  </tr>
  <tr>
    <th>Height</th>
    <td>80 cm | 31.50"</td>
  </tr>
  <tr>
    <th>Seat Height</th>
    <td>44 cm | 17.32"</td>
  </tr>
  <tr>
    <th>Seat Depth</th>
    <td>41 cm | 16.14"</td>
  </tr>
</table>
</div>

加载Python库查看HTML

from IPython.display import display, HTML
display(HTML(response))

执行结果
下一节:以特定主题为重点对文本进行总结。

内容来源

  1. https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/3/iterative

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/523111.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

20230514 Google宣布引入生成式人工智能搜索引擎

&#x1f680; Google宣布引入生成式人工智能搜索引擎&#xff0c;可能是最大变化之一。 Google宣布引入生成式人工智能搜索引擎&#xff0c;可能是最大变化之一。 新搜索将使用人工智能模型整合互联网信息&#xff0c;更好地响应用户需求。然而&#xff0c;网络出版商担心这…

python+vue流浪动物公益科普宠物在线领养网站

使用动物在线领养网站的用户分管理员和用户两个角色的权限子模块。 开发语言&#xff1a;Python 框架&#xff1a;django/flask Python版本&#xff1a;python3.7.7 数据库&#xff1a;mysql 数据库工具&#xff1a;Navicat 开发软件&#xff1a;PyCharm 系统所要实现的功…

接口自动化测试之request模块讲解,以及初步接口自动化测试框架封装(统一请求)

一、有接口测试工具的情况下&#xff0c;为什么要做接口自动化&#xff1f; 1.敏捷开发&#xff0c;接口一般数量很大&#xff0c;团队实现接测试&#xff0c;版本控制。 2.功能太死板&#xff0c;有些接口完全无法实现&#xff08;复杂的加密接口&#xff0c;签名接口等) 3.接…

【STL十九】算法——修改序列的操作(copy、move、remove、transform、replace)

算法——不修改序列的操作&#xff08;copy、move、transform、remove、replace&#xff09; 一、分类二、修改序列的操作三、copy四、move五、remove、remove_if六、fill、transform、replace、replace_if、reverse 一、分类 根据网站https://www.apiref.com/cpp-zh/cpp/head…

Spring的执行流程以及Bean的作用域和生命周期

深入Bean对象 1. Bean对象的作用域1.1 引出作用域问题1.2 六种作用域 2. Spring的执行流程3. Bean对象的生命周期 在之前的学习中&#xff0c;我们了解到Spring能够用来帮助我们管理Java中的Bean对象&#xff0c;我们能够向Spring的IOC容器中添加以及获取对象。那我们从Spring对…

【腾讯云 Finops Crane 集训营】学习云原生成本优化

目录 开篇介绍搭建环境第一步第二步第三步 添加集群成本洞察成本分析资源推荐与副本数智能预测与自动扩缩容EHPA安装Metrics Server创建测试应用创建 EffectiveHPA增加负载整体流程 调度优化负载感知调度拓扑感知调度 混部清理环境 开篇 某次闲逛CSDN&#xff0c;发现了这样一…

(文章复现)基于电力系统碳排放流理论的碳排放分摊模型研究(含matlab代码)

参考文献&#xff1a;基于电力系统碳排放流理论的碳排放分摊模型研究 之前写过一篇博客复现论文《电力系统碳排放流的计算方法初探》&#xff0c;那篇文章模型比较简单&#xff0c;没有考虑网损。(文章复现)电力系统碳排放流的计算方法初探(含matlab代码) 今天要复现的这篇文献…

1行命令本地部署 AgentGPT

本地部署 AgentGPT 部署 AgentGPT访问 AgentGPT 部署 AgentGPT 运行下面命令部署 AgentGPT&#xff0c;输入你的 OpenAI Key&#xff0c; git clone https://github.com/reworkd/AgentGPT.git; cd AgentGPT; ./setup.sh --docker访问 AgentGPT 使用浏览器打开 http://localh…

万得后端一面

目录 1.说说重载和重写2.内连接和外连接3.如果有一个任务来了&#xff0c;线程池怎么运行5.hashset怎么判断重复6.list和set说说7.说说有哪些list8.单例模式的饿汉式和懒汉式&#xff0c;怎么样可以防止反射。9.volatile关键字说说 1.说说重载和重写 1、重载发生在本类&#x…

MySQL创建索引时提示“Specified key was too long; max key length is 767 bytes”

MySQL创建索引时提示“Specified key was too long; max key length is 767 bytes” 问题描述 数据库RDS MySQL版在创建表索引时&#xff0c;出现如下错误信息。 Error 1071: Specified key was too long; max key length is 767 bytes.ERROR 1709 (HY000): Index column siz…

基于ESP32/ESP8266的单通道LoRaWAN网关设计-网页界面介绍

资料下载链接》》 网页界面介绍 对于单通道网关的第六版用户界面&#xff0c;我们专注于 Web 界面。本文档仅涉及 Web 界面。有几个部分要讨论&#xff1a; 用户界面说明web界面可以设置哪些参数单通道接口配置涉及的文件。 Web 界面的各个部分 启动 Web 界面时&#xff0…

【评测】腾讯云服务器的性能怎么样?

转载请注明出处&#xff1a;小锋学长生活大爆炸[ http://xfxuezhang.cn] 最近腾讯云推出了5年款服务器&#xff0c;性价比非常的高。但这么便宜的服务器&#xff0c;性能怎么样呢&#xff1f;学长特地领取了新人试用版测试了一下性能&#xff0c;这里与大家分享一下。 服务器领…

与对应负数同时存在的最大正整数

一、2441. 与对应负数同时存在的最大正整数 思路 这个题我想的是将数组中的负数全部找出来放进另一数组&#xff0c;然后再将原数组的元素与与之相比&#xff0c;如果相加等于0&#xff0c;那么就使num&#xff1b; 代码实现 int findMaxK(int* nums, int numsSize){int max0…

学系统集成项目管理工程师(中项)系列21b_整体管理(下)

1. 监控项目工作 1.1. 跟踪、审查和报告项目进展&#xff0c;以实现项目管理计划中确定的绩效目标的过程 1.2. 输入 1.2.1. 项目管理计划 1.2.2. 进度预测 1.2.2.1. 基于实际进展与进度基准的比较而计算出进度预测 1.2.2.1.1. 完工尚需时间估算(ETC) 1.2.2.1.2. 进度偏差(SV…

威胁报告检测到物理后果呈指数增长的OT网络攻击

2023年威胁报告 - 具有物理后果的 OT 网络攻击 在过去一年&#xff08;2022 年&#xff09;&#xff0c;我们看到了 57 起针对工业系统的 OT 相关网络攻击&#xff0c;这些攻击在现实世界中造成了物理后果。这是我们在 2021 年看到的 22 次类似攻击的 2.5 倍多&#xff0c;是 …

网路通信-路由交换协议

目录 一、什么是协议 二、为什么要有协议 三、协议分类 &#xff08;1&#xff09;OSI通信模型 &#xff08;2&#xff09;tcp/ip通信模型 &#xff08;3&#xff09;数据传输的过程 1.传输路线 2.发送者封装数据 3.数据经过交换机 4.数据经过路由器 5.路由器转发到目…

深度学习环境配置系列文章(四):WSL2配置Windows11和Linux双系统

深度学习环境配置系列文章目录 第一章 专业名称和配置方案介绍 第二章 Anaconda配置Python和PyTorch 第三章 配置VS Code和Jupyter的Python环境 第四章 WSL2配置Windows11和Linux双系统 第五章 配置Docker深度学习开发环境 第四章文章目录 深度学习环境配置系列文章目录前言一…

横截面收益率(二) 阿尔法策略是如何构建的

资本资产定价模型自从首次被提出以来在金融经济学中一直处于中心地位。 在一系列简化假定条件下&#xff0c;资本资产定价模型表明&#xff0c;任何证券的收益率与该证券 的系统性风险&#xff08;或者贝塔值&#xff09;呈线性关系。因此&#xff0c;依据资本资产定价模型横截…

【STM32】基础知识 第十三课 中断

【STM32】基础知识 第十三课 中断 概述中断是什么中断的作用 & 意义STM32 中断体系NVIC中断向量表STM32 中断优先级基本概念 STM32 外部中断器 (EXTI)EXTI 简介EXTI 配置 AFIOAFIO 与中断 案例 概述 今天小白我将带领大家详细介绍 STM32 单片机中的中断处理机制, 包括中断…

Python每日一练(20230514) 不同路径 I\II\III UniquePaths

目录 1. 不同路径 I Unique Paths 1 2. 不同路径 II Unique Paths 2 3. 不同路径 III Unique Paths 3 &#x1f31f; 每日一练刷题专栏 &#x1f31f; Golang每日一练 专栏 Python每日一练 专栏 C/C每日一练 专栏 Java每日一练 专栏 1. 不同路径 I Unique Paths 1 一个…