Skip to main content
Learn vector representations from text pairs. This task is self-supervised (contrastive): there is no label column — the pairing is the supervision. Each sample is one .txt file with one tab-separated record:
  • a pair anchor<TAB>positive — two texts that should embed close together, or
  • a triplet anchor<TAB>positive<TAB>negative — with a hard negative that should embed far from the anchor.
Pairs and triplets may be mixed in one dataset.

Folder layout

Example pair:
  • The folder is named texts and sits next to the manifest CSV.
  • Exactly one tab between fields, all fields non-empty, one record per file on a single line. Unlike the other self-supervised text tasks, this structure is enforced: the CLI checks it before it ingests anything, and the ingestor checks it again.
  • UTF-8 encoded. Every file must end in .txt. The ingestor also accepts .text, but training opens only <filename>.txt, so a .text dataset ingests and then fails to train.

Manifest CSV

The task reads no label column. Setting label: in ingest.yaml is rejected. A label column in the manifest itself is not rejected: the ingest goes on without it and warns: “Column(s) [‘label’] in the manifest are ignored for embeddings and will not be stored”. The same goes for any other column besides filename and extension. Remove such columns to silence the warning.

Ingest with the CLI

Each split is one folder laid out as above. Ingest the training and the test split separately:
--holds open_data marks the dataset as open data. If your data is about patients, pass --holds patient_data; if it was generated, pass --holds synthetic_data. Leave --holds out on a terminal and the CLI asks; in a script, the dataset is marked as patient data. The mark decides which use case types you can create on the dataset. Do not pass --label-column: the CLI rejects it for this task because it trains on the text itself.

ingest.yaml

What the ingestor checks

Plus the checks every ingest runs, except label diversity (no label).

Sample dataset

The template ships three pairs and two triplets with a five-row manifest. The manifest ships as labels_file_sample.csv: rename it to labels.csv before you ingest the folder, because the CLI reads only that name. For the Helm chart, stage the renamed folder so that it matches the paths in the ingest.yaml above.

Score formulas

When you define a use case on this data, you can pick Retrieval Accuracy, Average Cosine Similarity or Average Contrastive Loss.

Next steps