1. เรียนรู้
  2. /
  3. Courses
  4. /
  5. Working with the OpenAI API

Connected

Exercises

Zero-shot prompting with reviews

As well as answering questions, transforming text, and generating new text, OpenAI's models can also be used for classification tasks, such as categorization and sentiment analysis.

In this exercise, you'll explore using OpenAI's chat models for sentiment classification using reviews from an online shoe store called Toe-Tally Comfortable.

คำแนะนำ

100 XP
  • Define a prompt to classify the sentiment of the statements provided using the numbers 1 to 5 (positive to negative).
  • Create a request to the Chat Completions endpoint to send this prompt to gpt-4o-mini.