# Labels

## Overview

The **Labels** extensions are available for span, span + line, span + line + document, and conversational labeling projects. Both extensions display the pre-configured label set up during project creation, allowing users to label related to each span.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-8856c069c99c7eb1ea84edc9bb991c27035d1618%2FExtension%20-%20Labels%20-%20highlight.png?alt=media" alt=""><figcaption></figcaption></figure>

## **Label Set Modification**

You can manage and update label sets either from the **Label management** page in your workspace or directly within a project. This includes adding new label sets, editing existing ones or removing them. Learn more about [label set management](https://datasaurai.gitbook.io/datasaur/workspace-management/label-management/label-set-management).

Within a project, label sets can be modified through the menu by right-clicking the three-dot menu in 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-33e7f9d93eef021d592a66d56bb64b85dc006c2a%2FExtension%20-%20Labels%20-%20more%20menu.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Add a new label set**

A label set can be added in three ways:

1. Upload a label set with a `.csv` or `.tsv` format
2. Choose from a library of label sets

   The library has three label sets loaded by default: `INACL`, `Stanford`, and `Default NER`. If you have created a project before, previous label sets will be automatically added to the library.

   *Note: Uploading or choosing a new label set will delete all existing labels in the document.*

   <figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-8856c069c99c7eb1ea84edc9bb991c27035d1618%2FExtension%20-%20Labels%20-%20highlight.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Type the labels in manually

### **Replace existing label set**

This option allows you to choose between upload/create manually or select one of the pre-stored label sets from the library. Doing so will replace the current label set in use and remove any existing labels associated with it.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-a997ae0beae7803e5baf22d054615d025d24aa3d%2FExtension%20-%20Labels%20-%20Replace%20existing%20label%20set.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Edit label set**

This option allows you to adjust the label set even after a project has started. You can add new label, edit existing ones, or remove them. Here are the [label set properties](https://docs.datasaur.ai/workspace-management/label-management/label-set-management#label-set-management-page) you can edit.

{% hint style="info" %}
Editing the label set in the project will not automatically apply changes to the corresponding label set in **Label management** page.
{% endhint %}

#### **Adding Labels**

You can directly add label items in the provided section, as shown below.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-3b3614d557294b6380d87feec93f723e8138bacc%2Fimage%20(27).png?alt=media" alt=""><figcaption></figcaption></figure>

You can also move a label by clicking the dots and dragging the label up and down.

{% hint style="info" %}

* Some users find that colors can help them memorize labels and reduce human error while labeling.
* We now support label hierarchies up to 10 levels!
  {% endhint %}

#### **Editing Labels**

Select the label you want to modify and make the necessary changes. You can update both UI-related properties, such as: label set name, label class, label color, label class clarification, and label position.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-8c64d833e293141047a5b5f6c477d8f11b390d46%2Fimage%20(29).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Delete label set**

Delete the current label set to switch to a different one whenever you need.

### **Save to library**

Save the current label set to your library (**Label management** page) so it can be reused in other projects.

## **Show instances by labels**

As you can see in the screenshot below, Datasaur count all labels applied to spans and arrows. If you click on the counter, you can see the instances.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-ee5827448d02d285ea6346b7c5cad7908717b388%2FExtension%20-%20Labels%20-%20highlight%20-%20counts.png?alt=media" alt=""><figcaption></figcaption></figure>

Clicking one of the instances will directly navigate to the instance's location in the text viewer.

![](https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-1cdd37642037acaba832d09078ab406c4abb221c%2FExtension%20-%20Labels%20-%20project%20-%20specific%20label.png?alt=media)

## Marking Unapplied Label as Not Applicable

While labeling, users may find that certain labels do not apply to a document. For example, if a label set includes a 'Signature' label but it is not applicable to a particular document, users lack a straightforward method to indicate the absence of certain label classes.

The introduction of this capability allows users to mark labels that are not applied to a document as <mark style="color:red;">`N/A`</mark> (not applicable).

### How to: Enable Marking Unapplied Label as Not Applicable

This can be enabled either during the project creation or from the project settings within a project.

1. To enable it during project creation, proceed to step 5.

   ![](https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-db1f3ddb6b1a6d5fb834d8b3c7f1770198937f5d%2FPCW%20-%20step%205%20-%20highlight%20mark%20label%20classes%20as%20NA.png?alt=media)
2. To enable it through project settings, navigate to the **File >** **Settings** menu and open the **Administrator** tab. Then, enable the **Allow marking unapplied label classes as N/A** option.

   ![](https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-7842ecf6b63df6ffb7994cf52415970d1eb9bd96%2FProject%20settings%20-%20span%20labeling%20-%20administrator%20-%20highlight%20mark%20label%20classes%20as%20NA.png?alt=media)

### Marking a Label Class as Not Applicable

Once enabled, you can mark a label class as <mark style="color:red;">`N/A`</mark> (not applicable) within the extension. A label eligible for being marked as <mark style="color:red;">`N/A`</mark> is one that has not yet been applied to the document, indicated by an instance counter of <mark style="color:red;">`0`</mark> displayed in the extension.

To mark the label class as <mark style="color:red;">`N/A`</mark>, click on the instance counter.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-1e0127a569f922a1a406e10678310f8fb5446f81%2FExtension%20-%20Labels%20-%20highlight%20-%20mark%20label%20as%20NA.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note:\
• If you apply a label class that was previously marked as <mark style="color:red;">`N/A`</mark> to a span in the document, the <mark style="color:red;">`N/A`</mark> mark will be automatically removed, as it becomes applicable to the document.\
• The <mark style="color:red;">`N/A`</mark> mark will only be visible to the user who marks the label class as <mark style="color:red;">`N/A`</mark>. It will not affect other users.
{% endhint %}

To remove the <mark style="color:red;">`N/A`</mark> mark, click again on the label class you previously marked as <mark style="color:red;">`N/A`</mark>.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-3a6b7ae0ffb46de7247ee826b9d4e56a604a75fb%2FExtension%20-%20Labels%20-%20highlight%20-%20mark%20label%20as%20applicable.png?alt=media" alt=""><figcaption></figcaption></figure>

## Review The Unapplied Label Classes

When you mark a document as complete and there are label classes that have not been applied, a dialog box will appear displaying a list of these unapplied label classes. This list excludes any label classes that have already been marked as <mark style="color:red;">`N/A`</mark>, enabling you to review and take appropriate action.

If you wish to mark all unapplied label classes as <mark style="color:red;">`N/A`</mark>, check the **Mark all unapplied label classes as N/A** option and then click **Mark as complete**.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-efce875a487f716dadece03b2d886d5a00b2d086%2FExtension%20-%20Labels%20-%20labels%20not%20applied%20dialog.png?alt=media" alt=""><figcaption></figcaption></figure>
