#[non_exhaustive]pub struct DocumentClassifierInputDataConfigBuilder { /* private fields */ }
Expand description
A builder for DocumentClassifierInputDataConfig
.
Implementations§
Source§impl DocumentClassifierInputDataConfigBuilder
impl DocumentClassifierInputDataConfigBuilder
Sourcepub fn data_format(self, input: DocumentClassifierDataFormat) -> Self
pub fn data_format(self, input: DocumentClassifierDataFormat) -> Self
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 set_data_format(
self,
input: Option<DocumentClassifierDataFormat>,
) -> Self
pub fn set_data_format( self, input: Option<DocumentClassifierDataFormat>, ) -> Self
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 get_data_format(&self) -> &Option<DocumentClassifierDataFormat>
pub fn get_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, input: impl Into<String>) -> Self
pub fn s3_uri(self, input: impl Into<String>) -> Self
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 set_s3_uri(self, input: Option<String>) -> Self
pub fn set_s3_uri(self, input: Option<String>) -> Self
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 get_s3_uri(&self) -> &Option<String>
pub fn get_s3_uri(&self) -> &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
.
Sourcepub fn test_s3_uri(self, input: impl Into<String>) -> Self
pub fn test_s3_uri(self, input: impl Into<String>) -> Self
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 set_test_s3_uri(self, input: Option<String>) -> Self
pub fn set_test_s3_uri(self, input: Option<String>) -> Self
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 get_test_s3_uri(&self) -> &Option<String>
pub fn get_test_s3_uri(&self) -> &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.
Sourcepub fn label_delimiter(self, input: impl Into<String>) -> Self
pub fn label_delimiter(self, input: impl Into<String>) -> Self
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 set_label_delimiter(self, input: Option<String>) -> Self
pub fn set_label_delimiter(self, input: Option<String>) -> Self
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 get_label_delimiter(&self) -> &Option<String>
pub fn get_label_delimiter(&self) -> &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.
Sourcepub fn augmented_manifests(self, input: AugmentedManifestsListItem) -> Self
pub fn augmented_manifests(self, input: AugmentedManifestsListItem) -> Self
Appends an item to augmented_manifests
.
To override the contents of this collection use set_augmented_manifests
.
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
.
Sourcepub fn set_augmented_manifests(
self,
input: Option<Vec<AugmentedManifestsListItem>>,
) -> Self
pub fn set_augmented_manifests( self, input: Option<Vec<AugmentedManifestsListItem>>, ) -> Self
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
.
Sourcepub fn get_augmented_manifests(
&self,
) -> &Option<Vec<AugmentedManifestsListItem>>
pub fn get_augmented_manifests( &self, ) -> &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
.
Sourcepub fn document_type(self, input: DocumentClassifierDocumentTypeFormat) -> Self
pub fn document_type(self, input: DocumentClassifierDocumentTypeFormat) -> Self
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 set_document_type(
self,
input: Option<DocumentClassifierDocumentTypeFormat>,
) -> Self
pub fn set_document_type( self, input: Option<DocumentClassifierDocumentTypeFormat>, ) -> Self
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 get_document_type(&self) -> &Option<DocumentClassifierDocumentTypeFormat>
pub fn get_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, input: DocumentClassifierDocuments) -> Self
pub fn documents(self, input: DocumentClassifierDocuments) -> Self
The S3 location of the training documents. This parameter is required in a request to create a native document model.
Sourcepub fn set_documents(self, input: Option<DocumentClassifierDocuments>) -> Self
pub fn set_documents(self, input: Option<DocumentClassifierDocuments>) -> Self
The S3 location of the training documents. This parameter is required in a request to create a native document model.
Sourcepub fn get_documents(&self) -> &Option<DocumentClassifierDocuments>
pub fn get_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, input: DocumentReaderConfig) -> Self
pub fn document_reader_config(self, input: DocumentReaderConfig) -> Self
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.
Sourcepub fn set_document_reader_config(
self,
input: Option<DocumentReaderConfig>,
) -> Self
pub fn set_document_reader_config( self, input: Option<DocumentReaderConfig>, ) -> Self
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.
Sourcepub fn get_document_reader_config(&self) -> &Option<DocumentReaderConfig>
pub fn get_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.
Sourcepub fn build(self) -> DocumentClassifierInputDataConfig
pub fn build(self) -> DocumentClassifierInputDataConfig
Consumes the builder and constructs a DocumentClassifierInputDataConfig
.
Trait Implementations§
Source§impl Clone for DocumentClassifierInputDataConfigBuilder
impl Clone for DocumentClassifierInputDataConfigBuilder
Source§fn clone(&self) -> DocumentClassifierInputDataConfigBuilder
fn clone(&self) -> DocumentClassifierInputDataConfigBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for DocumentClassifierInputDataConfigBuilder
impl Default for DocumentClassifierInputDataConfigBuilder
Source§fn default() -> DocumentClassifierInputDataConfigBuilder
fn default() -> DocumentClassifierInputDataConfigBuilder
Source§impl PartialEq for DocumentClassifierInputDataConfigBuilder
impl PartialEq for DocumentClassifierInputDataConfigBuilder
Source§fn eq(&self, other: &DocumentClassifierInputDataConfigBuilder) -> bool
fn eq(&self, other: &DocumentClassifierInputDataConfigBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for DocumentClassifierInputDataConfigBuilder
Auto Trait Implementations§
impl Freeze for DocumentClassifierInputDataConfigBuilder
impl RefUnwindSafe for DocumentClassifierInputDataConfigBuilder
impl Send for DocumentClassifierInputDataConfigBuilder
impl Sync for DocumentClassifierInputDataConfigBuilder
impl Unpin for DocumentClassifierInputDataConfigBuilder
impl UnwindSafe for DocumentClassifierInputDataConfigBuilder
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);