1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to LLMs in Python

Connected

Exercise

Checking toxicity

You work at a social media company and need to evaluate the comments that are being left on the platform to ensure users are respecting the code of conduct.

Your task is to carefully assess the toxicity level of comments of user_1 and user_2.

The toxicity metric has been loaded for you as toxicity_metric.

Instructions

100 XP
  • Calculate the individual toxicity of each sequence.
  • Calculate the the maximum toxicity.
  • Calculate the toxicity ratio per comment.