azure.cognitiveservices.vision.contentmoderator.operations module

class azure.cognitiveservices.vision.contentmoderator.operations.ImageModerationOperations(client, config, serializer, deserializer)[source]

Bases: object

ImageModerationOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
evaluate_file_input(image_stream, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Returns probabilities of the image containing racy or adult content.

Parameters:
  • image_stream (Generator) – The image file.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

Evaluate or ClientRawResponse if raw=true

Return type:

Evaluate or ClientRawResponse

Raises:

APIErrorException

evaluate_method(cache_image=None, custom_headers=None, raw=False, **operation_config)[source]

Returns probabilities of the image containing racy or adult content.

Parameters:
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Evaluate or ClientRawResponse if raw=true

Return type:

Evaluate or ClientRawResponse

Raises:

APIErrorException

evaluate_url_input(content_type, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)[source]

Returns probabilities of the image containing racy or adult content.

Parameters:
  • content_type (str) – The content type.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • data_representation (str) –
  • value (str) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Evaluate or ClientRawResponse if raw=true

Return type:

Evaluate or ClientRawResponse

Raises:

APIErrorException

find_faces(cache_image=None, custom_headers=None, raw=False, **operation_config)[source]

Returns the list of faces found.

Parameters:
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

FoundFaces or ClientRawResponse if raw=true

Return type:

FoundFaces or ClientRawResponse

Raises:

APIErrorException

find_faces_file_input(image_stream, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Returns the list of faces found.

Parameters:
  • image_stream (Generator) – The image file.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

FoundFaces or ClientRawResponse if raw=true

Return type:

FoundFaces or ClientRawResponse

Raises:

APIErrorException

find_faces_url_input(content_type, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)[source]

Returns the list of faces found.

Parameters:
  • content_type (str) – The content type.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • data_representation (str) –
  • value (str) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

FoundFaces or ClientRawResponse if raw=true

Return type:

FoundFaces or ClientRawResponse

Raises:

APIErrorException

match_file_input(image_stream, list_id=None, cache_image=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href=”/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe”>this</a> API. Returns ID and tags of matching image.<br/> <br/> Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

Parameters:
  • image_stream (Generator) – The image file.
  • list_id (str) – The list Id.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

MatchResponse or ClientRawResponse if raw=true

Return type:

MatchResponse or ClientRawResponse

Raises:

APIErrorException

match_method(list_id=None, cache_image=None, custom_headers=None, raw=False, **operation_config)[source]

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href=”/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe”>this</a> API. Returns ID and tags of matching image.<br/> <br/> Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

Parameters:
  • list_id (str) – The list Id.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

MatchResponse or ClientRawResponse if raw=true

Return type:

MatchResponse or ClientRawResponse

Raises:

APIErrorException

match_url_input(content_type, list_id=None, cache_image=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)[source]

Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href=”/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe”>this</a> API. Returns ID and tags of matching image.<br/> <br/> Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response.

Parameters:
  • content_type (str) – The content type.
  • list_id (str) – The list Id.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • data_representation (str) –
  • value (str) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

MatchResponse or ClientRawResponse if raw=true

Return type:

MatchResponse or ClientRawResponse

Raises:

APIErrorException

ocr_file_input(language, image_stream, cache_image=None, enhanced=False, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

Parameters:
  • language (str) – Language of the terms.
  • image_stream (Generator) – The image file.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • enhanced (bool) – When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

OCR or ClientRawResponse if raw=true

Return type:

OCR or ClientRawResponse

Raises:

APIErrorException

ocr_method(language, cache_image=None, enhanced=False, custom_headers=None, raw=False, **operation_config)[source]

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

Parameters:
  • language (str) – Language of the terms.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • enhanced (bool) – When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

OCR or ClientRawResponse if raw=true

Return type:

OCR or ClientRawResponse

Raises:

APIErrorException

ocr_url_input(language, content_type, cache_image=None, enhanced=False, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)[source]

Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.

Parameters:
  • language (str) – Language of the terms.
  • content_type (str) – The content type.
  • cache_image (bool) – Whether to retain the submitted image for future use; defaults to false if omitted.
  • enhanced (bool) – When set to True, the image goes through additional processing to come with additional candidates. image/tiff is not supported when enhanced is set to true Note: This impacts the response time.
  • data_representation (str) –
  • value (str) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

OCR or ClientRawResponse if raw=true

Return type:

OCR or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.TextModerationOperations(client, config, serializer, deserializer)[source]

Bases: object

TextModerationOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
detect_language(text_content_type, text_content, custom_headers=None, raw=False, callback=None, **operation_config)[source]

This operation will detect the language of given input content. Returns the <a href=”http://www-01.sil.org/iso639-3/codes.asp”>ISO 639-3 code</a> for the predominant language comprising the submitted text. Over 110 languages supported.

Parameters:
  • text_content_type (str) – The content type. Possible values include: ‘text/plain’, ‘text/html’, ‘text/xml’, ‘text/markdown’
  • text_content (Generator) – Content to screen.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

DetectedLanguage or ClientRawResponse if raw=true

Return type:

DetectedLanguage or ClientRawResponse

Raises:

APIErrorException

screen_text(text_content_type, text_content, language=None, autocorrect=False, pii=False, list_id=None, classify=False, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Detect profanity and match against custom and shared blacklists.

Detects profanity in more than 100 languages and match against custom and shared blacklists.

Parameters:
  • text_content_type (str) – The content type. Possible values include: ‘text/plain’, ‘text/html’, ‘text/xml’, ‘text/markdown’
  • text_content (Generator) – Content to screen.
  • language (str) – Language of the text.
  • autocorrect (bool) – Autocorrect text.
  • pii (bool) – Detect personal identifiable information.
  • list_id (str) – The list Id.
  • classify (bool) – Classify input.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

Screen or ClientRawResponse if raw=true

Return type:

Screen or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.ListManagementImageListsOperations(client, config, serializer, deserializer)[source]

Bases: object

ListManagementImageListsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
create(content_type, body, custom_headers=None, raw=False, **operation_config)[source]

Creates an image list.

Parameters:
  • content_type (str) – The content type.
  • body (Body) – Schema of the body.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ImageList or ClientRawResponse if raw=true

Return type:

ImageList or ClientRawResponse

Raises:

APIErrorException

delete(list_id, custom_headers=None, raw=False, **operation_config)[source]

Deletes image list with the list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

get_all_image_lists(custom_headers=None, raw=False, **operation_config)[source]

Gets all the Image Lists.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

list or ClientRawResponse if raw=true

Return type:

list[ImageList] or ClientRawResponse

Raises:

APIErrorException

get_details(list_id, custom_headers=None, raw=False, **operation_config)[source]

Returns the details of the image list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ImageList or ClientRawResponse if raw=true

Return type:

ImageList or ClientRawResponse

Raises:

APIErrorException

refresh_index_method(list_id, custom_headers=None, raw=False, **operation_config)[source]

Refreshes the index of the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

RefreshIndex or ClientRawResponse if raw=true

Return type:

RefreshIndex or ClientRawResponse

Raises:

APIErrorException

update(list_id, content_type, body, custom_headers=None, raw=False, **operation_config)[source]

Updates an image list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • content_type (str) – The content type.
  • body (Body) – Schema of the body.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ImageList or ClientRawResponse if raw=true

Return type:

ImageList or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.ListManagementTermListsOperations(client, config, serializer, deserializer)[source]

Bases: object

ListManagementTermListsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
create(content_type, body, custom_headers=None, raw=False, **operation_config)[source]

Creates a Term List.

Parameters:
  • content_type (str) – The content type.
  • body (Body) – Schema of the body.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

TermList or ClientRawResponse if raw=true

Return type:

TermList or ClientRawResponse

Raises:

APIErrorException

delete(list_id, custom_headers=None, raw=False, **operation_config)[source]

Deletes term list with the list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

get_all_term_lists(custom_headers=None, raw=False, **operation_config)[source]

gets all the Term Lists.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

list or ClientRawResponse if raw=true

Return type:

list[TermList] or ClientRawResponse

Raises:

APIErrorException

get_details(list_id, custom_headers=None, raw=False, **operation_config)[source]

Returns list Id details of the term list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

TermList or ClientRawResponse if raw=true

Return type:

TermList or ClientRawResponse

Raises:

APIErrorException

refresh_index_method(list_id, language, custom_headers=None, raw=False, **operation_config)[source]

Refreshes the index of the list with list Id equal to list ID passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • language (str) – Language of the terms.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

RefreshIndex or ClientRawResponse if raw=true

Return type:

RefreshIndex or ClientRawResponse

Raises:

APIErrorException

update(list_id, content_type, body, custom_headers=None, raw=False, **operation_config)[source]

Updates an Term List.

Parameters:
  • list_id (str) – List Id of the image list.
  • content_type (str) – The content type.
  • body (Body) – Schema of the body.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

TermList or ClientRawResponse if raw=true

Return type:

TermList or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.ListManagementImageOperations(client, config, serializer, deserializer)[source]

Bases: object

ListManagementImageOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
add_image(list_id, tag=None, label=None, custom_headers=None, raw=False, **operation_config)[source]

Add an image to the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • tag (int) – Tag for the image.
  • label (str) – The image label.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Image or ClientRawResponse if raw=true

Return type:

Image or ClientRawResponse

Raises:

APIErrorException

add_image_file_input(list_id, image_stream, tag=None, label=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Add an image to the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • image_stream (Generator) – The image file.
  • tag (int) – Tag for the image.
  • label (str) – The image label.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

Image or ClientRawResponse if raw=true

Return type:

Image or ClientRawResponse

Raises:

APIErrorException

add_image_url_input(list_id, content_type, tag=None, label=None, data_representation='URL', value=None, custom_headers=None, raw=False, **operation_config)[source]

Add an image to the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • content_type (str) – The content type.
  • tag (int) – Tag for the image.
  • label (str) – The image label.
  • data_representation (str) –
  • value (str) –
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Image or ClientRawResponse if raw=true

Return type:

Image or ClientRawResponse

Raises:

APIErrorException

delete_all_images(list_id, custom_headers=None, raw=False, **operation_config)[source]

Deletes all images from the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

delete_image(list_id, image_id, custom_headers=None, raw=False, **operation_config)[source]

Deletes an image from the list with list Id and image Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • image_id (str) – Id of the image.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

get_all_image_ids(list_id, custom_headers=None, raw=False, **operation_config)[source]

Gets all image Ids from the list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ImageIds or ClientRawResponse if raw=true

Return type:

ImageIds or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.ListManagementTermOperations(client, config, serializer, deserializer)[source]

Bases: object

ListManagementTermOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
add_term(list_id, term, language, custom_headers=None, raw=False, **operation_config)[source]

Add a term to the term list with list Id equal to list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • term (str) – Term to be deleted
  • language (str) – Language of the terms.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

object or ClientRawResponse if raw=true

Return type:

object or ClientRawResponse

Raises:

APIErrorException

delete_all_terms(list_id, language, custom_headers=None, raw=False, **operation_config)[source]

Deletes all terms from the list with list Id equal to the list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • language (str) – Language of the terms.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

delete_term(list_id, term, language, custom_headers=None, raw=False, **operation_config)[source]

Deletes a term from the list with list Id equal to the list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • term (str) – Term to be deleted
  • language (str) – Language of the terms.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

str or ClientRawResponse if raw=true

Return type:

str or ClientRawResponse

Raises:

APIErrorException

get_all_terms(list_id, language, offset=None, limit=None, custom_headers=None, raw=False, **operation_config)[source]

Gets all terms from the list with list Id equal to the list Id passed.

Parameters:
  • list_id (str) – List Id of the image list.
  • language (str) – Language of the terms.
  • offset (int) – The pagination start index.
  • limit (int) – The max limit.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Terms or ClientRawResponse if raw=true

Return type:

Terms or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>
class azure.cognitiveservices.vision.contentmoderator.operations.ReviewsOperations(client, config, serializer, deserializer)[source]

Bases: object

ReviewsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

content_type – The content type. Constant value: “text/plain”.

add_video_frame(team_name, review_id, timescale=None, custom_headers=None, raw=False, **operation_config)[source]

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint. <h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/> </p>.

Parameters:
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • timescale (int) – Timescale of the video you are adding frames to.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale=None, custom_headers=None, raw=False, **operation_config)[source]

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

Parameters:
  • content_type (str) – The content type.
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • frame_image_zip (Generator) – Zip file containing frame images.
  • frame_metadata (str) – Metadata of the frame.
  • timescale (int) – Timescale of the video .
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale=None, custom_headers=None, raw=False, **operation_config)[source]

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

Parameters:
  • content_type (str) – The content type.
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • video_frame_body (list[VideoFrameBodyItem]) – Body for add video frames API
  • timescale (int) – Timescale of the video.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

add_video_transcript(team_name, review_id, vt_tfile, custom_headers=None, raw=False, callback=None, **operation_config)[source]

This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.

Parameters:
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • vt_tfile (Generator) – Transcript file of the video.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

add_video_transcript_moderation_result(content_type, team_name, review_id, transcript_moderation_body, custom_headers=None, raw=False, **operation_config)[source]

This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Text API . In order to generate transcript screen text result file , a transcript file has to be screened for profanity using Screen Text API.

Parameters:
  • content_type (str) – The content type.
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • transcript_moderation_body (list[TranscriptModerationBodyItem]) – Body for add video transcript moderation result API
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

create_job(team_name, content_type, content_id, workflow_name, job_content_type, content_value, call_back_endpoint=None, custom_headers=None, raw=False, **operation_config)[source]

A job Id will be returned for the content posted on this endpoint. Once the content is evaluated against the Workflow provided the review will be created or ignored based on the workflow expression. <h3>CallBack Schemas </h3> <p> <h4>Job Completion CallBack Sample</h4><br/> {<br/> “JobId”: “<Job Id>,<br/> “ReviewId”: “<Review Id, if the Job resulted in a Review to be created>”,<br/> “WorkFlowId”: “default”,<br/> “Status”: “<This will be one of Complete, InProgress, Error>”,<br/> “ContentType”: “Image”,<br/> “ContentId”: “<This is the ContentId that was specified on input>”,<br/> “CallBackType”: “Job”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> }<br/> }<br/> </p> <p> <h4>Review Completion CallBack Sample</h4><br/> { “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”, “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/> </p>.

Parameters:
  • team_name (str) – Your team name.
  • content_type (str) – Image, Text or Video. Possible values include: ‘Image’, ‘Text’, ‘Video’
  • content_id (str) – Id/Name to identify the content submitted.
  • workflow_name (str) – Workflow Name that you want to invoke.
  • job_content_type (str) – The content type. Possible values include: ‘application/json’, ‘image/jpeg’
  • content_value (str) – Content to evaluate for a job.
  • call_back_endpoint (str) – Callback endpoint for posting the create job result.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

JobId or ClientRawResponse if raw=true

Return type:

JobId or ClientRawResponse

Raises:

APIErrorException

create_reviews(url_content_type, team_name, create_review_body, sub_team=None, custom_headers=None, raw=False, **operation_config)[source]

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint. <h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/> </p>.

Parameters:
  • url_content_type (str) – The content type.
  • team_name (str) – Your team name.
  • create_review_body (list[CreateReviewBodyItem]) – Body for create reviews API
  • sub_team (str) – SubTeam of your team, you want to assign the created review to.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

list or ClientRawResponse if raw=true

Return type:

list[str] or ClientRawResponse

Raises:

APIErrorException

create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team=None, custom_headers=None, raw=False, **operation_config)[source]

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint. <h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/> </p>.

Parameters:
  • content_type (str) – The content type.
  • team_name (str) – Your team name.
  • create_video_reviews_body (list[CreateVideoReviewsBodyItem]) – Body for create reviews API
  • sub_team (str) – SubTeam of your team, you want to assign the created review to.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

list or ClientRawResponse if raw=true

Return type:

list[str] or ClientRawResponse

Raises:

APIErrorException

get_job_details(team_name, job_id, custom_headers=None, raw=False, **operation_config)[source]

Get the Job Details for a Job Id.

Parameters:
  • team_name (str) – Your Team Name.
  • job_id (str) – Id of the job.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Job or ClientRawResponse if raw=true

Return type:

Job or ClientRawResponse

Raises:

APIErrorException

get_review(team_name, review_id, custom_headers=None, raw=False, **operation_config)[source]

Returns review details for the review Id passed.

Parameters:
  • team_name (str) – Your Team Name.
  • review_id (str) – Id of the review.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Review or ClientRawResponse if raw=true

Return type:

Review or ClientRawResponse

Raises:

APIErrorException

get_video_frames(team_name, review_id, start_seed=None, no_of_records=None, filter=None, custom_headers=None, raw=False, **operation_config)[source]

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint. <h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/> </p>.

Parameters:
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • start_seed (int) – Time stamp of the frame from where you want to start fetching the frames.
  • no_of_records (int) – Number of frames to fetch.
  • filter (str) – Get frames filtered by tags.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Frames or ClientRawResponse if raw=true

Return type:

Frames or ClientRawResponse

Raises:

APIErrorException

publish_video_review(team_name, review_id, custom_headers=None, raw=False, **operation_config)[source]

Publish video review to make it available for review.

Parameters:
  • team_name (str) – Your team name.
  • review_id (str) – Id of the review.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

APIErrorException

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from '/usr/lib/python3/dist-packages/azure/cognitiveservices/vision/contentmoderator/models/__init__.py'>