#[non_exhaustive]pub struct DocumentClassifierInputDataConfig {
pub data_format: Option<DocumentClassifierDataFormat>,
pub s3_uri: Option<String>,
pub test_s3_uri: Option<String>,
pub label_delimiter: Option<String>,
pub augmented_manifests: Option<Vec<AugmentedManifestsListItem>>,
pub document_type: Option<DocumentClassifierDocumentTypeFormat>,
pub documents: Option<DocumentClassifierDocuments>,
pub document_reader_config: Option<DocumentReaderConfig>,
}
Expand description
The input properties for training a document classifier.
For more information on how the input file is formatted, see Preparing training data 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.data_format: Option<DocumentClassifierDataFormat>
The format of your training data:
-
COMPREHEND_CSV
: A two-column CSV file, where labels are provided in the first column, and documents are provided in the second. If you use this value, you must provide theS3Uri
parameter in your request. -
AUGMENTED_MANIFEST
: A labeled dataset that is produced by Amazon SageMaker Ground Truth. This file is in JSON lines format. Each line is a complete JSON object that contains a training document and its associated labels.If you use this value, you must provide the
AugmentedManifests
parameter in your request.
If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV
as the default.
s3_uri: Option<String>
The Amazon S3 URI for the input data. The S3 bucket must be in the same Region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of input files.
For example, if you use the URI S3://bucketName/prefix
, if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.
This parameter is required if you set DataFormat
to COMPREHEND_CSV
.
test_s3_uri: Option<String>
This specifies the Amazon S3 location that contains the test annotations for the document classifier. The URI must be in the same Amazon Web Services Region as the API endpoint that you are calling.
label_delimiter: Option<String>
Indicates the delimiter used to separate each label for training a multi-label classifier. The default delimiter between labels is a pipe (|). You can use a different character as a delimiter (if it's an allowed character) by specifying it under Delimiter for labels. If the training documents use a delimiter other than the default or the delimiter you specify, the labels on that line will be combined to make a single unique label, such as LABELLABELLABEL.
augmented_manifests: Option<Vec<AugmentedManifestsListItem>>
A list of augmented manifest files that provide training data for your custom model. An augmented manifest file is a labeled dataset that is produced by Amazon SageMaker Ground Truth.
This parameter is required if you set DataFormat
to AUGMENTED_MANIFEST
.
document_type: Option<DocumentClassifierDocumentTypeFormat>
The type of input documents for training the model. Provide plain-text documents to create a plain-text model, and provide semi-structured documents to create a native document model.
documents: Option<DocumentClassifierDocuments>
The S3 location of the training documents. This parameter is required in a request to create a native document model.
document_reader_config: Option<DocumentReaderConfig>
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.
Implementations§
Source§impl DocumentClassifierInputDataConfig
impl DocumentClassifierInputDataConfig
Sourcepub fn data_format(&self) -> Option<&DocumentClassifierDataFormat>
pub fn data_format(&self) -> Option<&DocumentClassifierDataFormat>
The format of your training data:
-
COMPREHEND_CSV
: A two-column CSV file, where labels are provided in the first column, and documents are provided in the second. If you use this value, you must provide theS3Uri
parameter in your request. -
AUGMENTED_MANIFEST
: A labeled dataset that is produced by Amazon SageMaker Ground Truth. This file is in JSON lines format. Each line is a complete JSON object that contains a training document and its associated labels.If you use this value, you must provide the
AugmentedManifests
parameter in your request.
If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV
as the default.
Sourcepub fn s3_uri(&self) -> Option<&str>
pub fn s3_uri(&self) -> Option<&str>
The Amazon S3 URI for the input data. The S3 bucket must be in the same Region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of input files.
For example, if you use the URI S3://bucketName/prefix
, if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.
This parameter is required if you set DataFormat
to COMPREHEND_CSV
.
Sourcepub fn test_s3_uri(&self) -> Option<&str>
pub fn test_s3_uri(&self) -> Option<&str>
This specifies the Amazon S3 location that contains the test annotations for the document classifier. The URI must be in the same Amazon Web Services Region as the API endpoint that you are calling.
Sourcepub fn label_delimiter(&self) -> Option<&str>
pub fn label_delimiter(&self) -> Option<&str>
Indicates the delimiter used to separate each label for training a multi-label classifier. The default delimiter between labels is a pipe (|). You can use a different character as a delimiter (if it's an allowed character) by specifying it under Delimiter for labels. If the training documents use a delimiter other than the default or the delimiter you specify, the labels on that line will be combined to make a single unique label, such as LABELLABELLABEL.
Sourcepub fn augmented_manifests(&self) -> &[AugmentedManifestsListItem]
pub fn augmented_manifests(&self) -> &[AugmentedManifestsListItem]
A list of augmented manifest files that provide training data for your custom model. An augmented manifest file is a labeled dataset that is produced by Amazon SageMaker Ground Truth.
This parameter is required if you set DataFormat
to AUGMENTED_MANIFEST
.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .augmented_manifests.is_none()
.
Sourcepub fn document_type(&self) -> Option<&DocumentClassifierDocumentTypeFormat>
pub fn document_type(&self) -> Option<&DocumentClassifierDocumentTypeFormat>
The type of input documents for training the model. Provide plain-text documents to create a plain-text model, and provide semi-structured documents to create a native document model.
Sourcepub fn documents(&self) -> Option<&DocumentClassifierDocuments>
pub fn documents(&self) -> Option<&DocumentClassifierDocuments>
The S3 location of the training documents. This parameter is required in a request to create a native document model.
Sourcepub fn document_reader_config(&self) -> Option<&DocumentReaderConfig>
pub fn document_reader_config(&self) -> Option<&DocumentReaderConfig>
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.
Source§impl DocumentClassifierInputDataConfig
impl DocumentClassifierInputDataConfig
Sourcepub fn builder() -> DocumentClassifierInputDataConfigBuilder
pub fn builder() -> DocumentClassifierInputDataConfigBuilder
Creates a new builder-style object to manufacture DocumentClassifierInputDataConfig
.
Trait Implementations§
Source§impl Clone for DocumentClassifierInputDataConfig
impl Clone for DocumentClassifierInputDataConfig
Source§fn clone(&self) -> DocumentClassifierInputDataConfig
fn clone(&self) -> DocumentClassifierInputDataConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl PartialEq for DocumentClassifierInputDataConfig
impl PartialEq for DocumentClassifierInputDataConfig
Source§fn eq(&self, other: &DocumentClassifierInputDataConfig) -> bool
fn eq(&self, other: &DocumentClassifierInputDataConfig) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for DocumentClassifierInputDataConfig
Auto Trait Implementations§
impl Freeze for DocumentClassifierInputDataConfig
impl RefUnwindSafe for DocumentClassifierInputDataConfig
impl Send for DocumentClassifierInputDataConfig
impl Sync for DocumentClassifierInputDataConfig
impl Unpin for DocumentClassifierInputDataConfig
impl UnwindSafe for DocumentClassifierInputDataConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);