1. Learn
  2. /
  3. Courses
  4. /
  5. Prompt Engineering with the OpenAI API

Connected

Exercise

Iterative prompt engineering for few-shot prompts

You are currently working on a project at your content creation company. The project's objective is to develop a text classification model capable of accurately identifying and categorizing different emotions in text, such as happiness, sadness, and fear. In cases where the text does not contain any discernible emotion, you aim for the model to respond with "no explicit emotion."

You decided to use the provided few-shot prompt. However, you've noticed that "Time flies like an arrow" is being incorrectly classified as "surprise." Your objective now is to refine the prompt so that the model correctly classifies this particular example as "no explicit emotion."

The OpenAI package and the get_response() function have been pre-loaded for you.

Instructions

100 XP
  • Iteratively refine the prompt, by refining the examples, to get the output no explicit emotion for the "They sat and ate their meal" example.