Text Moderation - Screen Text

Detect profanity and match against custom and shared blocklists
Detects profanity in more than 100 languages and matches against custom and shared blocklists.

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessText/Screen/
POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessText/Screen/?language={language}&autocorrect={autocorrect}&PII={PII}&listId={listId}&classify={classify}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Azure Cognitive Services endpoints (protocol and host name, such as https://westus.api.cognitive.microsoft.com).

autocorrect
query

boolean

Autocorrect text.

classify
query

boolean

Classify input.

language
query

string

Language of the text.

listId
query

string

List ID.

PII
query

boolean

Detect personal identifiable information.

Request Header

Media Types: "text/plain", "text/html", "text/xml", "text/markdown"

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Content-Type True

string

Content type.

Request Body

Media Types: "text/plain", "text/html", "text/xml", "text/markdown"

Name Type Description
Text Content

object

Content to screen.

Responses

Name Type Description
200 OK

Screen

Status 200.

Other Status Codes

APIError

Error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Detect Language request

Sample request

POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessText/Screen/?language=eng&autocorrect=False&PII=False&listId=&classify=False



"Is this a crap email abcdef@abcd.com, phone: 6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052"

Sample response

{
  "OriginalText": "Is this a crap email abcdef@abcd.com, phone: 6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052",
  "NormalizedText": "Is this a crap email abcdef@ abcd. com, phone: 6657789887, IP: 255. 255. 255. 255, 1 Microsoft Way, Redmond, WA 98052",
  "Misrepresentation": [],
  "Language": "eng",
  "PII": {
    "Email": [
      {
        "Detected": "abcdef@abcd.com",
        "SubType": "Regular",
        "Text": "abcdef@abcd.com",
        "Index": 21
      }
    ],
    "IPA": [
      {
        "SubType": "IPV4",
        "Text": "255.255.255.255",
        "Index": 61
      }
    ],
    "Phone": [
      {
        "CountryCode": "US",
        "Text": "6657789887",
        "Index": 45
      }
    ],
    "Address": [
      {
        "Text": "1 Microsoft Way, Redmond, WA 98052",
        "Index": 78
      }
    ],
    "SSN": [
      {
        "Text": "665778988",
        "Index": 45
      }
    ]
  },
  "Classification": {
    "ReviewRecommended": true,
    "Category1": {
      "Score": 0.00040505084325559437
    },
    "Category2": {
      "Score": 0.2234508991241455
    },
    "Category3": {
      "Score": 0.9879999756813049
    }
  },
  "Terms": [
    {
      "Index": 10,
      "OriginalIndex": 10,
      "ListId": 0,
      "Term": "crap"
    }
  ],
  "Status": {
    "Code": 3000,
    "Description": "OK",
    "Exception": ""
  },
  "TrackingId": "9fdfef70-6ed8-4a88-99a0-5b6d0b8d7108"
}

Definitions

Name Description
Address

Address details.

APIError

Error information that the API returns.

Category1

Category1 score details of the text. For more details on category classification, see this article.

Category2

Category2 score details of the text. For more details on category classification, see this article.

Category3

Category3 score details of the text. For more details on category classification, see this article.

Classification

Classification details of the text.

DetectedTerms

Detected term details.

Email

Email address details.

Error

Error body.

IPA

IP address details.

Phone

Phone property details.

PII

Details about personally identifiable information.

Screen

Response for a screen text request.

SSN

Details about a detected social security number.

Status

Status properties.

Address

Address details.

Name Type Description
Index

integer

Index (location) of the address in the input text content.

Text

string

Detected address.

APIError

Error information that the API returns.

Name Type Description
Error

Error

Error body.

Category1

Category1 score details of the text. For more details on category classification, see this article.

Name Type Description
Score

number

Category1 score.

Category2

Category2 score details of the text. For more details on category classification, see this article.

Name Type Description
Score

number

Category2 score.

Category3

Category3 score details of the text. For more details on category classification, see this article.

Name Type Description
Score

number

Category3 score.

Classification

Classification details of the text.

Name Type Description
Category1

Category1

Category1 score details of the text. For more details on category classification, see this article.

Category2

Category2

Category2 score details of the text. For more details on category classification, see this article.

Category3

Category3

Category3 score details of the text. For more details on category classification, see this article.

ReviewRecommended

boolean

Review-recommended flag.

DetectedTerms

Detected term details.

Name Type Description
Index

integer

Index (location) of the detected profanity term in the input text content.

ListId

integer

Matched ID in the term list.

OriginalIndex

integer

Original index (location) of the detected profanity term in the input text content.

Term

string

Detected profanity term.

Email

Email address details.

Name Type Description
Detected

string

Detected email address from the input text content.

Index

integer

Index (location) of the email address in the input text content.

SubType

string

Subtype of the detected email address.

Text

string

Email address in the input text content.

Error

Error body.

Name Type Description
Code

string

Message

string

IPA

IP address details.

Name Type Description
Index

integer

Index (location) of the IP address in the input text content.

SubType

string

Subtype of the detected IP address.

Text

string

Detected IP address.

Phone

Phone property details.

Name Type Description
CountryCode

string

Country/region code of the detected phone number.

Index

integer

Index (location) of the phone number in the input text content.

Text

string

Detected phone number.

PII

Details about personally identifiable information.

Name Type Description
Address

Address[]

Address details.

Email

Email[]

Email address details.

IPA

IPA[]

IP address details.

Phone

Phone[]

Phone property details.

SSN

SSN[]

Details about a detected social security number.

Screen

Response for a screen text request.

Name Type Description
AutoCorrectedText

string

Autocorrected text.

Classification

Classification

Classification details of the text.

Language

string

Language of the input text content.

Misrepresentation

string[]

Misrepresentation text.

NormalizedText

string

Normalized text.

OriginalText

string

Original text.

PII

PII

Details about personally identifiable information.

Status

Status

Evaluation status.

Terms

DetectedTerms[]

Detected term details.

TrackingId

string

Unique Content Moderator transaction ID.

SSN

Details about a detected social security number.

Name Type Description
Index

integer

Index (location) of the social security number in the input text content.

Text

string

Detected social security number in the input text content.

Status

Status properties.

Name Type Description
Code

integer

Status code.

Description

string

Status description.

Exception

string

Exception status.