# Datasaur Dinamic with Hugging Face

## Introduction

**Datasaur Dinamic** with [Hugging Face Auto Train](https://huggingface.co/autotrain) integration offers a comprehensive end-to-end model building capability. This powerful feature allows you to effortlessly train models using labeled data. Moreover, you can seamlessly combine it with **ML-assisted labeling** to automate predictions for unlabeled data, all within a streamlined and efficient workflow. This feature is available for both Row and Span labeling projects.

## Quick Start Guide

Here's a step-by-step guide to achieving optimal results with our **Datasaur Dinamic** using [Hugging Face Auto Train](https://huggingface.co/autotrain) provider:

1. Create a custom project, where you can utilize your data, whether it's pre-labeled or unlabeled.
   * When working on projects that involve unlabeled data, you can choose to **label all data** or **start from a subset of the dataset**. For instance, if you have 20 rows of data, try to label 10 or 15 rows initially, and the rest can be [automated later](#automate-the-rest-of-the-data-with-ml-assisted).
2. Now you can enable the **Datasaur Dinamic** extension from the **Manage extensions** dialog.

   <figure><img src="/files/dAvEScInkdopj7MXhpkr" alt=""><figcaption><p>Datasaur Dinamic with Hugging Face</p></figcaption></figure>
3. Preparing Hugging Face details

   * You will need a Hugging Face account with your username or organization name and an API access token ready.
   * When creating an API token, please make sure to enable all the necessary permissions.
   * To use it directly in ML-Assisted Labeling as a deployed model, please make sure to enable Inference Endpoints.

   <figure><img src="/files/CQxJp26vxygLVpolGF9C" alt=""><figcaption><p>Permission options in Hugging Face API Token</p></figcaption></figure>

   **Note:** Inference Endpoints are currently only available for paid Hugging Face accounts, so you will need to [provide a valid payment method](https://huggingface.co/docs/inference-endpoints/en/guides/access) in Hugging Face.
4. Provide the details on the extension.
   * Provide your [Hugging Face authentication credentials](https://huggingface.co/settings/profile), including your username/organization name and API token.
   * Define the **Input column(s)**, which is the column selected for data training.
   * Set up your preferred label set or question options as a **Target question** (for row labeling projects).
   * Make sure to enable the Deploy dedicated inference endpoint checkbox option in the extension.
5. Click **Train** to initiate the training process for the labeled data.
6. Now you can wait for the model to be deployed. Additionally, you can monitor the updates to your datasets and model on your Hugging Face profile.
7. After the model is deployed, the extension will display the URL. You can copy this URL and use it with our **ML-assisted labeling** extension through the Hugging Face provider.

   <figure><img src="/files/SO38jGk1ZWZmFuQvdKKc" alt=""><figcaption><p>Trained model name shown in Datasaur</p></figcaption></figure>

### Automate the rest of the data with ML Assisted

As of now, it is assumed that you have successfully deployed a model on Hugging Face.

1. Enable the **ML-assisted labeling** extension and select [Hugging Face](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/ml-assisted-using-huggingface) as your provider.
2. Fill all the **ML-assisted labeling** fields by copying and pasting the model name from the **Datasaur Dinamic** extension or your preferred model. Provide your API token and set the desired confidence score.

   <figure><img src="/files/QhGN4d2NhDovVmemxHqM" alt=""><figcaption></figcaption></figure>
3. Click **Predict labels** to generate labels for the corresponding rows.

By following these steps, we significantly reduce the time required for labeling the entire dataset, promoting a more efficient and streamlined workflow.


---

# 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/build-model/datasaur-dinamic/hugging-face.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.
