You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"extractEntities": True or False, # Extract entities.
359
362
"extractEntitySentiment": True or False, # Extract entities and their associated sentiment.
360
363
"extractSyntax": True or False, # Extract syntax information.
364
+
"moderateText": True or False, # Moderate the document for harmful and sensitive categories.
361
365
},
362
366
}
363
367
@@ -408,6 +412,12 @@ <h3>Method Details</h3>
408
412
},
409
413
],
410
414
"language": "A String", # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
415
+
"moderationCategories": [ # Harmful and sensitive categories identified in the input document.
416
+
{ # Represents a category returned from the text classifier.
417
+
"confidence": 3.14, # The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.
418
+
"name": "A String", # The name of the category representing the document.
419
+
},
420
+
],
411
421
"sentences": [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
412
422
{ # Represents a sentence in the input document.
413
423
"sentiment": { # Represents the feeling associated with the entire text or entities in the text. # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
<pre>Moderates a document for harmful and sensitive categories.
513
+
514
+
Args:
515
+
body: object, The request body.
516
+
The object takes the form of:
517
+
518
+
{ # The document moderation request message.
519
+
"document": { # Represents the input to API methods. # Required. Input document.
520
+
"content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
521
+
"gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
522
+
"language": "A String", # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
523
+
"type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
524
+
},
525
+
}
526
+
527
+
x__xgafv: string, V1 error format.
528
+
Allowed values
529
+
1 - v1 error format
530
+
2 - v2 error format
531
+
532
+
Returns:
533
+
An object of the form:
534
+
535
+
{ # The document moderation response message.
536
+
"moderationCategories": [ # Harmful and sensitive categories representing the input document.
537
+
{ # Represents a category returned from the text classifier.
538
+
"confidence": 3.14, # The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.
539
+
"name": "A String", # The name of the category representing the document.
"extractEntities": True or False, # Extract entities.
369
372
"extractEntitySentiment": True or False, # Extract entities and their associated sentiment.
370
373
"extractSyntax": True or False, # Extract syntax information.
374
+
"moderateText": True or False, # Moderate the document for harmful and sensitive categories.
371
375
},
372
376
}
373
377
@@ -418,6 +422,12 @@ <h3>Method Details</h3>
418
422
},
419
423
],
420
424
"language": "A String", # The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.
425
+
"moderationCategories": [ # Harmful and sensitive categories identified in the input document.
426
+
{ # Represents a category returned from the text classifier.
427
+
"confidence": 3.14, # The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.
428
+
"name": "A String", # The name of the category representing the document.
429
+
},
430
+
],
421
431
"sentences": [ # Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
422
432
{ # Represents a sentence in the input document.
423
433
"sentiment": { # Represents the feeling associated with the entire text or entities in the text. Next ID: 6 # For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
<pre>Moderates a document for harmful and sensitive categories.
525
+
526
+
Args:
527
+
body: object, The request body.
528
+
The object takes the form of:
529
+
530
+
{ # The document moderation request message.
531
+
"document": { # Represents the input to API methods. # Required. Input document.
532
+
"boilerplateHandling": "A String", # Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
533
+
"content": "A String", # The content of the input in string format. Cloud audit logging exempt since it is based on user data.
534
+
"gcsContentUri": "A String", # The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
535
+
"language": "A String", # The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
536
+
"referenceWebUri": "A String", # The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
537
+
"type": "A String", # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
538
+
},
539
+
}
540
+
541
+
x__xgafv: string, V1 error format.
542
+
Allowed values
543
+
1 - v1 error format
544
+
2 - v2 error format
545
+
546
+
Returns:
547
+
An object of the form:
548
+
549
+
{ # The document moderation response message.
550
+
"moderationCategories": [ # Harmful and sensitive categories representing the input document.
551
+
{ # Represents a category returned from the text classifier.
552
+
"confidence": 3.14, # The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.
553
+
"name": "A String", # The name of the category representing the document.
Copy file name to clipboardExpand all lines: googleapiclient/discovery_cache/documents/language.v1.json
+56-1Lines changed: 56 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -223,11 +223,30 @@
223
223
"https://www.googleapis.com/auth/cloud-language",
224
224
"https://www.googleapis.com/auth/cloud-platform"
225
225
]
226
+
},
227
+
"moderateText": {
228
+
"description": "Moderates a document for harmful and sensitive categories.",
229
+
"flatPath": "v1/documents:moderateText",
230
+
"httpMethod": "POST",
231
+
"id": "language.documents.moderateText",
232
+
"parameterOrder": [],
233
+
"parameters": {},
234
+
"path": "v1/documents:moderateText",
235
+
"request": {
236
+
"$ref": "ModerateTextRequest"
237
+
},
238
+
"response": {
239
+
"$ref": "ModerateTextResponse"
240
+
},
241
+
"scopes": [
242
+
"https://www.googleapis.com/auth/cloud-language",
243
+
"https://www.googleapis.com/auth/cloud-platform"
244
+
]
226
245
}
227
246
}
228
247
}
229
248
},
230
-
"revision": "20230520",
249
+
"revision": "20230603",
231
250
"rootUrl": "https://language.googleapis.com/",
232
251
"schemas": {
233
252
"AnalyzeEntitiesRequest": {
@@ -478,6 +497,13 @@
478
497
"description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.",
479
498
"type": "string"
480
499
},
500
+
"moderationCategories": {
501
+
"description": "Harmful and sensitive categories identified in the input document.",
502
+
"items": {
503
+
"$ref": "ClassificationCategory"
504
+
},
505
+
"type": "array"
506
+
},
481
507
"sentences": {
482
508
"description": "Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.",
483
509
"items": {
@@ -898,6 +924,35 @@
898
924
"extractSyntax": {
899
925
"description": "Extract syntax information.",
900
926
"type": "boolean"
927
+
},
928
+
"moderateText": {
929
+
"description": "Moderate the document for harmful and sensitive categories.",
930
+
"type": "boolean"
931
+
}
932
+
},
933
+
"type": "object"
934
+
},
935
+
"ModerateTextRequest": {
936
+
"description": "The document moderation request message.",
937
+
"id": "ModerateTextRequest",
938
+
"properties": {
939
+
"document": {
940
+
"$ref": "Document",
941
+
"description": "Required. Input document."
942
+
}
943
+
},
944
+
"type": "object"
945
+
},
946
+
"ModerateTextResponse": {
947
+
"description": "The document moderation response message.",
948
+
"id": "ModerateTextResponse",
949
+
"properties": {
950
+
"moderationCategories": {
951
+
"description": "Harmful and sensitive categories representing the input document.",
Copy file name to clipboardExpand all lines: googleapiclient/discovery_cache/documents/language.v1beta2.json
+56-1Lines changed: 56 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -223,11 +223,30 @@
223
223
"https://www.googleapis.com/auth/cloud-language",
224
224
"https://www.googleapis.com/auth/cloud-platform"
225
225
]
226
+
},
227
+
"moderateText": {
228
+
"description": "Moderates a document for harmful and sensitive categories.",
229
+
"flatPath": "v1beta2/documents:moderateText",
230
+
"httpMethod": "POST",
231
+
"id": "language.documents.moderateText",
232
+
"parameterOrder": [],
233
+
"parameters": {},
234
+
"path": "v1beta2/documents:moderateText",
235
+
"request": {
236
+
"$ref": "ModerateTextRequest"
237
+
},
238
+
"response": {
239
+
"$ref": "ModerateTextResponse"
240
+
},
241
+
"scopes": [
242
+
"https://www.googleapis.com/auth/cloud-language",
243
+
"https://www.googleapis.com/auth/cloud-platform"
244
+
]
226
245
}
227
246
}
228
247
}
229
248
},
230
-
"revision": "20230520",
249
+
"revision": "20230603",
231
250
"rootUrl": "https://language.googleapis.com/",
232
251
"schemas": {
233
252
"AnalyzeEntitiesRequest": {
@@ -478,6 +497,13 @@
478
497
"description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.",
479
498
"type": "string"
480
499
},
500
+
"moderationCategories": {
501
+
"description": "Harmful and sensitive categories identified in the input document.",
502
+
"items": {
503
+
"$ref": "ClassificationCategory"
504
+
},
505
+
"type": "array"
506
+
},
481
507
"sentences": {
482
508
"description": "Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.",
483
509
"items": {
@@ -916,6 +942,35 @@
916
942
"extractSyntax": {
917
943
"description": "Extract syntax information.",
918
944
"type": "boolean"
945
+
},
946
+
"moderateText": {
947
+
"description": "Moderate the document for harmful and sensitive categories.",
948
+
"type": "boolean"
949
+
}
950
+
},
951
+
"type": "object"
952
+
},
953
+
"ModerateTextRequest": {
954
+
"description": "The document moderation request message.",
955
+
"id": "ModerateTextRequest",
956
+
"properties": {
957
+
"document": {
958
+
"$ref": "Document",
959
+
"description": "Required. Input document."
960
+
}
961
+
},
962
+
"type": "object"
963
+
},
964
+
"ModerateTextResponse": {
965
+
"description": "The document moderation response message.",
966
+
"id": "ModerateTextResponse",
967
+
"properties": {
968
+
"moderationCategories": {
969
+
"description": "Harmful and sensitive categories representing the input document.",
0 commit comments