# Prompt Examples

## Row labeling

<figure><img src="/files/D4k0GlkKOcaZAuXBjFQn" alt=""><figcaption></figcaption></figure>

In row labeling projects, you can use the following attributes to define the input and expected output:

* `{targetText}` : Input text from the selected column in your data.
* `{targetOptions}` : Answer options from the selected target question.

The extension also supports one-shot or few-shot prompting. Below are prompt examples based on different question types.

### Single choice

| System prompt                                              | User prompt                                                                                                                                         |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for category classification | <p>Article: {targetText}<br></p><p>What is the topic for the article above? Choose one from the options below {targetOptions}<br></p><p>Answer:</p> |

### Dropdown

| System prompt                                               | User prompt                                                                                                                                         |
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for category classification. | <p>Article: {targetText}<br></p><p>What is the topic for the article above? Choose one from the options below {targetOptions}<br></p><p>Answer:</p> |

### Hierarchical dropdown

| System prompt                                               | User prompt                                                                                                                                         |
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for category classification. | <p>Article: {targetText}<br></p><p>What is the topic for the article above? Choose one from the options below {targetOptions}<br></p><p>Answer:</p> |

### Text

| System prompt                                               | User prompt                                                                                                                                    |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for category classification. | <p>Article: {targetText}<br></p><p>What is the topic of the article above? Choose one topic. Do not provide any explanation.</p><p>Answer:</p> |

### Date

| System prompt                                                        | User prompt                                                                                                                        |
| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for extracting dates from an article. | <p>Article: {targetText}<br></p><p>Extract the date and format it as YYYY-MM-DD. Do not provide any explanation.</p><p>Answer:</p> |

### Time

| System prompt                                                             | User prompt                                                                                                                               |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for extracting timestamps from an article. | <p>Article: {targetText}<br></p><p>Extract the timestamp and format it as HH:mm:ss.SSS. Do not provide any explanation.</p><p>Answer:</p> |

### Checkbox

| System prompt                                               | User prompt                                                                                                                           |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for category classification. | <p>Statement: {targetText}<br></p><p>{targetName}: Choose either true or false. Do not provide any explanation.</p><p><br>Answer:</p> |

### Slider

| System prompt                                           | User prompt                                                                                                                                                                                        |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for evaluating articles. | <p>Article: {targetText}<br></p><p>What is the factual accuracy score of the article above? Choose a number between {targetMin} and {targetMax}. Do not provide any explanation.</p><p>Answer:</p> |

### URL

| System prompt                                                       | User prompt                                                                                           |
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| You are an expert data labeler for extracting URLs from an article. | <p>Article: {targetText}<br></p><p>Extract the URL. Do not provide any explanation.</p><p>Answer:</p> |

## Span labeling

For span labeling, you can switch the label set by selecting the active label set in the upper-left corner.

<figure><img src="/files/oGtdSKrjujIhW0ggMW0g" alt=""><figcaption></figcaption></figure>

You can use the following attributes to define the input and expected output:

* `{targetText}` represents input text from your selected column in the uploaded data.
* `{targetLabelSet}` represents label set options from your active label set selection in the upper left corner.

<figure><img src="/files/AgzyZ796QxfiHH9WXsep" alt=""><figcaption></figcaption></figure>

Below is an example user prompt for NER labeling:

{% code overflow="wrap" %}

```latex
Notes:
Return the labeled entity tokens in object format, where each label set is the key and the value is an array of tokens. Do not provide any explanation. Do not provide any explanation.

LabelSet:
{targetLabelSet}

Sentence:
{targetText}
```

{% endcode %}


---

# 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/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling/prompt-examples.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.
