ComprehendClient#
Index > Comprehend > ComprehendClient
Auto-generated documentation for Comprehend type annotations stubs module mypy-boto3-comprehend.
ComprehendClient#
Type annotations and code completion for boto3.client("comprehend")
.
boto3 documentation
# ComprehendClient usage example
from boto3.session import Session
from mypy_boto3_comprehend.client import ComprehendClient
def get_comprehend_client() -> ComprehendClient:
return Session().client("comprehend")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("comprehend").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("comprehend")
try:
do_something(client)
except (
client.exceptions.BatchSizeLimitExceededException,
client.exceptions.ClientError,
client.exceptions.ConcurrentModificationException,
client.exceptions.InternalServerException,
client.exceptions.InvalidFilterException,
client.exceptions.InvalidRequestException,
client.exceptions.JobNotFoundException,
client.exceptions.KmsKeyValidationException,
client.exceptions.ResourceInUseException,
client.exceptions.ResourceLimitExceededException,
client.exceptions.ResourceNotFoundException,
client.exceptions.ResourceUnavailableException,
client.exceptions.TextSizeLimitExceededException,
client.exceptions.TooManyRequestsException,
client.exceptions.TooManyTagKeysException,
client.exceptions.TooManyTagsException,
client.exceptions.UnsupportedLanguageException,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_comprehend.client import Exceptions
def handle_error(exc: Exceptions.BatchSizeLimitExceededException) -> None:
...
Methods#
batch_detect_dominant_language#
Determines the dominant language of the input text for a batch of documents.
Type annotations and code completion for boto3.client("comprehend").batch_detect_dominant_language
method.
boto3 documentation
# batch_detect_dominant_language method definition
def batch_detect_dominant_language(
self,
*,
TextList: Sequence[str],
) -> BatchDetectDominantLanguageResponseTypeDef: # (1)
...
# batch_detect_dominant_language method usage example with argument unpacking
kwargs: BatchDetectDominantLanguageRequestRequestTypeDef = { # (1)
"TextList": ...,
}
parent.batch_detect_dominant_language(**kwargs)
batch_detect_entities#
Inspects the text of a batch of documents for named entities and returns information about them.
Type annotations and code completion for boto3.client("comprehend").batch_detect_entities
method.
boto3 documentation
# batch_detect_entities method definition
def batch_detect_entities(
self,
*,
TextList: Sequence[str],
LanguageCode: LanguageCodeType, # (1)
) -> BatchDetectEntitiesResponseTypeDef: # (2)
...
# batch_detect_entities method usage example with argument unpacking
kwargs: BatchDetectEntitiesRequestRequestTypeDef = { # (1)
"TextList": ...,
"LanguageCode": ...,
}
parent.batch_detect_entities(**kwargs)
batch_detect_key_phrases#
Detects the key noun phrases found in a batch of documents.
Type annotations and code completion for boto3.client("comprehend").batch_detect_key_phrases
method.
boto3 documentation
# batch_detect_key_phrases method definition
def batch_detect_key_phrases(
self,
*,
TextList: Sequence[str],
LanguageCode: LanguageCodeType, # (1)
) -> BatchDetectKeyPhrasesResponseTypeDef: # (2)
...
# batch_detect_key_phrases method usage example with argument unpacking
kwargs: BatchDetectKeyPhrasesRequestRequestTypeDef = { # (1)
"TextList": ...,
"LanguageCode": ...,
}
parent.batch_detect_key_phrases(**kwargs)
batch_detect_sentiment#
Inspects a batch of documents and returns an inference of the prevailing
sentiment, POSITIVE
, NEUTRAL
, MIXED
, or NEGATIVE
, in each
one.
Type annotations and code completion for boto3.client("comprehend").batch_detect_sentiment
method.
boto3 documentation
# batch_detect_sentiment method definition
def batch_detect_sentiment(
self,
*,
TextList: Sequence[str],
LanguageCode: LanguageCodeType, # (1)
) -> BatchDetectSentimentResponseTypeDef: # (2)
...
# batch_detect_sentiment method usage example with argument unpacking
kwargs: BatchDetectSentimentRequestRequestTypeDef = { # (1)
"TextList": ...,
"LanguageCode": ...,
}
parent.batch_detect_sentiment(**kwargs)
batch_detect_syntax#
Inspects the text of a batch of documents for the syntax and part of speech of the words in the document and returns information about them.
Type annotations and code completion for boto3.client("comprehend").batch_detect_syntax
method.
boto3 documentation
# batch_detect_syntax method definition
def batch_detect_syntax(
self,
*,
TextList: Sequence[str],
LanguageCode: SyntaxLanguageCodeType, # (1)
) -> BatchDetectSyntaxResponseTypeDef: # (2)
...
# batch_detect_syntax method usage example with argument unpacking
kwargs: BatchDetectSyntaxRequestRequestTypeDef = { # (1)
"TextList": ...,
"LanguageCode": ...,
}
parent.batch_detect_syntax(**kwargs)
batch_detect_targeted_sentiment#
Inspects a batch of documents and returns a sentiment analysis for each entity identified in the documents.
Type annotations and code completion for boto3.client("comprehend").batch_detect_targeted_sentiment
method.
boto3 documentation
# batch_detect_targeted_sentiment method definition
def batch_detect_targeted_sentiment(
self,
*,
TextList: Sequence[str],
LanguageCode: LanguageCodeType, # (1)
) -> BatchDetectTargetedSentimentResponseTypeDef: # (2)
...
# batch_detect_targeted_sentiment method usage example with argument unpacking
kwargs: BatchDetectTargetedSentimentRequestRequestTypeDef = { # (1)
"TextList": ...,
"LanguageCode": ...,
}
parent.batch_detect_targeted_sentiment(**kwargs)
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("comprehend").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
classify_document#
Creates a classification request to analyze a single document in real-time.
Type annotations and code completion for boto3.client("comprehend").classify_document
method.
boto3 documentation
# classify_document method definition
def classify_document(
self,
*,
EndpointArn: str,
Text: str = ...,
Bytes: Union[str, bytes, IO[Any], StreamingBody] = ...,
DocumentReaderConfig: DocumentReaderConfigTypeDef = ..., # (1)
) -> ClassifyDocumentResponseTypeDef: # (2)
...
# classify_document method usage example with argument unpacking
kwargs: ClassifyDocumentRequestRequestTypeDef = { # (1)
"EndpointArn": ...,
}
parent.classify_document(**kwargs)
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("comprehend").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
contains_pii_entities#
Analyzes input text for the presence of personally identifiable information (PII) and returns the labels of identified PII entity types such as name, address, bank account number, or phone number.
Type annotations and code completion for boto3.client("comprehend").contains_pii_entities
method.
boto3 documentation
# contains_pii_entities method definition
def contains_pii_entities(
self,
*,
Text: str,
LanguageCode: LanguageCodeType, # (1)
) -> ContainsPiiEntitiesResponseTypeDef: # (2)
...
# contains_pii_entities method usage example with argument unpacking
kwargs: ContainsPiiEntitiesRequestRequestTypeDef = { # (1)
"Text": ...,
"LanguageCode": ...,
}
parent.contains_pii_entities(**kwargs)
create_dataset#
Creates a dataset to upload training or test data for a model associated with a flywheel.
Type annotations and code completion for boto3.client("comprehend").create_dataset
method.
boto3 documentation
# create_dataset method definition
def create_dataset(
self,
*,
FlywheelArn: str,
DatasetName: str,
InputDataConfig: DatasetInputDataConfigTypeDef, # (1)
DatasetType: DatasetTypeType = ..., # (2)
Description: str = ...,
ClientRequestToken: str = ...,
Tags: Sequence[TagTypeDef] = ..., # (3)
) -> CreateDatasetResponseTypeDef: # (4)
...
- See DatasetInputDataConfigTypeDef
- See DatasetTypeType
- See TagTypeDef
- See CreateDatasetResponseTypeDef
# create_dataset method usage example with argument unpacking
kwargs: CreateDatasetRequestRequestTypeDef = { # (1)
"FlywheelArn": ...,
"DatasetName": ...,
"InputDataConfig": ...,
}
parent.create_dataset(**kwargs)
create_document_classifier#
Creates a new document classifier that you can use to categorize documents.
Type annotations and code completion for boto3.client("comprehend").create_document_classifier
method.
boto3 documentation
# create_document_classifier method definition
def create_document_classifier(
self,
*,
DocumentClassifierName: str,
DataAccessRoleArn: str,
InputDataConfig: DocumentClassifierInputDataConfigTypeDef, # (1)
LanguageCode: LanguageCodeType, # (2)
VersionName: str = ...,
Tags: Sequence[TagTypeDef] = ..., # (3)
OutputDataConfig: DocumentClassifierOutputDataConfigTypeDef = ..., # (4)
ClientRequestToken: str = ...,
VolumeKmsKeyId: str = ...,
VpcConfig: VpcConfigTypeDef = ..., # (5)
Mode: DocumentClassifierModeType = ..., # (6)
ModelKmsKeyId: str = ...,
ModelPolicy: str = ...,
) -> CreateDocumentClassifierResponseTypeDef: # (7)
...
- See DocumentClassifierInputDataConfigTypeDef
- See LanguageCodeType
- See TagTypeDef
- See DocumentClassifierOutputDataConfigTypeDef
- See VpcConfigTypeDef
- See DocumentClassifierModeType
- See CreateDocumentClassifierResponseTypeDef
# create_document_classifier method usage example with argument unpacking
kwargs: CreateDocumentClassifierRequestRequestTypeDef = { # (1)
"DocumentClassifierName": ...,
"DataAccessRoleArn": ...,
"InputDataConfig": ...,
"LanguageCode": ...,
}
parent.create_document_classifier(**kwargs)
create_endpoint#
Creates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints.
Type annotations and code completion for boto3.client("comprehend").create_endpoint
method.
boto3 documentation
# create_endpoint method definition
def create_endpoint(
self,
*,
EndpointName: str,
DesiredInferenceUnits: int,
ModelArn: str = ...,
ClientRequestToken: str = ...,
Tags: Sequence[TagTypeDef] = ..., # (1)
DataAccessRoleArn: str = ...,
FlywheelArn: str = ...,
) -> CreateEndpointResponseTypeDef: # (2)
...
# create_endpoint method usage example with argument unpacking
kwargs: CreateEndpointRequestRequestTypeDef = { # (1)
"EndpointName": ...,
"DesiredInferenceUnits": ...,
}
parent.create_endpoint(**kwargs)
create_entity_recognizer#
Creates an entity recognizer using submitted files.
Type annotations and code completion for boto3.client("comprehend").create_entity_recognizer
method.
boto3 documentation
# create_entity_recognizer method definition
def create_entity_recognizer(
self,
*,
RecognizerName: str,
DataAccessRoleArn: str,
InputDataConfig: EntityRecognizerInputDataConfigTypeDef, # (1)
LanguageCode: LanguageCodeType, # (2)
VersionName: str = ...,
Tags: Sequence[TagTypeDef] = ..., # (3)
ClientRequestToken: str = ...,
VolumeKmsKeyId: str = ...,
VpcConfig: VpcConfigTypeDef = ..., # (4)
ModelKmsKeyId: str = ...,
ModelPolicy: str = ...,
) -> CreateEntityRecognizerResponseTypeDef: # (5)
...
- See EntityRecognizerInputDataConfigTypeDef
- See LanguageCodeType
- See TagTypeDef
- See VpcConfigTypeDef
- See CreateEntityRecognizerResponseTypeDef
# create_entity_recognizer method usage example with argument unpacking
kwargs: CreateEntityRecognizerRequestRequestTypeDef = { # (1)
"RecognizerName": ...,
"DataAccessRoleArn": ...,
"InputDataConfig": ...,
"LanguageCode": ...,
}
parent.create_entity_recognizer(**kwargs)
create_flywheel#
A flywheel is an Amazon Web Services resource that orchestrates the ongoing training of a model for custom classification or custom entity recognition.
Type annotations and code completion for boto3.client("comprehend").create_flywheel
method.