By using AWS re:Post, you agree to the Terms of Use
/Amazon SageMaker Ground Truth/

Questions tagged with Amazon SageMaker Ground Truth

Sort by most recent
  • 1
  • 90 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Trying Sagemaker example but getting error: AttributeError: module 'sagemaker' has no attribute 'create_transform_job'

Hi, I keep getting this error: AttributeError: module 'sagemaker' has no attribute 'create_transform_job', when using a batch transform example that AWS graciously had in the notebook instances. Code: ***Also, I updated Sagemaker to the newest package and its still not working. ``` %%time import time from time import gmtime, strftime batch_job_name = "Batch-Transform-" + strftime("%Y-%m-%d-%H-%M-%S", gmtime()) input_location = "s3://{}/{}/batch/{}".format( bucket, prefix, batch_file ) # use input data without ID column output_location = "s3://{}/{}/output/{}".format(bucket, prefix, batch_job_name) request = { "TransformJobName": batch_job_name, "ModelName": 'xgboost-parquet-example-training-2022-03-28-16-02-31-model', "TransformOutput": { "S3OutputPath": output_location, "Accept": "text/csv", "AssembleWith": "Line", }, "TransformInput": { "DataSource": {"S3DataSource": {"S3DataType": "S3Prefix", "S3Uri": input_location}}, "ContentType": "text/csv", "SplitType": "Line", "CompressionType": "None", }, "TransformResources": {"InstanceType": "ml.m4.xlarge", "InstanceCount": 1}, } sagemaker.create_transform_job(**request) print("Created Transform job with name: ", batch_job_name) # Wait until the job finishes try: sagemaker.get_waiter("transform_job_completed_or_stopped").wait(TransformJobName=batch_job_name) finally: response = sagemaker.describe_transform_job(TransformJobName=batch_job_name) status = response["TransformJobStatus"] print("Transform job ended with status: " + status) if status == "Failed": message = response["FailureReason"] print("Transform failed with the following error: {}".format(message)) raise Exception("Transform job failed") ``` Everything else is working well. I've had no luck with this on anyother forum.
1
answers
0
votes
10
views
asked 2 months ago

Use crowd-textract-analyze-document with start_human_loop

I'm trying to use the crowd-textract-analyze-document widget on a custom task with sagemaker. The problem is call the human loop from "start_human_loop" function not from analyze_document. The human loop tasks is not rendered, the error can be reproduced using "render_ui_template" function `response = sagemaker_client.render_ui_template( UiTemplate={"Content": template_content}, Task={"Input": input_json}, RoleArn=role, ) ` I'm using the default template from the documentation. https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-crowd-textract-detection.html With the minimal ranges to read the data from task.input, so I assume than the error is on the input data. The error raised is > crowd-html-elements-without-ce-polyfill.js:689 Uncaught TypeError: Cannot read properties of undefined (reading 'text') The entire json used is this one that includes the "text" attribute, so I don't have any idea of why means the error: ``` { "TaskObject": "s3://foo_bar/foo_bar.pdf", "Keys": [ { "importantFormKey": "Foo bar" } ], "Blocks": [ { "blockType": "KEY_VALUE_SET", "confidence": 93.0, "geometry": { "boundingBox": { "width": 0.09730120003223419, "height": 0.009636270813643932, "left": 0.5012893676757812, "top": 0.3701384961605072 }, "polygon": [ { "x": 0.5012893676757812, "y": 0.3701384961605072 }, { "x": 0.5985905528068542, "y": 0.3701384961605072 }, { "x": 0.5985905528068542, "y": 0.3797747790813446 }, { "x": 0.5012893676757812, "y": 0.3797747790813446 } ] }, "id": "6231be31-5f56-41db-95cf-2dad8f765cca", "relationships": [ { "type": "VALUE", "ids": [ "b7697bbd-c5f5-4d28-a345-92c1f53daef7" ] }, { "type": "CHILD", "ids": [ "57c87916-0636-4d51-8d3b-8d15f4e93d73", "f38b7a0f-2750-46e0-960f-8d6b58dcab3d" ] } ], "entityTypes": [ "KEY" ], "text": "Foo bar", "page": 1 }, { "blockType": "KEY_VALUE_SET", "confidence": 93.0, "geometry": { "boundingBox": { "width": 0.2203546017408371, "height": 0.019548991695046425, "left": 0.6025875210762024, "top": 0.3636907935142517 }, "polygon": [ { "x": 0.6025875210762024, "y": 0.3636907935142517 }, { "x": 0.8229421377182007, "y": 0.3636907935142517 }, { "x": 0.8229421377182007, "y": 0.3832397758960724 }, { "x": 0.6025875210762024, "y": 0.3832397758960724 } ] }, "id": "b7697bbd-c5f5-4d28-a345-92c1f53daef7", "relationships": [ { "type": "CHILD", "ids": [ "d803e2ba-c238-4af1-8745-0dbb17e74420" ] } ], "entityTypes": [ "VALUE" ], "text": "Foo bar", "page": 1 } ] } ```
0
answers
0
votes
3
views
asked 4 months ago

GroundTruth text labelling - hide data columns, and methods of quality control

I have a csv of sentences which I'd like labelled, and have identified GroundTruth labelling jobs as a way to do this. Having spent some time exploring the service, I have some questions: **1) **I can't find a way to display only particular columns to the labellers - e.g. if the dataset has a column of IDs for each sentence, this ideally shouldn't be shown to labellers **2)** There is either single labelling or multi labelling, but I would like a way to have two sets of single-selection labels, where one captures difficulty of assigning the label: Select one for binary classification a) Yes, b) No Select one for difficulty of classification c) Easy, d) Medium, e) Hard Can this be done using custom HTML? Is there a guide to writing this - the template it gives you doesn't seem to render as-is. **3)** There appears to be a maximum of $1.20 payment per task. Is this the case, and why? **4)** Having not used mechanical turk before, are there ways of ensuring people take the work seriously and don't just select random answers? I can see there's an option to have x number of people answer the same question, but is there also a way to put in unambiguous questions to which we already have a 'pre_agreed_label' every nth question, and remove people from the task if they get them wrong? Thanks!
0
answers
1
votes
6
views
asked 5 months ago
  • 1
  • 90 / page