Skip to content

Data Contract

Sudhanshu edited this page Nov 11, 2026 · 1 revision

JSONL Input/Output Contract

Input: one JSON object per nonblank line. review must be a nonempty string unless --text-field changes the field name. id and label are optional; only labels positive/negative contribute to reported accuracy.

{"id":"R001","review":"The display is excellent.","label":"positive"}

Output: original fields remain intact; the parent adds llm_output (raw decoded generation) and predicted_label (strict normalization).

{"id":"R001","review":"The display is excellent.","label":"positive","llm_output":"positive","predicted_label":"positive"}

Output order matches the input line order even though workers process batches asynchronously. If llm_output is not a valid one-word label, predicted_label is null.

flowchart LR
    Input["Input JSONL record: id? / review / label?"] --> Validation["read_jsonl: JSON object + nonempty text"]
    Validation --> I["Batch ids + review texts"]
    I --> Worker["LLM model or mock keyword heuristic"]
    Worker --> Prediction["Raw response: llm_output"]
    Prediction --> Normalize["normalized_label: positive / negative / null"]
    Normalize --> Output["Output JSONL: original fields + llm_output + predicted_label"]
Loading

Clone this wiki locally