# ML Assisted Labeling

## Overview

Datasaur’s **ML-assisted labeling** extension enhances efficiency and accuracy in data labeling for NLP projects. It integrates open-source models, large language models (LLMs), and custom models, providing automatic labeling for both span-based and row-based tasks. This tool streamlines the data labeling process, automating your workflow to save time and improve data quality, allowing you to focus solely on reviewing.

## Use Case

### Finding out the sentiment of user reviews (Row-based)

You can use **ML-assisted labeling** features in many ways, one of the core ways you can use is sentiment analysis of reviews. Let’s run through a step-by-step guide on how this can be done.

1. **Create a project**: Follow the guide [here](https://docs.datasaur.ai/data-studio-projects/creating-a-project) to create a row labeling project.
2. **Enable ML-assisted labeling**: Click the gear icon from the extension panel on the right to open the **Manage extensions** dialog, and enable the **ML-assisted labeling** feature.

   <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=""><figcaption><p>Manage Extensions Pop Up</p></figcaption></figure>
3. **Select Sentiment Analysis**: Click **Sentiment Analysis** for the service provider and choose the **Target text** and **Target question**.

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-8d47614ef03144385abdc3d1b2e47f6bea7bc1f1%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20Sentiment%20analysis%20-%20highlight.png?alt=media" alt=""><figcaption><p>ML Assisted Labeling Settings - Sentiment Analysis</p></figcaption></figure>
4. **Predict and review labels**: Click **Predict labels**. After processing, review the labels and click **Accept** or **Reject**. Voila! Your sentiment analysis is complete.

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-124ee15b44df9f375b4aae0b4ac17183210d76bf%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20sentiment%20analysis%20-%20project.png?alt=media" alt=""><figcaption><p>Prediction Result</p></figcaption></figure>

### Using spaCy to automatically label entire text data (Span-based)

You can also use service provider, spaCy, in **ML-assisted labeling** feature to automatically label your data. Here’s how you can achieve this:

1. **Create project**: Just like before, follow the guide [here](https://docs.datasaur.ai/data-studio-projects/creating-a-project) to create a span-based project. Here’s what the data looks like below.

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-c64c52c294e560b60819d64c07f978faca7d077d%2FExtension%20-%20Labels%20-%20project%20-%20initial.png?alt=media" alt=""><figcaption><p>Span Based Project</p></figcaption></figure>
2. **Enable ML-assisted labeling**: Open the **Manage extensions** dialog and turn on 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=""><figcaption><p>Manage Extensions Pop Up</p></figcaption></figure>
3. **Select spaCy**: Click **spaCy** for the service provider. To learn more about spaCy click [here](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/spacy).

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-09dc1df21aa4c147c6f0848588c813a6fae4ac71%2FExtension%20-%20ML-assisted%20Labeling%20-%20Span%20labeling%20-%20spaCy%20-%20highlight.png?alt=media" alt=""><figcaption><p>ML Assisted Labeling Settings - spaCy</p></figcaption></figure>
4. **Predict and review labels:** Click **Predict labels**. After processing, review the labels and click **Accept** or **Reject** for individual labels. Voila! The labels are applied.

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-06361d937f9fb6f751e55bd6004ca981ccdefa34%2FExtension%20-%20ML-assisted%20Labeling%20-%20Span%20labeling%20-%20spaCy%20-%20project.png?alt=media" alt=""><figcaption><p>Prediction Result</p></figcaption></figure>

For further details, please visit the [Assisted Labeling - ML Assisted Labeling](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling).
