<!-- Source: https://docs.squirro.com/en/latest/technical/pipelets/additional-labeling.html -->
# Additional Labeling Pipelet

Profile: Project Creator, Frontend Developer

This page explains the functioning of the _Additional Labeling_ pipelet.

Project creators or frontend developers can insert this pipelet into a pipeline workflow using the [pipeline editor](../data-processing/pipeline-editor.md#data-processing-pipeline-editor) to add additional labels to items extracted from other items based on shared labels.

## Overview

The _Additional Labeling_ pipelet automatically adds additional labels to items extracted from other items based on shared labels.

In other words, the pipelet adds additional labels to Item A from Item B when it finds that Item A and Item B share a specified label.

The example diagram below shows two items, Item A and Item B. These items share a label called `account_name`. When run, the pipelet will copy `industry` labels from Item B to Item A based on their matching `account_name` labels.

[![Additional Labeling pipelet diagram](https://s3.amazonaws.com/download.squirro.net/docs/technical/pipelets/additional-labela.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/pipelets/additional-labela.png)

## Parameters

The pipelet has four parameters, as shown in the table below:

| Parameter | Description | Default Value |
| --- | --- | --- |
| A label of the item used to look for the additional label | A label that already exists for source items. Based on the label value the pipelet will look for other items. | `account_name` |
| A label to be added to the item | A label that needs to be added. The label exists for other items. | `industry` |
| Additional query | Any filtering query can be added. For example, we can specify a source where we want to look for the additional label. | _empty_ |
| Maximum number of added label values | The pipelet can find many different values of the additional label. Here we can limit the number of these values. | 5 |

## How to Use

The _Additional Labeling_ pipelet is run from the [Pipeline Editor](../data-processing/pipeline-editor.md#data-processing-pipeline-editor) in the UI.

To run the pipelet, follow the steps below:

1. Open your project and navigate to the Setup space.
2. Click the Pipeline tab to open the Pipeline Editor.
3. Click the orange pencil icon to edit the pipeline.
4. In the widget panel, scroll down to the Additional Labeling pipelet.
5. Drag and drop the widget to the desired place in the pipeline.

[![Additional Labeling pipelet in the Pipeline Editor](https://s3.amazonaws.com/download.squirro.net/docs/technical/pipelets/additional-pe.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/pipelets/additional-pe.png)

1. Set the facet (label) _Step Properties_ in the right panel.

## Example

The following example is taken from a Cognitive Search application called _News That Interests You_.

In this example, the items within the news sources contain information about companies.

The goal is to understand what industries these companies belong to by adding additional industry label information to each of the news items.

### Step 1 - Identify the Label Value to Match

Your first step is identifying the label value you want to match, which will serve as the `account_name`.

### Step 2 - Identify SalesForce Data Source Label

Next, locate a SalesForce data source also containing items with `account_name` labels. In addition to having `account_name` labels, these SalesForce items should also have `industry` labels.

### Step 3 - Run the Pipelet

When you run the pipelet, it will match all news items with `account_name` labels to SalesForce items with matching `account_name` label values. Then it will look for `industry` labels and, if they exist, copy those labels from the SalesForce items to your news items.
