1. Learn
  2. /
  3. 课程
  4. /
  5. 使用 OpenAI API 的 Prompt Engineering

Connected

道练习

使用 few-shot 提示的情感分析

您正在进行市场调研,目标是使用 few-shot 提示对客户评价进行情感分析。对于每段客户对话,您需要分配一个数值:情感为负记为 -1,情感为正记为 1。您向模型提供以下示例,作为可学习的以往对话。

  • The product quality exceeded my expectations -> 1
  • I had a terrible experience with this product's customer service -> -1

OpenAI 包已为您预先加载。

说明

100 XP
  • 将示例作为以往对话提供:把文本作为 user 角色的上下文,把数值作为 assistant 角色的上下文。
  • 提供以下文本让模型进行分类,并使用合适的角色:The price of the product is really fair given its features。