Jump to content

Exploring Azure AI Content Safety: Navigating Safer Digital Experience


Recommended Posts

Guest SAVITAMITTAL
Posted

655x362vv2.png.96529632904cbcc399f57d2293018b29.png

 

This article serves as your compass in navigating the intricate landscape of content safety. Delve into the realm of Azure AI Content Safety, an innovative offering from Microsoft Azure designed to identify and address harmful content originating from both users and AI systems within various digital platforms. These tools empower developers to create platforms that prioritize safety and inclusivity and organizations can explore the core features of Azure AI Content Safety to have a safer online experience for everyone.

Several use cases:

 

  • Social Media comment moderation
  • AI-Generated Text in Customer Service
  • Gaming
  • Crisis response
  • Healthcare

    STEP#1

 

Start with Azure Content Safety Studio

https://learn.microsoft.com/en-us/azure/ai-services/content-safety/studio-quickstart

 

  • Create Content safety resource in Azure portal
  • Get Endpoint and Key for Azure Content Safety Resource

 

largevv2px999.png.486a1c047e2f41b3830e29ab539ad0b3.png

 

 

 

STEP#2

 

Scenario 1 : Customer feedback or Comments gets created in SharePoint List. You want to get Content Safety flags

 

mediumvv2px400.png.09b47ffbeb7f680432aab46e38854de4.png

 

 

 

STEP#3

 

Create a PowerAutomate

 


  • Here are the steps to create a Power Flow:
     
    1. Go to flow.microsoft.com and click on "Flows".
    2. Visit Microsoft Power Automate
    3. Click "New Flow" and name it "OpenAIContentSafety".
    4. Set HTTP action
      509x532vv2.png.f265f298b5e5298a53a9f8ca9b127792.png
       
       
      Get HTTP URI and key from STEP#1
       
      Set Body
      {
      "text": "PASTE YOUR CONTENT HERE",
      "categories": [
      "Hate",
      "Sexual",
      "SelfHarm",
      "Violence"
      ]
      }

 

Add Parse JSON

523x302vv2.png.f56bc191ce1e443dbb543e41242bbe7d.png

 

Content body variable from HTTP action

 

Scheme Paste below content

 

{

"type": "object",

"properties": {

"blocklistsMatchResults": {

"type": "array"

},

"hateResult": {

"type": "object"

},

"selfHarmResult": {

"type": "object"

},

"sexualResult": {

"type": "object"

},

"violenceResult": {

"type": "object"

}

}

}

Set the variables with Content safety categories as shown below. Value of each variable is variable from Parse JSON step

 

454x503vv2.png.da88f46b3492066dd1ce765ad1d18f5e.png

Update the value in SharePoint list

 

 

 

491x630vv2.png.df039f48d61b0ffbf414498058161eb0.png

Scenario 2 : upload a PDF and ask questions and validate Content Safety before chatting with data.

Refer to GITHUB repo for PDF extraction full demo.

GitHub - msavita-cloud/OpenAIPowerApp

786x393vv2.png.827c3ab392c75f3eb7c4cf54f770b527.png

 

  • PDF uploaded and data extracted using computer vision API
  • Powe Automate created in previous step for Content safety is also triggered on extracted content to get insights Content safety flags. Extracted Content Safety Flags are displayed on the below screen.
  • In PowerApps Set OnSelect property:
    Set(contentsafetytext, OpenAIContentSafety.Run(TextInput.Text))
    where OpenAIContentSafety is the name of the PowerAutomate workflow to get content safety flags as created in previous scenario.
  • If any flag value is great than 0 then Open AI chat button is disabled.

773x427vv2.png.9c74c240f91ec8ba6f28742bd255c070.png

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...