Building JobLit · Interactive field notes

Training a small model to understand job-site commands

A sentence, 4,608 numbers, and six possible answers. How I narrowed a voice feature down to a model that runs in the browser.

Try the actual model ↓

“Add an expense for $85 at Home Depot for the Town Hall job.”

Expense$85Home Depot → Town HallReady to review and save

I wanted JobLit, my job expense tracker, to turn a spoken command into a prefilled form. The device handles speech recognition. Here’s what happens to the text.

A smaller problem than I expected

I first considered sending the text to an LLM for structured data. Then I explored running an LLM on the device. Both felt like too much machinery for opening a form. Splitting the task made it simpler:

Learn the action

A trained classifier scores six possible actions.

Look up the thing

A registry identifies the page or form.

Extract the details

Rules read values and match workspace names.

Only the first part is learned. We train the model to recognize commands, including when to leave ordinary conversation alone.

Six answers, no hidden layers

The model is multinomial logistic regression, trained with scikit-learn and NumPy in Python. Each of 4,608 inputs connects directly to six outputs: open, add, edit, clock in, clock out, and unknown.

The actual model architecture: inputs directly connected to six outputsA representative subset of 4,608 input features connects directly to six action scores. There are no hidden layers. Lines are schematic and do not represent individual learned weights.4,608 inputs6 action scoress:w:addw:expensew:home depotc:expc:ensew:town halls:c:ad…w:jobopenaddeditclock inclock outunknownWeighted sums + bias → calibrated softmax
Connections shown schematically; a subset of inputs is drawn for readability. Every input has a coefficient for each output. Zero hidden layers.

Each output is a weighted sum plus a bias; calibrated softmax converts the scores to probabilities. That’s 27,648 learned coefficients and six biases. The exported vocabulary and weights occupy roughly 230 KB and run in JavaScript in the browser.

What we train on

We write sentence templates, fill them with varied names and values, then add fillers, repeated or missing words, and recognition mistakes. Roughly 30% of generated examples are noncommands.

Handwritten frameadd an expense for {amount} at {vendor}
Illustrative labeled example

add an expense for $85 at Home Depot

label: add
8,416Train
840Validate
840Test
267Handwritten challenge
The last example is a noncommand from a separate family of frames. Counts come from the saved dataset manifest; examples above illustrate the method.

The 8,416 training examples include 16 feedback corrections. We split templates before generating examples, so testing isn’t just the same sentence with a different dollar amount. Vocabulary statistics come only from training data.

We compare twelve combinations of vocabulary size and regularization using validation macro F1. Half the validation data selects the model; the other half calibrates its probabilities. Test and challenge sets remain separate.

Words become 4,608 numbers

Lowercase the text, simplify punctuation, and replace numbers with #. Collect 2,048 word features, 2,048 character features, and 512 features from the start of the command. Word pairs capture short phrases; character fragments help imperfect words share evidence.

Each pattern has a fixed slot. Matching patterns get a TF-IDF weight based on frequency and distinctiveness; absent patterns stay zero. We normalize the start features and the other features separately. The original text remains available for extracting exact amounts.

Take the model apart.

Type a command. Inspect its numbers, prediction, and the form it would open. This is the exported model from the app, running in your browser.

Local inference · no account needed
Start with the expense example, or try “open the Miller job” to see how the planner handles two matching jobs.

Where the other details come from

The model predicts “add.” The registry connects “expense” to a form. Extraction rules then read the amount, vendor, job, and description from the original text.

One sentence, six different jobs

Select a colored phrase to trace how it is read.

for at for the job for
Spoken phrase$85
Currency and number rules

The extractor reads the original dollar amount as a number. It can also read number words, such as “eighty five dollars.”

Interpretation fieldentities.amount: 85
How the description stays separate

Rules mark consumed spans so later rules cannot reuse them or read across them. With the amount, job, and vendor removed, the description rule can read the final “for” phrase.

add an expense for $85 at Home Depot for the Town Hall job for replacement hinges
This example’s fields are verified against the actual engine. Highlights and the crossed-out working copy illustrate the rules; they are not learned word-level predictions. Name lookup uses the fictional workspace from the playground.

Name matching tolerates small differences: “Homer Depot” matches “Home Depot” in our example workspace. An unfamiliar “Acme Supply” can still be extracted from “at Acme Supply” and passed along as a new vendor name. Neither requires training the action model on that vendor.

Turn the fields into a form

The engine returns an action, intent, and extracted fields. A pure planner resolves names to record IDs and returns a route with prefill values, a choice between matches, or “unknown.”

Interpretaction: "add"
intent: "create_expense"
amount: 85
jobName: "Town Hall"
Resolve + plankind: "open"
url: "/expenses/add/"
project_id: "1"
amount: "85"
Review the form

Expense · $85
Town Hall

SaveThe person confirms.
Simplified objects with fictional record IDs. The planner passes form values as navigation props, rather than creating a record itself.

Two Miller jobs? Ask which one. Conflicting amounts? Ask for clarification. Cancellation and multiple-command guards can stop a command; when the model disagrees with the action-word rules, it needs at least 80% confidence, and remark rules can still block it.

The router opens the existing page or form. The person reviews and saves. Voice does not create a record on its own.

Check the whole path

Saved text-command evaluation · model plus rules
What was checkedResult
Correct action1,218 / 1,265 · 96%
Action-word rules alone1,174 / 1,265 · 93%
Right form or thing557 / 587 · 95%
Details reaching the form698 / 741 · 94%
Correct navigation page50 / 50

These are saved text tests. Form and detail scores cover their own subsets, including only correctly read actions. They don’t measure microphone accuracy or guarantee unfamiliar phrasing will work.

When something fails, we check whether the fix belongs in training, extraction, or planning. A better action classifier won’t fix a dropped vendor field. Keeping those responsibilities explicit makes this small, local system easier to improve.

Implementation snapshot: October 23, 2026 · model baseline-0.1.0. Counts and results come from saved project reports. The playground runs a snapshot of the app’s engine and weights against fictional records.

Written by David Barrar.