Ster/Docs

ster decisions import

Read a JSONL file of context, options and label rows into labelled decisions, so an option-scoring set built elsewhere trains and benchmarks here without a converter.

Invocation and purpose#

text
ster decisions import --input <JSONL> --question-id <ID> --instructions <TEXT> --output <OUTPUT>

Each line is one JSON object with context (the text), options (a list of texts) and label (the index of the correct option). The context becomes the example's state, the options become a choice question's options in the row's order, and the label index names the answer. The question's id and wording are the caller's: the file carries neither, and none is assumed.

Inputs and options#

InputRequiredMeaning
--input <JSONL>yesThe file, one row per line; blank lines are ignored.
--question-id <ID>yesThe id the one question is asked under in every example.
--instructions <TEXT>yesThe question asked about every context.
--output <OUTPUT>yesWhere the labelled decisions are written; missing parent directories are created.

Output and state#

Prints an object with path and report; the report carries source, rows read, examples kept and rejected, one sentence per refused row with its line number: line <n>: not a context/options/label row: <error>, the context is empty, a row needs at least two options, a row has <n> options; Ster labels at most 26, an option is empty, two options carry the same text, or the label <i> names no option of <n>. A rejected row is left out and the rest are kept.

Refusals#

  • A missing --question-id or --instructions is refused by clap with exit 2.
  • an imported question needs an id; an imported question needs instructions when either is blank.
  • failed to read <path>; <path> holds no importable rows when every row was rejected; the labelled-decision validation refusals of `ster calibrate`.