> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling/prompt-examples.md).

# Prompt Examples

Prompts examples for row labeling and span labeling projects.

## Row labeling

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-bafc8bf78fe8493dbadd44c57f7924241ae70a77%2FExtension%20-%20ML-assisted%20Labeling%20-%20Row%20labeling%20-%20LLM%20Assisted%20Labeling%20-%20user%20prompt.png?alt=media" 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<span data-gb-custom-inline data-tag="emoji" data-code="1f1f2-1f1f2">🇲🇲</span>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="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-5485f63ebf7258c4b21496c1d8783b5580794de8%2FSpan%20labeling%20-%20Toolbar%20-%20Label%20set%20dropdown%20highlight.png?alt=media" 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="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-42b2b56ddb91eb5af4ad1756496e7b552a610570%2FExtension%20-%20ML-assisted%20Labeling%20-%20Span%20labeling%20-%20LLM%20Assisted%20Labeling%20-%20user%20prompt.png?alt=media" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling/prompt-examples.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
