detect_toxic_content
async
¶
detect_toxic_content(
text_segments: ListOfTextSegments,
language_code: LanguageCode,
*,
config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> DetectToxicContentResponse
Performs toxicity analysis on the list of text strings that you provide as input. The API response contains a results list that matches the size of the input list. For more information about toxicity detection, see Toxicity detection in the Amazon Comprehend Developer Guide.
Parameters:
-
text_segments(ListOfTextSegments) –A list of up to 10 text strings. Each string has a maximum size of 1 KB, and the maximum size of the list is 10 KB.
-
language_code(LanguageCode) –The language of the input text. Currently, English is the only supported language.
Raises:
-
InternalServerException–An internal server error occurred. Retry your request.
-
InvalidRequestException–The request is invalid.
-
TextSizeLimitExceededException–The size of the input text exceeds the limit. Use a smaller document.
-
UnsupportedLanguageException–Amazon Comprehend can't process the language of the input text. For a list of supported languages, Supported languages in the Comprehend Developer Guide.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_comprehend/_services/async_comprehend.py
2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 | |