1. Learn
  2. /
  3. Courses
  4. /
  5. Explainable AI in Python

Connected

Exercise

Self-consistency to assess confidence

The prompt below aims to ask ChatGPT to classify the sentiment of a review. You have to estimate the confidence of ChatGPT in each class using self-consistency.

The get_response() function to communicate with ChatGPT is pre-loaded for you.

Instructions

100 XP
  • For each review, append the sentiment to the responses list.
  • Compute the confidence for each sentiment.