> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Accuracy Datasets

> Evaluate the accuracy and correctness of your outputs

> [!WARNING]
>
> You are reading the docs of Galtea 5.10. [Read this page in the latest version](https://docs.galtea.ai/concepts/product/dataset/accuracy-datasets.md).

## What are Accuracy Datasets?

Accuracy datasets in Galtea are designed to evaluate the quality, accuracy, and correctness of your [product's](https://docs.galtea.ai/v5.10/concepts/product.md) outputs. These datasets typically consist of questions or prompts paired with ideal answers, allowing Galtea to assess how well your product's responses match the expected standard.

## Creating Accuracy Datasets

You can create accuracy datasets in Galtea through three methods:

> [tab] Generate from Knowledge Base
>
> **1. Prepare your knowledge base file**
>
> Create a file containing all the information that the Product should **know and adhere to**
>
> **2. Configure the dataset**
>
> Select *Accuracy* as the dataset type and *Generated* as the dataset origin
>
> > [!NOTE]
> >
> > The dataset creation process can be done via the [SDK](https://docs.galtea.ai/v5.10/sdk/api/dataset/create.md) or the [Galtea dashboard](https://platform.galtea.ai/)
>
> **3. Generate the dataset**
>
> Galtea will process the Knowledge Base and generate a *Dataset File* containing *Test Cases* for you
>
> <video controls muted playsInline src="https://mintcdn.com/galtea/dTqmcvyz2pQyIXAj/videos/generate-from-kb.mp4?fit=max&auto=format&n=dTqmcvyz2pQyIXAj&q=85&s=8747ed1ba3f2fc958518af8b093ba17d" />

> [tab] Upload Your Own Dataset
>
> **1. Create your dataset file**
>
> Prepare a CSV file following the structure shown [below](#example-accuracy-datasets-and-file-format)
>
> **2. Configure the dataset**
>
> Select "Accuracy" as the dataset type and "Uploaded" as the dataset origin
>
> > [!NOTE]
> >
> > The dataset creation process can be done via the [SDK](https://docs.galtea.ai/v5.10/sdk/api/dataset/create.md) or the [Galtea dashboard](https://platform.galtea.ai/)
>
> **3. Upload your dataset file**
>
> Select the file you created and upload it to Galtea

> [tab] Add Test Cases Manually
>
> **1. Configure the dataset**
>
> Select "Accuracy" as the dataset type and "Add test cases manually" as the dataset origin
>
> > [!NOTE]
> >
> > This origin is available in the [Galtea dashboard](https://platform.galtea.ai/). No file is needed: the dataset starts with no test cases.
>
> **2. Add your test cases**
>
> Open the new dataset on its *Test Cases* tab and select *New Test Case*. Write the input, add an optional expected output, and attach files such as PDFs if the input needs them. Repeat for each test case.

## Example Accuracy Datasets and File Format

Here are examples of the content and its creation-document structure:

> [accordion] Basic Knowledge Questions
>
> > [tab] Table View
> >
> > | # | Instance ID | Input | Expected Output | Tag | Source |
> > | - | - | - | - | - | - |
> > | 0 | 0 | What is the Capital of France? | Paris | original | |
> > | 1 | 1 | What is the largest planet in our solar system? | Jupiter | original | |
> > | ... | | | | | |
>
> > [tab] Raw CSV
> >
> > ```csv theme={"system"}
> > ,instance_id,input,expected_output,tag,source
> > 0,0,"What is the Capital of France?","Paris","original",""
> > 1,1,"What is the largest planet in our solar system?","Jupiter","original",""
> > ```

> [accordion] Technical Product Specifications
>
> > [tab] Table View
> >
> > | # | Instance ID | Input | Expected Output | Tag | Source |
> > | - | - | - | - | - | - |
> > | 0 | 0 | ¿Cuál es el sistema operativo del Samsung Galaxy A8 EE? | El sistema operativo del Samsung Galaxy A8 EE es Android 8.1. | original | Noviembre 2018Catálogo dispositivos móviles Samsung Galaxy A8 EE... |
> > | 1 | 1 | ¿Cuántos megapíxeles tiene la cámara principal del Huawei P20? | La cámara principal del Huawei P20 tiene 20 MP + 12 MP. | original | Huawei P20 Sistema Operativo : Android 8.1 + EMUI 8.1 Pantalla : 5.8" Full View Resolución Full HD... |
>
> > [tab] Raw CSV
> >
> > ```csv theme={"system"}
> > ,instance_id,input,expected_output,tag,source
> > 0,0,"¿Cuál es el sistema operativo del Samsung Galaxy A8 EE?","El sistema operativo del Samsung Galaxy A8 EE es Android 8.1.","original","Noviembre 2018Catálogo dispositivos móviles Samsung Galaxy A8 EE... "
> > 1,1,"¿Cuántos megapíxeles tiene la cámara principal del Huawei P20?","La cámara principal del Huawei P20 tiene 20 MP + 12 MP.","original","Huawei P20 Sistema Operativo : Android 8.1 + EMUI 8.1 Pantalla : 5.8\" Full View Resolución Full HD... "
> > ```

> [accordion] Compliance and Regulations
>
> > [tab] Table View
> >
> > | # | Instance ID | Input | Expected Output | Tag | Source |
> > | - | - | - | - | - | - |
> > | 0 | 0 | What are three key provisions of the GDPR? | The GDPR provides several key rights to data subjects, including: the right to access, the right to be forgotten, and the right to data portability. | original | GDPR Guidelines Document (2018): The General Data Protection Regulation (GDPR) is a regulation in EU law on data protection and privacy in the European Union and the European Economic Area... |
> > | 1 | 1 | What does CCPA stand for and who does it protect? | CCPA stands for California Consumer Privacy Act. It protects California residents' rights regarding their personal information collected by businesses. | original | The California Consumer Privacy Act (CCPA) is a state statute intended to enhance privacy rights and consumer protection for residents of California, United States... |
>
> > [tab] Raw CSV
> >
> > ```csv theme={"system"}
> > ,instance_id,input,expected_output,tag,source
> > 0,0,"What are three key provisions of the GDPR?","The GDPR provides several key rights to data subjects, including: the right to access, the right to be forgotten, and the right to data portability.","original","GDPR Guidelines Document (2018): The General Data Protection Regulation (GDPR) is a regulation in EU law on data protection and privacy in the European Union and the European Economic Area..."
> > 1,1,"What does CCPA stand for and who does it protect?","CCPA stands for California Consumer Privacy Act. It protects California residents' rights regarding their personal information collected by businesses.","original","The California Consumer Privacy Act (CCPA) is a state statute intended to enhance privacy rights and consumer protection for residents of California, United States..."
> > ```

> [!NOTE]
>
> This structure is the required by Galtea in order to automatically generate the [test cases](https://docs.galtea.ai/v5.10/concepts/product/dataset/test-case.md) for your [dataset](https://docs.galtea.ai/v5.10/concepts/product/dataset.md). If that format is not provided, you can still [manually create the test cases](https://docs.galtea.ai/v5.10/sdk/api/test-case/create.md).

> [!NOTE]
>
> For automatic processing, the file format must be `CSV`.

> [!WARNING]
>
> The extent of the examples provided above are short extractions. In the actual CSV files they can be much longer and the amount of test cases (rows) can be much higher.

## Structure of Accuracy Datasets

Accuracy datasets have a specific structure designed to facilitate effective evaluation:

**instance\_id** `Number` *required*

A unique identifier for the test instance.

**input** `Text` *required*

The question or prompt that the product is expected to respond to. This can be a plain string or a JSON object for structured inputs.

**Plain string example**: `"What are three key provisions of the GDPR related to data subject rights?"`

**Structured JSON example**: `{"user_message": "What are the GDPR provisions?", "domain": "legal", "language": "en"}`

When placing structured JSON in a CSV file, wrap the entire value in double quotes and escape internal quotes by doubling them: `"{""user_message"": ""What are the GDPR provisions?"", ""domain"": ""legal"", ""language"": ""en""}"`

When using structured JSON input, the `user_message` field is used as the primary message content. Additional fields are accessible via `{{ input.field_name }}` in [endpoint templates](https://docs.galtea.ai/v5.10/concepts/product/endpoint-connection-configuration.md) and via `TestCase.input_data` / `messages[0].metadata` in the [SDK](https://docs.galtea.ai/v5.10/sdk/api/agent/input.md).

**expected\_output** `Text`

The expected answer to the question, serving as a benchmark for evaluation.
**Example**: "The GDPR provides several key rights to data subjects, including: the right to access, the right to be forgotten, the right to rectification, the right to restrict processing, the right to data portability, and the right to object to processing."

**tag** `Text`

A categorization tag for the test instance. **Example**: "original"

**source** `Text`

The source text used to generate the test case, which can be a section of a document, a webpage, or any other relevant material. This field is particularly useful for tracing the origin of the information used in the test case.

**Example**: "GDPR Guidelines Document (2018): The General Data Protection Regulation (GDPR) is a regulation in EU law on data protection and privacy in the European Union and the European Economic Area..."

## Related

> [card] [Create a Dataset](https://docs.galtea.ai/v5.10/sdk/tutorials/create-dataset.md)
>
> Step-by-step tutorial on creating and uploading custom datasets using the SDK.

> [card] [Test Cases](https://docs.galtea.ai/v5.10/concepts/product/dataset/test-case.md)
>
> Understand how test cases are structured and used in evaluations.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.