pub struct Builder { /* private fields */ }
Expand description

Implementations§

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 Annotations or EntityList parameters. You must provide your training documents by using the Documents parameter.

  • 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 AugmentedManifests parameter in your request.

If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV as the default.

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 Annotations or EntityList parameters. You must provide your training documents by using the Documents parameter.

  • 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 AugmentedManifests parameter in your request.

If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV as the default.

Examples found in repository?
src/json_deser.rs (lines 8783-8795)
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",
            ),
        ),
    }
}

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).

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?
src/json_deser.rs (lines 8798-8800)
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",
            ),
        ),
    }
}

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.

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?
src/json_deser.rs (lines 8803-8805)
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",
            ),
        ),
    }
}

The S3 location of the CSV file that annotates your training documents.

The S3 location of the CSV file that annotates your training documents.

Examples found in repository?
src/json_deser.rs (lines 8808-8810)
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",
            ),
        ),
    }
}

The S3 location of the CSV file that has the entity list for your custom entity recognizer.

The S3 location of the CSV file that has the entity list for your custom entity recognizer.

Examples found in repository?
src/json_deser.rs (lines 8813-8815)
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",
            ),
        ),
    }
}

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.

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?
src/json_deser.rs (lines 8818-8820)
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",
            ),
        ),
    }
}

Consumes the builder and constructs a EntityRecognizerInputDataConfig.

Examples found in repository?
src/json_deser.rs (line 8835)
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",
            ),
        ),
    }
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more