jevfieldnotes
TUTORIALS

Classify support tickets

Run a ticket-labeling example, import its results and find which categories get confused.

2 MIN READ · PLUS RUN TIME · UPDATED 20 SEP 2026
Download Python example ↓

Python 3.10+ · No packages to install · Local demo uses supplied answers

Decide what counts as a correct label

“The same invoice was paid twice” is billing. “The shoes do not fit” is returns. “Do I pay to return this?” crosses the boundary, so this lab expects review. Agree on these cases before judging a model. Unlike the routing lab, this article focuses on comparing labels, not choosing an application action.

Run the local example

Download the ZIP above, unzip it and open a terminal in that folder. You need Python 3.10 or later; there are no packages to install. dry-run writes request payloads. demo reads the supplied, hand-written responses and runs the application logic. Use a new output folder for each run.

python jev_lab.py --mode dry-run --out requests
python jev_lab.py --mode demo --out demo-run

Read the six example labels

samples.json contains four messages with a team label and two with review. One delivery message is in Chinese. The supplied responses let you check Unicode handling and review outcomes locally; you will need real predictions to evaluate language capability.

Open evaluation.csv in Evaluation Bench

After the demo, import demo-run/evaluation.csv into Evaluation Bench. It has id, expected and predicted columns. The bench compares labels exactly, including review. A label match therefore measures agreement with this lab’s review policy as well as its categories.

id,expected,predicted
en,shipping,shipping
short,review,review

Find a weak category

For billing, precision asks: of the messages labeled billing, how many belonged there? Recall asks: of all billing messages, how many did we find? The bench shows these values for configuration A. Also count review outcomes separately; the bench does not automatically calculate an automation coverage rate.

Compare two sets of predictions

Run the same messages with rubric A and rubric B. Join by id, putting B’s labels in predicted_b. Do not join by row position: a failed request can shift the rows. Use a separate set to choose wording and cutoffs, and keep expected labels out of the request state.

Try your own messages with the API

Copy the structure of samples.json into own-data.json and replace the examples and expected labels. Set TYPESAFE_API_KEY in your terminal, then run the command below. Use --model with an available version identifier to repeat an experiment against the same model. Check failures.json before interpreting the results.

python jev_lab.py --mode live --samples own-data.json --out live-run

Read the disagreements before choosing a version

Start with messages where A and B differ. Would the proposed change fix a common mistake or only one unusual example? Check whether either version pushes more work into review. Use new messages for the final check after editing the rubric.

Test records, output files and retry behavior

The five local labs passed 27 synthetic cases and 18 response-validation and injected-failure tests. These tests cover application logic. No live Jev call was made.

Files written by a run

results.json contains validated decisions and raw answers. failures.json records failed rows. manifest.json records the run mode, model identifiers, dataset and rubric hashes, thresholds and completion counts. Demo runs omit latency and token usage. Live timing includes network and retries; recorded token usage covers successful responses only. The client does not infer a bill.

What happens when a request fails

The client rejects invalid answer types, unknown labels, inconsistent distributions and nonfinite values where applicable. Authentication and validation errors stop immediately. Selected HTTP failures, including 429 and 529, get at most three attempts. Numeric Retry-After is supported within a ten-second wait budget; HTTP-date values are not parsed. Network timeouts stop rather than retrying a potentially billed call.

Failed rows produce a nonzero exit status. Quality metrics cover valid rows, so read the failure count too. The ZIP’s README documents these behaviors.

Related official reading

Customer service workflowSee how the official evaluation combines separate judgments with code, including examples where predictions disagree.