pub struct Builder { /* private fields */ }Expand description
A builder for EntityRecognizerInputDataConfig.
Implementations§
source§impl Builder
impl Builder
sourcepub fn data_format(self, input: EntityRecognizerDataFormat) -> Self
pub fn data_format(self, input: EntityRecognizerDataFormat) -> Self
The format of your training data:
-
COMPREHEND_CSV: A CSV file that supplements your training documents. The CSV file contains information about the custom entities that your trained model will detect. The required format of the file depends on whether you are providing annotations or an entity list.If you use this value, you must provide your CSV file by using either the
AnnotationsorEntityListparameters. You must provide your training documents by using theDocumentsparameter. -
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 labels. Each label annotates a named entity in the training document.If you use this value, you must provide the
AugmentedManifestsparameter 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<EntityRecognizerDataFormat>) -> Self
pub fn set_data_format(self, input: Option<EntityRecognizerDataFormat>) -> Self
The format of your training data:
-
COMPREHEND_CSV: A CSV file that supplements your training documents. The CSV file contains information about the custom entities that your trained model will detect. The required format of the file depends on whether you are providing annotations or an entity list.If you use this value, you must provide your CSV file by using either the
AnnotationsorEntityListparameters. You must provide your training documents by using theDocumentsparameter. -
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 labels. Each label annotates a named entity in the training document.If you use this value, you must provide the
AugmentedManifestsparameter in your request.
If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV as the default.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn entity_types(self, input: EntityTypesListItem) -> Self
pub fn entity_types(self, input: EntityTypesListItem) -> Self
Appends an item to entity_types.
To override the contents of this collection use set_entity_types.
The entity types in the labeled training data that Amazon Comprehend uses to train the custom entity recognizer. Any entity types that you don't specify are ignored.
A maximum of 25 entity types can be used at one time to train an entity recognizer. Entity types must not contain the following invalid characters: \n (line break), \\n (escaped line break), \r (carriage return), \\r (escaped carriage return), \t (tab), \\t (escaped tab), space, and , (comma).
sourcepub fn set_entity_types(self, input: Option<Vec<EntityTypesListItem>>) -> Self
pub fn set_entity_types(self, input: Option<Vec<EntityTypesListItem>>) -> Self
The entity types in the labeled training data that Amazon Comprehend uses to train the custom entity recognizer. Any entity types that you don't specify are ignored.
A maximum of 25 entity types can be used at one time to train an entity recognizer. Entity types must not contain the following invalid characters: \n (line break), \\n (escaped line break), \r (carriage return), \\r (escaped carriage return), \t (tab), \\t (escaped tab), space, and , (comma).
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn documents(self, input: EntityRecognizerDocuments) -> Self
pub fn documents(self, input: EntityRecognizerDocuments) -> Self
The S3 location of the folder that contains the training documents for your custom entity recognizer.
This parameter is required if you set DataFormat to COMPREHEND_CSV.
sourcepub fn set_documents(self, input: Option<EntityRecognizerDocuments>) -> Self
pub fn set_documents(self, input: Option<EntityRecognizerDocuments>) -> Self
The S3 location of the folder that contains the training documents for your custom entity recognizer.
This parameter is required if you set DataFormat to COMPREHEND_CSV.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn annotations(self, input: EntityRecognizerAnnotations) -> Self
pub fn annotations(self, input: EntityRecognizerAnnotations) -> Self
The S3 location of the CSV file that annotates your training documents.
sourcepub fn set_annotations(self, input: Option<EntityRecognizerAnnotations>) -> Self
pub fn set_annotations(self, input: Option<EntityRecognizerAnnotations>) -> Self
The S3 location of the CSV file that annotates your training documents.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn entity_list(self, input: EntityRecognizerEntityList) -> Self
pub fn entity_list(self, input: EntityRecognizerEntityList) -> Self
The S3 location of the CSV file that has the entity list for your custom entity recognizer.
sourcepub fn set_entity_list(self, input: Option<EntityRecognizerEntityList>) -> Self
pub fn set_entity_list(self, input: Option<EntityRecognizerEntityList>) -> Self
The S3 location of the CSV file that has the entity list for your custom entity recognizer.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}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.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}sourcepub fn build(self) -> EntityRecognizerInputDataConfig
pub fn build(self) -> EntityRecognizerInputDataConfig
Consumes the builder and constructs a EntityRecognizerInputDataConfig.
Examples found in repository?
8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843
pub(crate) fn deser_structure_crate_model_entity_recognizer_input_data_config<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::EntityRecognizerInputDataConfig>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::entity_recognizer_input_data_config::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"DataFormat" => {
builder = builder.set_data_format(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped().map(|u| {
crate::model::EntityRecognizerDataFormat::from(
u.as_ref(),
)
})
})
.transpose()?,
);
}
"EntityTypes" => {
builder = builder.set_entity_types(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_types_list(tokens)?
);
}
"Documents" => {
builder = builder.set_documents(
crate::json_deser::deser_structure_crate_model_entity_recognizer_documents(tokens)?
);
}
"Annotations" => {
builder = builder.set_annotations(
crate::json_deser::deser_structure_crate_model_entity_recognizer_annotations(tokens)?
);
}
"EntityList" => {
builder = builder.set_entity_list(
crate::json_deser::deser_structure_crate_model_entity_recognizer_entity_list(tokens)?
);
}
"AugmentedManifests" => {
builder = builder.set_augmented_manifests(
crate::json_deser::deser_list_com_amazonaws_comprehend_entity_recognizer_augmented_manifests_list(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}