# Amazon SageMaker

**Supported Labeling Types**: `Row labeling`

Integrate your Amazon SageMaker Inference Endpoint effortlessly with Datasaur. Utilize Datasaur's **ML-assisted labeling** to access and leverage your deployed Amazon SageMaker Inference Endpoint for data labeling.

## Setup Datasaur ML Assisted Extension

{% hint style="info" %}
Please ensure you have access to our **ML-assisted labeling** extension with Amazon SageMaker as a provider.
{% endhint %}

1. [Create a custom project ](https://datasaurai.gitbook.io/datasaur/nlp-projects/creating-a-project)for row labeling
2. Click the gear icon from the extension panel to open the **Manage extensions** dialog.
3. Enable the **ML-assisted labeling** extension.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-3c0e599e2460cff3423a2d0626a5afe6ab29cbe4%2FExtension%20-%20Manage%20extensions%20-%20ML-assisted%20Labeling.png?alt=media" alt="Image of Manage Extension Pop Up to enable ML assisted"><figcaption><p>Manage Extension Pop Up</p></figcaption></figure>

4. **ML-assisted labeling** is now enabled. Select Amazon SageMaker as the provider.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-4ca4957e4859295dad4eddb61775e4dd7e65a744%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Amazon%20Sagemaker%20-%20highlight.png?alt=media" alt="Image of ML Assisted with Amazon SageMaker"><figcaption><p><strong>ML-assisted labeling</strong> with Amazon SageMaker</p></figcaption></figure>

## Setup Role in AWS Identity and Access Management (IAM)

Before we start to create Role in the **IAM** page, please create these policies first for your permissions when creating a new Role.

1. Go to your **IAM** page, navigate to the **Policies** section, and then create a new policy.
2. You can download the examples below.

{% file src="<https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-d2df20edd17218445b0bdd98fe350526fe256364%2Fsagemaker-s3-specific-permissions.txt?alt=media&token=0a0e8d85-95bb-47b7-b8bf-6774798e1698>" %}

Now you can continue to create a new Role with the policy.

1. Go to the **IAM** page and navigate to the **Roles** section
2. Click on **Create Roles** then select **AWS account** as the role type and insert the **Account ID** and **External ID**. These values are automatically generated within the **ML-assisted labeling** extension and can be copied and pasted into the AWS platform.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-0d95e349ac64c7df52a075da576ae7f9887f6d00%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Amazon%20SageMaker%20-%20select%20trusted%20entity.png?alt=media" alt="Image of Select trusted entity menu"><figcaption><p>Select trusted entity</p></figcaption></figure>

3. On the **Add permissions** step, search the policy you created before. Add them to the permissions.
4. Provide a role name and click **Create role** and you can check the trusted policies config below

{% file src="<https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-4be0d0b71fada1d2472004eba5c75455cc487b18%2Ftrust-policies.txt?alt=media&token=2ca7edcb-a8da-479f-99fb-fa8a453408b6>" %}

5. The role will be created successfully.
6. View your role and copy the Role ARN.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-2e77b11e33fb695f1ee49cb8899c84093da388ff%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Amazon%20SageMaker%20-%20identity%20and%20access%20management.png?alt=media" alt="Image of Role page to copy role ARN"><figcaption></figcaption></figure>

7. Paste this information into the **ML-assisted labeling** extension.
8. Navigate to the Amazon SageMaker page and retrieve the Endpoint ARN. Copy the obtained Endpoint ARN and paste it into the extension.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-fa5230e952a8f63b05527de09e29cd1029e5444b%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Amazon%20SageMaker%20-%20endpoint%20details.png?alt=media" alt="Image of Endpoint Details"><figcaption><p>Endpoint details</p></figcaption></figure>

## Start Prediction

After setting up the above options, simply click **Predict labels** to start predicting and obtaining labels from your Amazon SageMaker endpoint.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-8fb8dc1b64532bdb3e459fcc06b37671cb5fbd17%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Amazon%20SageMaker%20-%20project.png?alt=media" alt="Image of Prediction result"><figcaption><p>Prediction appears</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/amazon-sagemaker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
