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

# Sentence-pair classification

> Dataset template for sentence-pair classification: one tab-separated sentence pair per .txt plus a labels CSV, ingest.yaml and the checks the data ingestor runs.

Label how two texts relate — entailment, paraphrase, duplicate question. Each sample is one `.txt` file holding **two sentences separated by a single tab**, plus one CSV row with the class label.

## Folder layout

```text theme={null}
/data/shared/mnli-pairs/
├── labels.csv
└── texts/
    ├── pair1.txt
    ├── pair2.txt
    └── ...
```

Each file is exactly one line of the form `text_a<TAB>text_b`, for example:

```text theme={null}
A man is playing a guitar.	A person is making music.
```

* The folder must be named `texts` and sit next to the labels CSV.
* Exactly two non-empty fields separated by one tab, on one line. Plain prose without a tab, an empty side, or several pairs in one file are rejected.
* UTF-8 encoded; one extension across the dataset (`.txt` by default).

## Labels CSV

```csv theme={null}
filename,label
pair1,entailment
pair2,contradiction
pair3,neutral
```

| Column      | Required               | Meaning                                                                                                          |
| ----------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `filename`  | yes, exactly this name | The text file, with or without extension.                                                                        |
| `label`     | yes                    | The class of the pair. Any column name works — set it with `label:`. At least two distinct classes are required. |
| `extension` | no                     | Present in the shipped sample; not read by the ingestor.                                                         |

Do not declare `filename` or `label` in `schema`.

## ingest.yaml

```yaml theme={null}
apiVersion: tracebloc.io/v1
kind: IngestConfig
category: sentence_pair_classification
table: mnli_sentence_pairs_train
intent: train
csv: /data/shared/mnli-pairs/labels.csv
texts: /data/shared/mnli-pairs/texts/
label: label
```

| Field                         | Required | Meaning                                     |
| ----------------------------- | -------- | ------------------------------------------- |
| `csv`                         | yes      | Path to the labels CSV.                     |
| `texts`                       | yes      | The `texts/` folder.                        |
| `label`                       | yes      | Name of the class column.                   |
| `schema`                      | no       | Extra typed columns only.                   |
| `spec.file_options.extension` | no       | `.txt` (default) or `.text`.                |
| `language`, `normalization`   | no       | Dataset language and applied normalization. |

## What the ingestor checks

| Check           | Rejects                                                                                                        |
| --------------- | -------------------------------------------------------------------------------------------------------------- |
| File type       | Files under `texts/` with a different extension than configured, or mixed extensions.                          |
| Text content    | NUL bytes or invalid UTF-8; empty files produce a warning.                                                     |
| Sentence pair   | A referenced file that is missing, spans several lines, has a field count other than 2, or has an empty field. |
| Label column    | A CSV whose header has no column matching `label:`.                                                            |
| Data types      | With a `schema`: values that do not match their declared type.                                                 |
| Label diversity | Fewer than two distinct label values.                                                                          |

Plus the [checks every ingest runs](/create-use-case/templates#checks-every-ingest-runs).

## Sample dataset

The template ships five sentence pairs labelled `entailment`, `contradiction` and `neutral`. The `ingest.yaml` above ingests it with no overrides.

## Next steps

* Stage the data and run the ingest: [Prepare Data](/create-use-case/prepare-dataset)
* Shared rules for every template: [Dataset templates](/create-use-case/templates)
