# Use Data Manager

> This page describes how to use Data Manager to label a new dataset and retrain an ML model.

This page describes how to use Data Manager to label a new dataset and retrain an ML model.

## Access and Configure Data Manager

Launch the created data labeling session in [First Run Experience](du-in-as-first-run-experience.md) and go to the settings to configure the OCR.

Choose the OCR you intend to use in the **OCR method** dropdown menu. For **UiPathDocumentOCR**, paste the Document Understanding license key (retrieve the Document Understanding API key from the **Admin** &gt; **License** page) and then paste the OCR URL you generated when you [deployed UiPathDocumentOCR](du-in-as-deploy-uipathdocumentocr.md).

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116337-4c6d0f1f.webp)

Configure the prelabelling with the models that you have deployed following the instructions [here](du-in-as-deploy-an-out-of-the-box-ml-package.md). Paste the model public ML Skill endpoint and the Document Understanding license key, and then click **Save**.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116663-01ec83cb.webp)

For more details, please check the documentation here: .

## Import Document

Click the **Import** button ![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-dm_import.svg-e584f15b.png) from a Data Manager Session.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-114974-694e58b0.webp)

Name the dataset and click **Browse files to upload**.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116615-ecbe8502.webp)

Select the document you want to upload.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-115580-01087cf0.webp)

Click **YES**.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-115783-546b884b.webp)

For more details, please check the documentation here: [Import Documents](data-manager-import-documents.md).

## Create Extraction Fields

Click ![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-dm_create_field.svg-06bf204c.png) to create fields to be extracted.

You can create up to 40 fields.

For this validation exercise, you can create some common invoice fields such as **date**, **name**, **invoice-no**, and **total**. Please ensure to change the content type accordingly - date (date), name (string), invoice-no (string), and total (number).

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116080-18fc66ff.webp)

For more details, please check the documentation here: [Create & Configure Fields](data-manager-create-and-configure-fields.md).

## Label Documents

Now you can start to label the documents.

Click the predict button ![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-dm_predict.svg-8da0ecec.png) on top to use the base invoice model to predict the labels for the defined fields, and correct it if the prediction is wrong.

To change the label, drag the mouse over the field and hit the keyboard shortcut to label it (e.g., `d` for labeling date in the below example).

Use the arrow on top to switch to the next document until you have finished the validation of labels for all uploaded invoices.

:::note
Since the Invoices base model has already performed really well and the sample invoice is simple without too much variation, the prediction accuracy is close to 100% in this case and you may not need to correct any labels.
:::

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-119477-c764f1e0.webp)

For more details about labeling documents, please check the documentation here: [Label Documents](data-manager-label-documents.md).

## Export Documents

Make sure to select the correct dataset in the dataset filtering and click the **Export** button ![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-dm_export.svg-ae0a6767.png) .

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-115919-674bbf44.webp)

Click **Export**.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116416-1e4c50cf.webp)

Go to **Datasets** under the same AI Center project, you should be able to see the exported training dataset.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-118193-5c10d149.webp)

For more details, please check the documentation: [Export Documents](data-manager-export-documents.md).

Train a custom model on AI Center

Go to **Pipelines** &gt; **Create new**. Please select the evaluation run type, select the model package and the input dataset.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-115371-5c10d149.webp)

Please select the sub folder under Export as the input dataset.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-114140-c3a065fe.webp)

Click **Create** to start the pipeline. It may take 1-2 hours for the pipeline to run on CPU machines.

## Deploy the Retrained ML Model as an ML Skill

Go to **ML Skills** and create a new ML Skill.

Choose the same invoice model package created before. As we have retrained the model, now there is a new minor package version (1 vs 0). Please make sure to select the latest.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116927-744920f3.webp)

Once the ML Skill is created, please go to **Modify current deployment** to make the ML skill public. Switch the toggle and click **Confirm**.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-116511-6c0c337f.webp)

Copy the URL of the public ML Skill for later use.

![docs image](https://dev-assets.cms.uipath.com/assets/images/document-understanding/document-understanding-118133-7421c512.webp)

Congrats! You have now retrained an **Invoice** model with your own dataset and created the endpoint to access the model.
