aws_sdk_comprehend/client/
detect_entities.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`DetectEntities`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`text(impl Into<String>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::text) / [`set_text(Option<String>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::set_text):<br>required: **false**<br><p>A UTF-8 text string. The maximum string size is 100 KB. If you enter text using this parameter, do not use the <code>Bytes</code> parameter.</p><br>
7    ///   - [`language_code(LanguageCode)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::language_code) / [`set_language_code(Option<LanguageCode>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::set_language_code):<br>required: **false**<br><p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. If your request includes the endpoint for a custom entity recognition model, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you specify here.</p> <p>All input documents must be in the same language.</p><br>
8    ///   - [`endpoint_arn(impl Into<String>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::endpoint_arn) / [`set_endpoint_arn(Option<String>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::set_endpoint_arn):<br>required: **false**<br><p>The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model. Provide an endpoint if you want to detect entities by using your own custom model instead of the default model that is used by Amazon Comprehend.</p> <p>If you specify an endpoint, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you provide in your request.</p> <p>For information about endpoints, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/manage-endpoints.html">Managing endpoints</a>.</p><br>
9    ///   - [`bytes(Blob)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::bytes) / [`set_bytes(Option<Blob>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::set_bytes):<br>required: **false**<br><p>This field applies only when you use a custom entity recognition model that was trained with PDF annotations. For other cases, enter your text input in the <code>Text</code> field.</p> <p>Use the <code>Bytes</code> parameter to input a text, PDF, Word or image file. Using a plain-text file in the <code>Bytes</code> parameter is equivelent to using the <code>Text</code> parameter (the <code>Entities</code> field in the response is identical).</p> <p>You can also use the <code>Bytes</code> parameter to input an Amazon Textract <code>DetectDocumentText</code> or <code>AnalyzeDocument</code> output file.</p> <p>Provide the input document as a sequence of base64-encoded bytes. If your code uses an Amazon Web Services SDK to detect entities, the SDK may encode the document file bytes for you.</p> <p>The maximum length of this field depends on the input document type. For details, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html"> Inputs for real-time custom analysis</a> in the Comprehend Developer Guide.</p> <p>If you use the <code>Bytes</code> parameter, do not use the <code>Text</code> parameter.</p><br>
10    ///   - [`document_reader_config(DocumentReaderConfig)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::document_reader_config) / [`set_document_reader_config(Option<DocumentReaderConfig>)`](crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::set_document_reader_config):<br>required: **false**<br><p>Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.</p><br>
11    /// - On success, responds with [`DetectEntitiesOutput`](crate::operation::detect_entities::DetectEntitiesOutput) with field(s):
12    ///   - [`entities(Option<Vec::<Entity>>)`](crate::operation::detect_entities::DetectEntitiesOutput::entities): <p>A collection of entities identified in the input text. For each entity, the response provides the entity text, entity type, where the entity text begins and ends, and the level of confidence that Amazon Comprehend has in the detection.</p> <p>If your request uses a custom entity recognition model, Amazon Comprehend detects the entities that the model is trained to recognize. Otherwise, it detects the default entity types. For a list of default entity types, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/how-entities.html">Entities</a> in the Comprehend Developer Guide.</p>
13    ///   - [`document_metadata(Option<DocumentMetadata>)`](crate::operation::detect_entities::DetectEntitiesOutput::document_metadata): <p>Information about the document, discovered during text extraction. This field is present in the response only if your request used the <code>Byte</code> parameter.</p>
14    ///   - [`document_type(Option<Vec::<DocumentTypeListItem>>)`](crate::operation::detect_entities::DetectEntitiesOutput::document_type): <p>The document type for each page in the input document. This field is present in the response only if your request used the <code>Byte</code> parameter.</p>
15    ///   - [`blocks(Option<Vec::<Block>>)`](crate::operation::detect_entities::DetectEntitiesOutput::blocks): <p>Information about each block of text in the input document. Blocks are nested. A page block contains a block for each line of text, which contains a block for each word.</p> <p>The <code>Block</code> content for a Word input document does not include a <code>Geometry</code> field.</p> <p>The <code>Block</code> field is not present in the response for plain-text inputs.</p>
16    ///   - [`errors(Option<Vec::<ErrorsListItem>>)`](crate::operation::detect_entities::DetectEntitiesOutput::errors): <p>Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.</p>
17    /// - On failure, responds with [`SdkError<DetectEntitiesError>`](crate::operation::detect_entities::DetectEntitiesError)
18    pub fn detect_entities(&self) -> crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder {
19        crate::operation::detect_entities::builders::DetectEntitiesFluentBuilder::new(self.handle.clone())
20    }
21}