Skip to content

Commit 74c8533

Browse files
authored
Merge pull request #110859 from PatrickFarley/conmod-updates
[cog serv] Conmod updates
2 parents ca70830 + a451227 commit 74c8533

File tree

3 files changed

+119
-182
lines changed

3 files changed

+119
-182
lines changed

articles/cognitive-services/Content-Moderator/text-moderation-api.md

Lines changed: 60 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.author: pafarley
1616

1717
# Learn text moderation concepts
1818

19-
Use Content Moderators machine-assisted text moderation and [human review](Review-Tool-User-Guide/human-in-the-loop.md) capabilities to moderate text content.
19+
Use Content Moderator's machine-assisted text moderation and [human review](Review-Tool-User-Guide/human-in-the-loop.md) capabilities to moderate text content.
2020

2121
You either block, approve or review the content based on your policies and thresholds. Use it to augment human moderation of environments where partners, employees and consumers generate text content. These include chat rooms, discussion boards, chatbots, e-commerce catalogs, and documents. 
2222

@@ -33,13 +33,13 @@ The service response includes the following information:
3333

3434
If the API detects any profane terms in any of the [supported languages](Text-Moderation-API-Languages.md), those terms are included in the response. The response also contains their location (`Index`) in the original text. The `ListId` in the following sample JSON refers to terms found in [custom term lists](try-terms-list-api.md) if available.
3535

36-
"Terms": [
37-
{
38-
"Index": 118,
39-
"OriginalIndex": 118,
40-
"ListId": 0,
41-
"Term": "crap"
42-
}
36+
"Terms": [
37+
{
38+
"Index": 118,
39+
"OriginalIndex": 118,
40+
"ListId": 0,
41+
"Term": "crap"
42+
}
4343

4444
> [!NOTE]
4545
> For the **language** parameter, assign `eng` or leave it empty to see the machine-assisted **classification** response (preview feature). **This feature supports English only**.
@@ -48,22 +48,22 @@ If the API detects any profane terms in any of the [supported languages](Text-Mo
4848
4949
## Classification
5050

51-
Content Moderators machine-assisted **text classification feature** supports **English only**, and helps detect potentially undesired content. The flagged content may be assessed as inappropriate depending on context. It conveys the likelihood of each category and may recommend a human review. The feature uses a trained model to identify possible abusive, derogatory or discriminatory language. This includes slang, abbreviated words, offensive, and intentionally misspelled words for review.
51+
Content Moderator's machine-assisted **text classification feature** supports **English only**, and helps detect potentially undesired content. The flagged content may be assessed as inappropriate depending on context. It conveys the likelihood of each category and may recommend a human review. The feature uses a trained model to identify possible abusive, derogatory or discriminatory language. This includes slang, abbreviated words, offensive, and intentionally misspelled words for review.
5252

5353
The following extract in the JSON extract shows an example output:
5454

55-
"Classification": {
56-
"ReviewRecommended": true,
57-
"Category1": {
58-
"Score": 1.5113095059859916E-06
59-
},
60-
"Category2": {
61-
"Score": 0.12747249007225037
62-
},
63-
"Category3": {
64-
"Score": 0.98799997568130493
65-
}
66-
}
55+
"Classification": {
56+
"ReviewRecommended": true,
57+
"Category1": {
58+
"Score": 1.5113095059859916E-06
59+
},
60+
"Category2": {
61+
"Score": 0.12747249007225037
62+
},
63+
"Category3": {
64+
"Score": 0.98799997568130493
65+
}
66+
}
6767

6868
### Explanation
6969

@@ -78,86 +78,57 @@ The following extract in the JSON extract shows an example output:
7878
The personal data feature detects the potential presence of this information:
7979

8080
- Email address
81-
- US Mailing address
81+
- US mailing address
8282
- IP address
83-
- US Phone number
84-
- UK Phone number
85-
- Social Security Number (SSN)
83+
- US phone number
8684

8785
The following example shows a sample response:
8886

8987
```json
90-
"PII":{
91-
"Email":[
92-
{
93-
"Detected":"[email protected]",
94-
"SubType":"Regular",
95-
96-
"Index":32
97-
}
88+
"pii":{
89+
"email":[
90+
{
91+
"detected":"[email protected]",
92+
"sub_type":"Regular",
93+
94+
"index":32
95+
}
9896
],
99-
"IPA":[
100-
{
101-
"SubType":"IPV4",
102-
"Text":"255.255.255.255",
103-
"Index":72
104-
}
97+
"ssn":[
98+
10599
],
106-
"Phone":[
107-
{
108-
"CountryCode":"US",
109-
"Text":"4255550111",
110-
"Index":56
111-
},
112-
{
113-
"CountryCode":"US",
114-
"Text":"425 555 0111",
115-
"Index":212
116-
},
117-
{
118-
"CountryCode":"UK",
119-
"Text":"+123 456 7890",
120-
"Index":208
121-
},
122-
{
123-
"CountryCode":"UK",
124-
"Text":"0234 567 8901",
125-
"Index":228
126-
},
127-
{
128-
"CountryCode":"UK",
129-
"Text":"0456 789 0123",
130-
"Index":245
131-
}
100+
"ipa":[
101+
{
102+
"sub_type":"IPV4",
103+
"text":"255.255.255.255",
104+
"index":72
105+
}
132106
],
133-
"Address":[
134-
{
135-
"Text":"1234 Main Boulevard, Panapolis WA 96555",
136-
"Index":89
137-
}
107+
"phone":[
108+
{
109+
"country_code":"US",
110+
"text":"6657789887",
111+
"index":56
112+
}
138113
],
139-
"SSN":[
140-
{
141-
"Text":"999999999",
142-
"Index":56
143-
},
144-
{
145-
"Text":"999-99-9999",
146-
"Index":267
147-
}
114+
"address":[
115+
{
116+
"text":"1 Microsoft Way, Redmond, WA 98052",
117+
"index":89
118+
}
148119
]
149120
}
150121
```
151122

152123
## Auto-correction
153124

154-
Suppose the input text is (the lzay and 'f0x' are intentional):
125+
Suppose the input text is (the 'lzay' and 'f0x' are intentional):
155126

156-
The qu!ck brown f0x jumps over the lzay dog.
127+
The qu!ck brown f0x jumps over the lzay dog.
157128

158129
If you ask for auto-correction, the response contains the corrected version of the text:
159130

160-
The quick brown fox jumps over the lazy dog.
131+
The quick brown fox jumps over the lazy dog.
161132

162133
## Creating and managing your custom lists of terms
163134

@@ -169,13 +140,13 @@ While the default, global list of terms works great for most cases, you may want
169140
170141
The following example shows the matching List ID:
171142

172-
"Terms": [
173-
{
174-
"Index": 118,
175-
"OriginalIndex": 118,
176-
"ListId": 231.
177-
"Term": "crap"
178-
}
143+
"Terms": [
144+
{
145+
"Index": 118,
146+
"OriginalIndex": 118,
147+
"ListId": 231.
148+
"Term": "crap"
149+
}
179150

180151
The Content Moderator provides a [Term List API](https://westus.dev.cognitive.microsoft.com/docs/services/57cf755e3f9b070c105bd2c2/operations/57cf755e3f9b070868a1f67f) with operations for managing custom term lists. Start with the [Term Lists API Console](try-terms-list-api.md) and use the REST API code samples. Also check out the [Term Lists .NET quickstart](term-lists-quickstart-dotnet.md) if you are familiar with Visual Studio and C#.
181152

articles/cognitive-services/Content-Moderator/try-text-api.md

Lines changed: 57 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ For **Content-Type**, select the type of content you want to screen. For this ex
5959
In the **Request body** box, enter some text. The following example shows an intentional typo in the text.
6060

6161
```
62-
Is this a grabage or crap email [email protected], phone: 4255550111, IP: 255.255.255.255, 1234 Main Boulevard, Panapolis WA 96555. These are all UK phone numbers, the last two being Microsoft UK support numbers: +44 870 608 4000 or 0344 800 2400 or 0800 820 3300. Also, 999-99-9999 looks like a social security number (SSN).
62+
Is this a grabage or crap email [email protected], phone: 4255550111, IP:
63+
255.255.255.255, 1234 Main Boulevard, Panapolis WA 96555.
6364
```
6465

6566
## Analyze the response
@@ -70,96 +71,61 @@ The following response shows the various insights from the API. It contains pote
7071
> The machine-assisted 'Classification' feature is in preview and supports English only.
7172
7273
```json
73-
{"OriginalText":"Is this a grabage or crap email [email protected], phone: 4255550111, IP: 255.255.255.255, 1234 Main Boulevard, Panapolis WA 96555.\r\nThese are all UK phone numbers: +44 123 456 7890 or 0234 567 8901 or 0456 789 0123.\r\nAlso, 999-99-9999 looks like a social security number (SSN).",
74-
"NormalizedText":"Is this a grabage or crap email abcdef@ abcd. com, phone: 4255550111, IP: 255. 255. 255. 255, 1234 Main Boulevard, Panapolis WA 96555. \r\nThese are all UK phone numbers: +44 123 456 7890 or 0234 567 8901 or 0456 789 0123. \r\nAlso, 999- 99- 9999 looks like a social security number ( SSN) .",
75-
"Misrepresentation":null,
76-
"PII":{
77-
"Email":[
78-
{
79-
"Detected":"[email protected]",
80-
"SubType":"Regular",
81-
82-
"Index":32
83-
}
84-
],
85-
"IPA":[
86-
{
87-
"SubType":"IPV4",
88-
"Text":"255.255.255.255",
89-
"Index":72
90-
}
91-
],
92-
"Phone":[
93-
{
94-
"CountryCode":"US",
95-
"Text":"4255550111",
96-
"Index":56
97-
},
98-
{
99-
"CountryCode":"US",
100-
"Text":"425 555 0111",
101-
"Index":211
102-
},
103-
{
104-
"CountryCode":"UK",
105-
"Text":"+44 123 456 7890",
106-
"Index":207
107-
},
108-
{
109-
"CountryCode":"UK",
110-
"Text":"0234 567 8901",
111-
"Index":227
112-
},
113-
{
114-
"CountryCode":"UK",
115-
"Text":"0456 789 0123",
116-
"Index":244
117-
}
118-
],
119-
"Address":[
120-
{
121-
"Text":"1234 Main Boulevard, Panapolis WA 96555",
122-
"Index":89
123-
}
124-
],
125-
"SSN":[
126-
{
127-
"Text":"999999999",
128-
"Index":56
129-
},
130-
{
131-
"Text":"999-99-9999",
132-
"Index":266
133-
}
134-
]
135-
},
136-
"Classification":{
137-
"ReviewRecommended":true,
138-
"Category1":{
139-
"Score":1.5113095059859916E-06
140-
},
141-
"Category2":{
142-
"Score":0.12747249007225037
143-
},
144-
"Category3":{
145-
"Score":0.98799997568130493
146-
}
147-
},
148-
"Language":"eng",
149-
"Terms":[
150-
{
151-
"Index":21,
152-
"OriginalIndex":21,
153-
"ListId":0,
154-
"Term":"crap"
155-
}
156-
],
157-
"Status":{
158-
"Code":3000,
159-
"Description":"OK",
160-
"Exception":null
161-
},
162-
"TrackingId":"2eaa012f-1604-4e36-a8d7-cc34b14ebcb4"
74+
{
75+
"original_text":"Is this a grabage or crap email [email protected], phone:
76+
6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052.",
77+
"normalized_text":" grabage crap email [email protected], phone:
78+
6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052.",
79+
"auto_corrected_text":"Is this a garbage or crap email [email protected], phone:
80+
6657789887, IP: 255.255.255.255, 1 Microsoft Way, Redmond, WA 98052.",
81+
"status":{
82+
"code":3000,
83+
"description":"OK"
84+
},
85+
"pii":{
86+
"email":[
87+
{
88+
"detected":"[email protected]",
89+
"sub_type":"Regular",
90+
91+
"index":32
92+
}
93+
],
94+
"ssn":[
95+
96+
],
97+
"ipa":[
98+
{
99+
"sub_type":"IPV4",
100+
"text":"255.255.255.255",
101+
"index":72
102+
}
103+
],
104+
"phone":[
105+
{
106+
"country_code":"US",
107+
"text":"6657789887",
108+
"index":56
109+
}
110+
],
111+
"address":[
112+
{
113+
"text":"1 Microsoft Way, Redmond, WA 98052",
114+
"index":89
115+
}
116+
]
117+
},
118+
"language":"eng",
119+
"terms":[
120+
{
121+
"index":12,
122+
"original_index":21,
123+
"list_id":0,
124+
"term":"crap"
125+
}
126+
],
127+
"tracking_id":"WU_ibiza_65a1016d-0f67-45d2-b838-b8f373d6d52e_ContentModerator.
128+
F0_fe000d38-8ecd-47b5-a8b0-4764df00e3b5"
163129
}
164130
```
165131

articles/cognitive-services/Content-Moderator/video-transcript-moderation-review-tutorial-dotnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The class `Program` in `Program.cs` is the main entry point to the video moderat
7979
If no command-line arguments are present, `Main()` calls `GetUserInputs()`. This method prompts the user to enter the path to a single video file and to specify whether a text transcript should be generated.
8080

8181
> [!NOTE]
82-
> The console application uses the [Azure Media Indexer API](https://docs.microsoft.com/azure/media-services/media-services-process-content-with-indexer2) to generate transcripts from the uploaded video's audio track. The results are provided in WebVTT format. For more information on this format, see [Web Video Text Tracks Format](https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API).
82+
> The console application uses the [Azure Media Indexer API](https://docs.microsoft.com/azure/media-services/media-services-process-content-with-indexer2) to generate transcripts from the uploaded video's audio track. The results are provided in WebVTT format. For more information on this format, see [Web Video Text Tracks Format](https://developer.mozilla.org/docs/Web/API/WebVTT_API).
8383
8484
### Initialize and ProcessVideo methods
8585

@@ -220,7 +220,7 @@ The result of the video moderation job (See [video moderation quickstart](video-
220220
A transcription of the audio from the video is also produced when the `GenerateVTT` flag is set.
221221

222222
> [!NOTE]
223-
> The console application uses the [Azure Media Indexer API](https://docs.microsoft.com/azure/media-services/media-services-process-content-with-indexer2) to generate transcripts from the uploaded video's audio track. The results are provided in WebVTT format. For more information on this format, see [Web Video Text Tracks Format](https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API).
223+
> The console application uses the [Azure Media Indexer API](https://docs.microsoft.com/azure/media-services/media-services-process-content-with-indexer2) to generate transcripts from the uploaded video's audio track. The results are provided in WebVTT format. For more information on this format, see [Web Video Text Tracks Format](https://developer.mozilla.org/docs/Web/API/WebVTT_API).
224224
225225
## Create a human review
226226

0 commit comments

Comments
 (0)