> ## Documentation Index
> Fetch the complete documentation index at: https://wwwpoc.ibm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HAP Detection

> Use Granite Guardian to detect Hate, Abuse, and Profanity (HAP).

This recipe showcases a Granite Guardian model designed to detect hate, abuse, and profanity, either in a prompt or LLM output. This is an example of a “guard rail” used in generative AI applications for safety.

The model used in this recipe has been fine-tuned on several English HAP benchmarks and utilizes the slate.38m.english.distilled base model.

You will need a Hugging Face token to run this recipe in Colab. Instructions for obtaining this credential can be found [here](/granite/docs/use-cases/getting-credentials).

<Warning>HAP Detection examples may contain profanities.</Warning>

<CardGroup cols={2}>
  <Card title="Get started" icon="github" href="https://github.com/ibm-granite-community/granite-snack-cookbook/blob/main/recipes/Granite_Guardian/HAP.ipynb">
    Explore sample code in a GitHub repo
  </Card>

  <Card title="Try it out" icon="https://mintcdn.com/ibmgranite/m3dncz2KrKeb3pcV/granite/docs/images/icons8-google-colab.svg?fit=max&auto=format&n=m3dncz2KrKeb3pcV&q=85&s=fb39ef667c012d0fcef53599b6c5c0fd" href="https://colab.research.google.com/github/ibm-granite-community/granite-snack-cookbook/blob/main/recipes/Granite_Guardian/HAP.ipynb" width="144" height="144" data-path="granite/docs/images/icons8-google-colab.svg">
    Execute sample code in Colab
  </Card>
</CardGroup>
