ster decisions fetch
Read rows of a Hugging Face classification dataset into labelled decisions: one choice question per row, with the dataset's own class names as the options and its label as the answer.
Invocation and purpose#
ster decisions fetch --dataset <OWNER/NAME> --config <CONFIG> --split <SPLIT> --text-field <COLUMN> --label-field <COLUMN> --question-id <ID> --instructions <TEXT> --count <COUNT> --output <OUTPUT> [--offset <OFFSET>]Reads --count rows of the named dataset through the Hub's datasets-server rows route, a hundred at a time, and writes the labelled-decision document `ster calibrate`, `ster tune decide` and `ster decisions benchmark` read. Every row becomes one example whose state is the text column and whose one choice question lists the label column's class names as options; the row's label, an index or a name, is the answer. Nothing about the dataset is assumed: its configuration, split and both column names are named by the caller, because a guessed column silently trains on the wrong text.
Inputs and options#
| Input | Required | Meaning |
|---|---|---|
--dataset <OWNER/NAME> | yes | The dataset id on the Hub, such as fancyzhx/ag_news. |
--config <CONFIG> | yes | The dataset configuration the rows are read from. |
--split <SPLIT> | yes | The split the rows are read from, such as train or test. |
--text-field <COLUMN> | yes | The column holding the text each row is about; it becomes the example's state. |
--label-field <COLUMN> | yes | The class-label column. Its named classes become the options; a column that is not a class label with two to twenty-six names is refused. |
--question-id <ID> | yes | The id the one question is asked under in every example. |
--instructions <TEXT> | yes | The question asked about every text. |
--count <COUNT> | yes | Rows to read; above zero. |
--offset <OFFSET> | no | Rows to skip from the start of the split; 0 by default. |
--output <OUTPUT> | yes | Where the labelled decisions are written; missing parent directories are created. |
Output and state#
Prints an object with path and report. The report carries dataset, config, split, the options read from the label column, requested, rows read, examples kept, skipped — rows whose text was empty or whose label named no class — and label_counts, how many examples carry each label, so an ordered or lopsided slice is visible before anything trains on it. Progress on stderr reads fetching rows <from>..<to> of <dataset>.
Refusals#
- A missing
--config,--split,--text-field,--label-field,--question-idor--instructionsis refused by clap with exit 2; none has a built-in value. fetch needs a row count above zero;a fetched question needs an id and instructionswhen either is blank.the datasets server answered <status> for <dataset>: <sentence>, carrying the server's own sentence;failed to reach the datasets server: <kind>;the datasets server returned a page that is not JSON.the dataset has no column named '<label-field>';column '<label-field>' is not a class label with at least two named classes;column '<label-field>' has <n> classes; Ster labels at most 26.no row of <dataset> carried both a text and a known labelwhen every row was skipped, and the labelled-decision validation refusals of `ster calibrate` when the set they form is invalid.