Skip to main content

Overview

As we build applications that engage with people, it’s vital that the content that is displayed to the end-user is not harmful or offensive. In this workshop you will learn how to use the prebuilt AI service, Azure AI Content Safety, in your applications to ensure that the texts or images that are sent to the user or the user enters do not contain data that has violence, self-harm, hate or sexual information. In addition, based on the demographic of the end-users that interact with the application, developers can control what content is acceptable based on the sensitivity level of the inappropriate content. The services support multiple languages and multiple industries such as gaming, e-commerce, social media, education, etc.

There are several challenges in having a staff of moderators to review the content. The limitations are difficult to manually inspect the enormous amount of text or images. Another challenge is that the staff that are evaluating the text are subjective, insistent on what they classify as a violation, or it can be time consuming. Using the Content Safety AI service makes it possible to catch issues faster and more efficiently. This reduces unnecessary manual repetitive tasks and potentially errors. In addition, the API service has built-in profanity detection. With the vast use of generative AI, there are user input prompts and dynamic AI-generated responses, Azure AI Content Safety serves as a useful tool to safeguard content that can be risky or undesirable.

CS Severity Levels

👩🏽‍💻 | Objectives

At the end of the workshop, you will:

  • Learn how to detect and flag text that are unsuitable for end-users.
  • Learn how to block images that are inappropriate.
  • Learn how to create applications with a safe and friendly tone.

✅ |Prerequisites:

To complete this workshop, you need the following:

  1. Login or Signup for a Free Azure account
  2. Azure OpenAI service enabled on your Azure account. Request access
  3. GitHub account with access to GitHub Codespaces. Free Codespaces signup
  4. Install Python 3.8 or higher.

📚 | Log in to your Azure account

  1. Sign in to the Azure portal. Follow the instructions to authenticate an email and password.

Azure Portal

NOTE: If you were provided a subscription with a usernae and password, you can use that to login.

  1. Select Resource groups.

    Resource Groups

  2. This should list your resource groups. If you don't have any, you can create one later in the labs.