> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/amazon-comprehend.md).

# Amazon Comprehend

{% hint style="info" %}
**Supported labeling types**: Row labeling.
{% endhint %}

**ML-assisted labeling** supports models from Amazon Comprehend. If you already have data and training pipelines in Amazon Comprehend, you can utilize your trained model to enhance the performance.

## Enable ML-assisted labeling extension

1. [Create a custom project](/data-studio-projects/creating-a-project.md) for row labeling.
2. Click the gear icon in the extension panel on the right to open the **Manage extensions** dialog.
3. From the **Manage extensions** dialog, enable the **ML-assisted labeling** extension.

<figure><img src="/files/aAoQlayGuk0w5OJL85RU" alt=""><figcaption><p>Manage extensions dialog</p></figcaption></figure>

4. Once enabled, select **Amazon Comprehend** as the service provider.

<figure><img src="/files/Pph7Vk33wcBDXBcENgyG" alt="Image of ML Assisted with Amazon Comprehend"><figcaption></figcaption></figure>

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

Before creating a role in the **IAM** page, create the required policies to define permissions for the new role.

1. Go to your **IAM** page, navigate to the **Policies** section, and then create a new policy.
2. Download the example below and add it.

{% file src="/files/xJps9ytUtC28gf1EsYXs" %}

After that, proceed to create a new role:

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

   <figure><img src="/files/mSrxp6AMAuoOu8jzzOhB" alt="Image of Select trusted entity Menu"><figcaption><p>Select trusted entity</p></figcaption></figure>
4. On the **Add permissions** step, search for the policy you created earlier and add it to the permissions.

   <figure><img src="/files/Mdgzds1GOKrQhaGMwO1L" alt="Image of Add permissions page"><figcaption><p>Add permissions</p></figcaption></figure>
5. Provide a role name and click **Create role.** The role will be created successfully.

   <figure><img src="/files/1goDtGghknMDiKAz1tiJ" alt="Image of Role Creation"><figcaption></figcaption></figure>
6. View your role and copy the **Role ARN**.

   <figure><img src="/files/IvM81Hi5ZWzvfQI0WUM8" alt="Image of Role Menu to copy Role ARN"><figcaption><p>Role ARN</p></figcaption></figure>
7. Paste this information into the **ML-assisted labeling** extension.
8. Go back to the **Amazon Comprehend** page and retrieve the **Endpoint ARN**. Copy it and paste it into the extension.

   <figure><img src="/files/SVrYNfdKUSfvKYHmq75S" alt="Image of Endpoint Details"><figcaption><p>Endpoint details</p></figcaption></figure>

## Start prediction

Once you have configured the settings, click **Predict labels** to generate predictions from your model.

<figure><img src="/files/anYYioLQeCQyNwtOS8W7" alt="Image of Prediction result"><figcaption><p>Prediction results</p></figcaption></figure>
