GPT提示工程
吴恩达GPT提示工程
文本推理

不久前,吴恩达和OpenAI合作开发了一套针对ChatGPT提示工程的最佳实践课程,课程名为《ChatGPT Prompt Engineering for Developers》。

本文是该课程的第3篇,前两篇请点击下面链接:

ChatGPT提示工程的两个关键原则 - 吴恩达和OpenAI合作(珍藏版) (opens in a new tab)

ChatGPT提示工程 - 总结 (opens in a new tab)

为了提供更好的阅读体验,本文的测试内容放在末尾。

情绪(积极/消极)

简单提问

以下用三个单引号分隔的产品评论的情绪是什么?

评论内容:

<请把测试内容放到这里>

用一个词来回答

以下用三个单引号分隔的产品评论的情绪是什么? 用一个词给出你的答案,“积极”或“消极”。

评论内容:

<请把测试内容放到这里>

识别情绪类型

根据以下评论内容,列出作者表达的情绪类型列表。在列表中包含不超过五个类型。并以逗号分隔的形式回答。

评论内容:

<请把测试内容放到这里>

识别愤怒

以下用三个单引号分隔的产品评论,作者是否表达了愤怒? 请回答“是”或“否”。

评论内容:

<请把测试内容放到这里>

从客户评论中提取产品和公司名称

从产品评论内容中识别出以下项目: 1.评论者购买的商品 2.制造该物品的公司

产品评论以三个单引号分隔。 将你的回答格式化为 JSON 对象,并以“Item”和“Brand”作为键。 如果信息不存在,请使用“未知”作为值。 请回复尽可能简短。

评论内容:

<请把测试内容放到这里>

一次执行多个任务

从产品评论内容中识别出以下项目: 1.情绪(积极或消极) 2.评论人是否表达了愤怒?(是或否) 3.评论者购买的商品 4.制造该物品的公司

产品评论以三个单引号分隔。 将你的回答格式化为 JSON 对象,并以“Sentiment”、“Anger”、“Item”和“Brand”作为键。 如果信息不存在,请使用“未知”作为值。 请回复尽可能简短。 将愤怒的值设置为布尔值。

评论内容:

<请把测试内容放到这里>

推断主题

请确定以下由三个单引号括起来的文本中正在讨论的五个主题是什么。 每个主题只用一到两个词来表达。 以逗号分隔这五个主题的形式回答。

文本内容:

<请把测试内容放到这里>

是否包含指定主题

确定以下主题列表中的每一项是否是下面文本中的主题(用三个单引号分隔)。 以列表形式给出您的答案,每个主题为 0 或 1。 主题列表: nasa, local government, engineering, employee satisfaction, federal government

文本内容:

<请把测试内容放到这里>

输出JSON格式,通常更稳定

确定以下主题列表中的每一项是否是下面文本中的主题(用三个单引号分隔)。 以JSON形式给出您的答案,每个主题为 0 或 1。 Json主题对象: nasa, local government, engineering, employee satisfaction, federal government

文本内容:

<请把测试内容放到这里>

测试内容

中文文本

我需要一个漂亮的卧室灯,这个灯还带有额外的存储功能,而且价格也不算太高。我很快就收到了。在运输过程中,我们的灯线断了,但是公司很乐意寄给我一根新的。新的灯线也在几天内送到了。组装很容易。我缺了一个零件,所以我联系了他们的客服,他们非常迅速地给我补发了缺失的部分!Lumina 对我来说是一家非常关心客户和产品的优秀公司!

英文文本

In a recent survey conducted by the government, public sector employees were asked to rate their level of satisfaction with the department they work at. The results revealed that NASA was the most popular department with a satisfaction rating of 95%.

One NASA employee, John Smith, commented on the findings, stating, "I'm not surprised that NASA came out on top. It's a great place to work with amazing people and incredible opportunities. I'm proud to be a part of such an innovative organization."

The results were also welcomed by NASA's management team, with Director Tom Johnson stating, "We are thrilled to hear that our employees are satisfied with their work at NASA. We have a talented and dedicated team who work tirelessly to achieve our goals, and it's fantastic to see that their hard work is paying off."

The survey also revealed that the Social Security Administration had the lowest satisfaction rating, with only 45% of employees indicating they were satisfied with their job. The government has pledged to address the concerns raised by employees in the survey and work towards improving job satisfaction across all departments.

参考

https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/5/inferring (opens in a new tab)