/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.comprehend.model; import java.io.Serializable; /** *

* Specifies the format and location of the input data. *

*/ public class EntityRecognizerInputDataConfig implements Serializable { /** *

* The format of your training data: *

* *

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

*

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST */ private String dataFormat; /** *

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

*/ private java.util.List entityTypes; /** *

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

*/ private EntityRecognizerDocuments documents; /** *

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

*/ private EntityRecognizerAnnotations annotations; /** *

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

*/ private EntityRecognizerEntityList entityList; /** *

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

*/ private java.util.List augmentedManifests; /** *

* The format of your training data: *

* *

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

*

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST * * @return

* The format of your training data: *

* *

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

* @see EntityRecognizerDataFormat */ public String getDataFormat() { return dataFormat; } /** *

* The format of your training data: *

* *

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

*

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST * * @param dataFormat

* The format of your training data: *

* *

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

* @see EntityRecognizerDataFormat */ public void setDataFormat(String dataFormat) { this.dataFormat = dataFormat; } /** *

* The format of your training data: *

* *

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

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST * * @param dataFormat

* The format of your training data: *

* *

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

* @return A reference to this updated object so that method calls can be * chained together. * @see EntityRecognizerDataFormat */ public EntityRecognizerInputDataConfig withDataFormat(String dataFormat) { this.dataFormat = dataFormat; return this; } /** *

* The format of your training data: *

* *

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

*

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST * * @param dataFormat

* The format of your training data: *

* *

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

* @see EntityRecognizerDataFormat */ public void setDataFormat(EntityRecognizerDataFormat dataFormat) { this.dataFormat = dataFormat.toString(); } /** *

* The format of your training data: *

* *

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

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: COMPREHEND_CSV, AUGMENTED_MANIFEST * * @param dataFormat

* The format of your training data: *

* *

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

* @return A reference to this updated object so that method calls can be * chained together. * @see EntityRecognizerDataFormat */ public EntityRecognizerInputDataConfig withDataFormat(EntityRecognizerDataFormat dataFormat) { this.dataFormat = dataFormat.toString(); return this; } /** *

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

* * @return

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

*/ public java.util.List getEntityTypes() { return entityTypes; } /** *

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

* * @param entityTypes

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

*/ public void setEntityTypes(java.util.Collection entityTypes) { if (entityTypes == null) { this.entityTypes = null; return; } this.entityTypes = new java.util.ArrayList(entityTypes); } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param entityTypes

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withEntityTypes(EntityTypesListItem... entityTypes) { if (getEntityTypes() == null) { this.entityTypes = new java.util.ArrayList(entityTypes.length); } for (EntityTypesListItem value : entityTypes) { this.entityTypes.add(value); } return this; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param entityTypes

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withEntityTypes( java.util.Collection entityTypes) { setEntityTypes(entityTypes); return this; } /** *

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

* * @return

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

*/ public EntityRecognizerDocuments getDocuments() { return documents; } /** *

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

* * @param documents

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

*/ public void setDocuments(EntityRecognizerDocuments documents) { this.documents = documents; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param documents

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withDocuments(EntityRecognizerDocuments documents) { this.documents = documents; return this; } /** *

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

* * @return

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

*/ public EntityRecognizerAnnotations getAnnotations() { return annotations; } /** *

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

* * @param annotations

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

*/ public void setAnnotations(EntityRecognizerAnnotations annotations) { this.annotations = annotations; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param annotations

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withAnnotations(EntityRecognizerAnnotations annotations) { this.annotations = annotations; return this; } /** *

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

* * @return

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

*/ public EntityRecognizerEntityList getEntityList() { return entityList; } /** *

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

* * @param entityList

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

*/ public void setEntityList(EntityRecognizerEntityList entityList) { this.entityList = entityList; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param entityList

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withEntityList(EntityRecognizerEntityList entityList) { this.entityList = entityList; return this; } /** *

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

* * @return

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

*/ public java.util.List getAugmentedManifests() { return augmentedManifests; } /** *

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

* * @param augmentedManifests

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

*/ public void setAugmentedManifests( java.util.Collection augmentedManifests) { if (augmentedManifests == null) { this.augmentedManifests = null; return; } this.augmentedManifests = new java.util.ArrayList( augmentedManifests); } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param augmentedManifests

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withAugmentedManifests( AugmentedManifestsListItem... augmentedManifests) { if (getAugmentedManifests() == null) { this.augmentedManifests = new java.util.ArrayList( augmentedManifests.length); } for (AugmentedManifestsListItem value : augmentedManifests) { this.augmentedManifests.add(value); } return this; } /** *

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

*

* Returns a reference to this object so that method calls can be chained * together. * * @param augmentedManifests

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

* @return A reference to this updated object so that method calls can be * chained together. */ public EntityRecognizerInputDataConfig withAugmentedManifests( java.util.Collection augmentedManifests) { setAugmentedManifests(augmentedManifests); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDataFormat() != null) sb.append("DataFormat: " + getDataFormat() + ","); if (getEntityTypes() != null) sb.append("EntityTypes: " + getEntityTypes() + ","); if (getDocuments() != null) sb.append("Documents: " + getDocuments() + ","); if (getAnnotations() != null) sb.append("Annotations: " + getAnnotations() + ","); if (getEntityList() != null) sb.append("EntityList: " + getEntityList() + ","); if (getAugmentedManifests() != null) sb.append("AugmentedManifests: " + getAugmentedManifests()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDataFormat() == null) ? 0 : getDataFormat().hashCode()); hashCode = prime * hashCode + ((getEntityTypes() == null) ? 0 : getEntityTypes().hashCode()); hashCode = prime * hashCode + ((getDocuments() == null) ? 0 : getDocuments().hashCode()); hashCode = prime * hashCode + ((getAnnotations() == null) ? 0 : getAnnotations().hashCode()); hashCode = prime * hashCode + ((getEntityList() == null) ? 0 : getEntityList().hashCode()); hashCode = prime * hashCode + ((getAugmentedManifests() == null) ? 0 : getAugmentedManifests().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EntityRecognizerInputDataConfig == false) return false; EntityRecognizerInputDataConfig other = (EntityRecognizerInputDataConfig) obj; if (other.getDataFormat() == null ^ this.getDataFormat() == null) return false; if (other.getDataFormat() != null && other.getDataFormat().equals(this.getDataFormat()) == false) return false; if (other.getEntityTypes() == null ^ this.getEntityTypes() == null) return false; if (other.getEntityTypes() != null && other.getEntityTypes().equals(this.getEntityTypes()) == false) return false; if (other.getDocuments() == null ^ this.getDocuments() == null) return false; if (other.getDocuments() != null && other.getDocuments().equals(this.getDocuments()) == false) return false; if (other.getAnnotations() == null ^ this.getAnnotations() == null) return false; if (other.getAnnotations() != null && other.getAnnotations().equals(this.getAnnotations()) == false) return false; if (other.getEntityList() == null ^ this.getEntityList() == null) return false; if (other.getEntityList() != null && other.getEntityList().equals(this.getEntityList()) == false) return false; if (other.getAugmentedManifests() == null ^ this.getAugmentedManifests() == null) return false; if (other.getAugmentedManifests() != null && other.getAugmentedManifests().equals(this.getAugmentedManifests()) == false) return false; return true; } }