
#  Examining moderation category scores

```
Exercise ID 1590485
```

##  Assignment 

The same request you created in the last exercise to the `Moderation` endpoint has been run again, sending the sentence `"My favorite book is How to Kill a Mockingbird."` to the model. The response from the API has been printed for you, and is available as `response`.

What is the correct interpretation of the `category_scores` here?

##  Pre exercise code 

```
import pickle
import requests

### CODE USED TO CREATE PICKLE FILE
# import pickle
# import openai

# response = openai.Moderation.create(
#   model="text-moderation-latest",
#   input="My favorite book is How to Kill a Mockingbird."
# )

# with open("category_scores.pkl", "wb") as scores:
#     pickle.dump(response, scores)

pickle_file = requests.get("https://assets.datacamp.com/production/repositories/6309/datasets/a77cdf1897fe82aa343fc9042b2086287eef7193/category_scores.pkl")    

response = pickle.loads(pickle_file.content)
print(response)
```



##  Answers 
1. The model believes that the sentence contains violent content, as the `violence` category is close to `0`.
1. The model believes that there are no violations, as all categories are close to `0`.
1. The model believes that the sentence contains hate speech, as the `hate` category is close to `0`.


##  Hints 

- Higher `category_scores` indicate that the model is more confident that the text contains a violation.



##  Solution 

No solution was found.


