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 foamCOUNTRY 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

【Prompting】ChatGPT Prompt Engineering开发指南(2)相关推荐

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

    ChatGPT Prompt Engineering开发指南1 Prompting指南 设置 提示原则 策略1:使用分隔符清楚地指示输入的不同部分 策略2:要求结构化输出 策略3:让模型检查条件是否满 ...

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

    ChatGPT Prompt Engineering开发指南:Transforming 翻译 通用翻译器 音调转换 格式转换 拼写检查/语法检查 内容来源 在本教程中,我们将探讨如何使用大型语言模型来 ...

  3. 【Prompting】ChatGPT Prompt Engineering开发指南(4)

    ChatGPT Prompt Engineering开发指南:Inferring 产品评论文本 情感(正/负面) 识别情绪类型 识别愤怒 从客户评论中提取产品和公司名称 一次执行多个任务 推断主题 推 ...

  4. 面向开发人员的 ChatGPT 提示词教程 - ChatGPT Prompt Engineering for Developers

    面向开发人员的 ChatGPT 提示词教程 - ChatGPT Prompt Engineering for Developers 1. 指南(原文: Guidelines) 1-1. 提示的指南(原 ...

  5. 吴恩达 OpenAI 的Prompt教程笔记 - ChatGPT Prompt Engineering for Developers

    文章目录 第一课 Introduction 第二课 Guidelines for Prompting 一.两个原则 1.编写明确和具体的指令 2.给模型足够的时间来思考 二.一个局限性 第三课 lte ...

  6. 吴恩达《ChatGPT Prompt Engineering for Developers》【自用】

    文章目录 Prompt Engineering for Developers 1 简介 2. 提示原则 Guidelines 将自己的 API-KEY 导入系统环境变量 导入第三方库 读取系统中的环境 ...

  7. 【简单入门】ChatGPT prompt engineering (中文版)笔记 |吴恩达ChatGPT 提示工程

    目录 思维导图 一.资料 二. 指南 环境配置 两个基本原则(最重要!!!!) 原则一:编写清晰.具体的指令 **策略一:使用分隔符清晰地表示输入的不同部分**,**分隔符可以是:```," ...

  8. ChatGPT Prompt Engineering for Developers from DeepLearning.AI

    链接:https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction In this course, there are ...

  9. 《ChatGPT Prompt Engineering for Developers》课程-提示词原则

    编写 Prompt 的原则 本章的主要内容为编写 Prompt 的原则,在本章中,我们将给出两个编写 Prompt 的原则与一些相关的策略,你将练习基于这两个原则来编写有效的 Prompt,从而便捷而 ...

最新文章

  1. easyUI添加行操作
  2. SSRS 2012 聚合函数 -- 隔行换色示例
  3. 卓讯企业名录搜索软件_还在用卓讯企业名录搜索软件吗?探迹黑科技助力企业提升销售效率...
  4. Python Django模板templates渲染及配置
  5. python 修饰器_python中用修饰器进行异常日志记录
  6. sudo vi ~/etc/profile 报错E212:Can't open file for writing
  7. c语言得到txt文件的长度,我利用C语言实现SHA-256算法,需要从一个txt文件中读出数据并把...
  8. mysql命令书写顺序_MySQL SQL语句书写顺序和执行顺序
  9. android edittext 手机号码,Android中EditText中的电话号码格式
  10. Flutter RichText 使用案例解析 Flutter WidgetSpan 设置图片显示
  11. 未设置BufferSize导致FTP下载速度过慢的问题
  12. mysql 查询一个数据库里面有多少张数据表
  13. python函数和代码复用思维导图_Python语言程序---代码复用与函数递归(二)
  14. widnows下lua开发环境luadist LuaRocks搭建
  15. 记测试工具iozone,iometer,bonnie++
  16. HuTool工具最全介绍
  17. Snaker 用户手册
  18. pythondecode_Python decoder.decode方法代码示例
  19. 面经 - 阿里巴巴 - 视频二面
  20. 电脑控制台命令的简单操作方式(黑窗口)

热门文章

  1. GEATPY算法总览
  2. 制作相册集软件软件推荐
  3. Flutter入门-Test drive
  4. Linux系统编程——特殊进程之僵尸进程
  5. Xray爬虫如何联动到Goby
  6. c++win32项目 如何显示后再删除一个绘图_CAD 100个快捷键+20个实用绘图技巧
  7. java后台使用计数器实现轮询
  8. Intel I210网卡
  9. Linux软件解压缩与安装
  10. MySql字段类型的选择