batch_detect_sentiment
async
¶
batch_detect_sentiment(
text_list: CustomerInputStringList,
language_code: LanguageCode,
*,
config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> BatchDetectSentimentResponse
Inspects a batch of documents and returns an inference of the prevailing sentiment, POSITIVE, NEUTRAL, MIXED, or NEGATIVE, in each one.
Parameters:
-
text_list(CustomerInputStringList) –A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.
-
language_code(LanguageCode) –The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.
Raises:
-
BatchSizeLimitExceededException–The number of documents in the request exceeds the limit of 25. Try your request again with fewer documents.
-
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
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |