Struct aws_sdk_comprehend::types::DocumentReaderConfig
source · #[non_exhaustive]pub struct DocumentReaderConfig {
pub document_read_action: DocumentReadAction,
pub document_read_mode: Option<DocumentReadMode>,
pub feature_types: Option<Vec<DocumentReadFeatureTypes>>,
}
Expand description
Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.
By default, Amazon Comprehend performs the following actions to extract text from files, based on the input file type:
-
Word files - Amazon Comprehend parser extracts the text.
-
Digital PDF files - Amazon Comprehend parser extracts the text.
-
Image files and scanned PDF files - Amazon Comprehend uses the Amazon Textract
DetectDocumentText
API to extract the text.
DocumentReaderConfig
does not apply to plain text files or Word files.
For image files and PDF documents, you can override these default actions using the fields listed below. For more information, see Setting text extraction options in the Comprehend Developer Guide.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.document_read_action: DocumentReadAction
This field defines the Amazon Textract API operation that Amazon Comprehend uses to extract text from PDF files and image files. Enter one of the following values:
-
TEXTRACT_DETECT_DOCUMENT_TEXT
- The Amazon Comprehend service uses theDetectDocumentText
API operation. -
TEXTRACT_ANALYZE_DOCUMENT
- The Amazon Comprehend service uses theAnalyzeDocument
API operation.
document_read_mode: Option<DocumentReadMode>
Determines the text extraction actions for PDF files. Enter one of the following values:
-
SERVICE_DEFAULT
- use the Amazon Comprehend service defaults for PDF files. -
FORCE_DOCUMENT_READ_ACTION
- Amazon Comprehend uses the Textract API specified by DocumentReadAction for all PDF files, including digital PDF files.
feature_types: Option<Vec<DocumentReadFeatureTypes>>
Specifies the type of Amazon Textract features to apply. If you chose TEXTRACT_ANALYZE_DOCUMENT
as the read action, you must specify one or both of the following values:
-
TABLES
- Returns additional information about any tables that are detected in the input document. -
FORMS
- Returns additional information about any forms that are detected in the input document.
Implementations§
source§impl DocumentReaderConfig
impl DocumentReaderConfig
sourcepub fn document_read_action(&self) -> &DocumentReadAction
pub fn document_read_action(&self) -> &DocumentReadAction
This field defines the Amazon Textract API operation that Amazon Comprehend uses to extract text from PDF files and image files. Enter one of the following values:
-
TEXTRACT_DETECT_DOCUMENT_TEXT
- The Amazon Comprehend service uses theDetectDocumentText
API operation. -
TEXTRACT_ANALYZE_DOCUMENT
- The Amazon Comprehend service uses theAnalyzeDocument
API operation.
sourcepub fn document_read_mode(&self) -> Option<&DocumentReadMode>
pub fn document_read_mode(&self) -> Option<&DocumentReadMode>
Determines the text extraction actions for PDF files. Enter one of the following values:
-
SERVICE_DEFAULT
- use the Amazon Comprehend service defaults for PDF files. -
FORCE_DOCUMENT_READ_ACTION
- Amazon Comprehend uses the Textract API specified by DocumentReadAction for all PDF files, including digital PDF files.
sourcepub fn feature_types(&self) -> &[DocumentReadFeatureTypes]
pub fn feature_types(&self) -> &[DocumentReadFeatureTypes]
Specifies the type of Amazon Textract features to apply. If you chose TEXTRACT_ANALYZE_DOCUMENT
as the read action, you must specify one or both of the following values:
-
TABLES
- Returns additional information about any tables that are detected in the input document. -
FORMS
- Returns additional information about any forms that are detected in the input document.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .feature_types.is_none()
.
source§impl DocumentReaderConfig
impl DocumentReaderConfig
sourcepub fn builder() -> DocumentReaderConfigBuilder
pub fn builder() -> DocumentReaderConfigBuilder
Creates a new builder-style object to manufacture DocumentReaderConfig
.
Trait Implementations§
source§impl Clone for DocumentReaderConfig
impl Clone for DocumentReaderConfig
source§fn clone(&self) -> DocumentReaderConfig
fn clone(&self) -> DocumentReaderConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DocumentReaderConfig
impl Debug for DocumentReaderConfig
source§impl PartialEq for DocumentReaderConfig
impl PartialEq for DocumentReaderConfig
source§fn eq(&self, other: &DocumentReaderConfig) -> bool
fn eq(&self, other: &DocumentReaderConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for DocumentReaderConfig
Auto Trait Implementations§
impl Freeze for DocumentReaderConfig
impl RefUnwindSafe for DocumentReaderConfig
impl Send for DocumentReaderConfig
impl Sync for DocumentReaderConfig
impl Unpin for DocumentReaderConfig
impl UnwindSafe for DocumentReaderConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more