SageMaker.Client.
create_flow_definition
(**kwargs)¶Creates a flow definition.
See also: AWS API Documentation
Request Syntax
response = client.create_flow_definition(
FlowDefinitionName='string',
HumanLoopRequestSource={
'AwsManagedHumanLoopRequestSource': 'AWS/Rekognition/DetectModerationLabels/Image/V3'|'AWS/Textract/AnalyzeDocument/Forms/V1'
},
HumanLoopActivationConfig={
'HumanLoopActivationConditionsConfig': {
'HumanLoopActivationConditions': 'string'
}
},
HumanLoopConfig={
'WorkteamArn': 'string',
'HumanTaskUiArn': 'string',
'TaskTitle': 'string',
'TaskDescription': 'string',
'TaskCount': 123,
'TaskAvailabilityLifetimeInSeconds': 123,
'TaskTimeLimitInSeconds': 123,
'TaskKeywords': [
'string',
],
'PublicWorkforceTaskPrice': {
'AmountInUsd': {
'Dollars': 123,
'Cents': 123,
'TenthFractionsOfACent': 123
}
}
},
OutputConfig={
'S3OutputPath': 'string',
'KmsKeyId': 'string'
},
RoleArn='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name of your flow definition.
Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source.
Specifies whether Amazon Rekognition or Amazon Textract are used as the integration source. The default field settings and JSON parsing rules are different based on the integration source. Valid values:
An object containing information about the events that trigger a human workflow.
Container structure for defining under what conditions SageMaker creates a human loop.
JSON expressing use-case specific conditions declaratively. If any condition is matched, atomic tasks are created against the configured work team. The set of conditions is different for Rekognition and Textract. For more information about how to structure the JSON, see JSON Schema for Human Loop Activation Conditions in Amazon Augmented AI in the Amazon SageMaker Developer Guide .
[REQUIRED]
An object containing information about the tasks the human reviewers will perform.
Amazon Resource Name (ARN) of a team of workers. To learn more about the types of workforces and work teams you can create and use with Amazon A2I, see Create and Manage Workforces.
The Amazon Resource Name (ARN) of the human task user interface.
You can use standard HTML and Crowd HTML Elements to create a custom worker task template. You use this template to create a human task UI.
To learn how to create a custom HTML template, see Create Custom Worker Task Template.
To learn how to create a human task UI, which is a worker task template that can be used in a flow definition, see Create and Delete a Worker Task Templates.
A title for the human worker task.
A description for the human worker task.
The number of distinct workers who will perform the same task on each object. For example, if TaskCount
is set to 3
for an image classification labeling job, three workers will classify each input image. Increasing TaskCount
can improve label accuracy.
The length of time that a task remains available for review by human workers.
The amount of time that a worker has to complete a task. The default value is 3,600 seconds (1 hour).
Keywords used to describe the task so that workers can discover the task.
Defines the amount of money paid to an Amazon Mechanical Turk worker for each task performed.
Use one of the following prices for bounding box tasks. Prices are in US dollars and should be based on the complexity of the task; the longer it takes in your initial testing, the more you should offer.
Use one of the following prices for image classification, text classification, and custom tasks. Prices are in US dollars.
Use one of the following prices for semantic segmentation tasks. Prices are in US dollars.
Use one of the following prices for Textract AnalyzeDocument Important Form Key Amazon Augmented AI review tasks. Prices are in US dollars.
Use one of the following prices for Rekognition DetectModerationLabels Amazon Augmented AI review tasks. Prices are in US dollars.
Use one of the following prices for Amazon Augmented AI custom human review tasks. Prices are in US dollars.
Defines the amount of money paid to an Amazon Mechanical Turk worker in United States dollars.
The whole number of dollars in the amount.
The fractional portion, in cents, of the amount.
Fractions of a cent, in tenths.
[REQUIRED]
An object containing information about where the human review results will be uploaded.
The Amazon S3 path where the object containing human output will be made available.
To learn more about the format of Amazon A2I output data, see Amazon A2I Output Data.
The Amazon Key Management Service (KMS) key ID for server-side encryption.
[REQUIRED]
The Amazon Resource Name (ARN) of the role needed to call other services on your behalf. For example, arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298
.
An array of key-value pairs that contain metadata to help you categorize and organize a flow definition. Each tag consists of a key and a value, both of which you define.
A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.
You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.
For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.
The tag key. Tag keys must be unique per resource.
The tag value.
dict
Response Syntax
{
'FlowDefinitionArn': 'string'
}
Response Structure
(dict) --
FlowDefinitionArn (string) --
The Amazon Resource Name (ARN) of the flow definition you create.
Exceptions
SageMaker.Client.exceptions.ResourceLimitExceeded
SageMaker.Client.exceptions.ResourceInUse