MoteML label-spend 0.3.0

Reads one purchase line, such as BRG BALL 6204-2RS 20X47X14, and puts it into one of 25 spend categories. It returns a confidence score and a flag for the lines a person should check.

This is the first model of MoteML's Label family. MoteML builds small models for the three steps of a data pipeline: Read a messy file, Match records that are the same thing, Label each row with a standard category or code.

  • 40 MB. Runs on a laptop CPU, about 11 ms a line one at a time, about 4 ms a line in batches.
  • No API key and no per-line cost. The purchase data stays on your machine.
  • Apache 2.0. English only.

It is built for finance, accounts-payable and procurement software that has to sort purchase lines for spend analysis.

Try it

pip install moteml
import moteml
model = moteml.load("label-spend")
model.predict(["HP LASERJET TONER CARTRIDGE BLACK", "MISC"])

Label a whole file from the command line:

moteml label spend purchases.csv --column description --out labeled.csv

Real output of this version:

Line Category Confidence Flagged for review
HP LASERJET TONER CARTRIDGE BLACK Office supplies, furniture and equipment 0.94
BRG BALL 6204-2RS 20X47X14 Industrial equipment and MRO supplies 0.79
Quarterly pest control service, main warehouse Facility operations, utilities and janitorial 0.85
Microsoft 365 E3 annual renewal 250 seats IT hardware and software 0.74
forklift rental June Equipment and facility rental 0.92
INV 88213 - hvac filtr 20x25x1 qty 48 Industrial equipment and MRO supplies 0.29 yes
Annual elevator maintenance contract Equipment maintenance and installation 0.67 yes
nitrile exam gloves L 100/bx 10 bx/cs Medical and laboratory supplies 0.90
MISC Industrial equipment and MRO supplies 0.12 yes
PO 77812 LINE 3 Office supplies, furniture and equipment 0.27 yes

How good it is

"Labeled without review" is the share of lines the model is confident about at the default setting. "Right among those" is how often those confident answers are correct.

Test Lines Right overall Labeled without review Right among those
Company-style lines, industries the model never saw (4 files, average) 1,917 76.4% 43.2% 95.1%
Real purchase lines typed by California state buyers 1,618 89.6% 59.1% 98.7%
Real federal contract lines, clean labels 1,649 89.8% 57.6% 99.4%
Federal lines checked one by one 266 81.2% 48.9% 96.2%

In plain words: on real public-sector purchase lines it is right about 9 times in 10. On company-style wording it is right about 3 times in 4. At the default setting it labels the lines it is sure of and sends the rest to a person.

The company-style files, one by one. Each was written by a different large model playing five companies from industries that appear in no training line. They include lines no one could classify ("MISC", a bare number), and the last column shows how many of those the model flagged.

Written by Lines Right overall Labeled without review Right among those Junk lines flagged
ChatGPT 510 70.6% 26.3% 98.5% 97.5% of 40
DeepSeek 491 81.5% 54.4% 95.5% 100.0% of 16
Gemini 510 77.5% 44.9% 92.6% 100.0% of 40
Grok 406 76.1% 47.3% 93.8% 100.0% of 24

Against free alternatives

Same test lines, same machine, CPU only, measured on 2026-12-04.

Model Size Scoring Company-style lines California lines Federal lines ms per line
label-spend 0.3.0 40 MB, 33M parameters exact category of 25 76.4% 89.6% 89.8% 3.5
label-spend 0.3.0 40 MB, 33M parameters lenient, 14 broad groups 91.0% 94.6% 94.8% 3.5
spendcoder-distilroberta 82M parameters lenient, 14 broad groups 57.0% 60.4% 57.4% 10.6
GLiNER2.5-small, no training 74M parameters exact category of 25 37.3% 29.5% 34.4% 59.4
GLiNER2.5-Decide, no training 340M parameters exact category of 25 53.7% 48.8% 48.1% 189.4

GLiNER2.5 is a general model that classifies text into any labels it is given. It was used as downloaded, with the 25 category names and no training. Its makers say it can be fine-tuned on a few examples, and that was not tested. spendcoder has 14 broad groups of its own, so it is scored leniently: an answer counts when it is any of its groups that could hold the line. Our model is shown under the same lenient rule next to it.

The review setting

review_below is the confidence under which a line is flagged. Raise it for fewer mistakes, lower it for less manual work. Set model.review_below = 0.57 after loading to change it.

review_below Company-style: labeled Right California: labeled Right Federal: labeled Right
0.4214 78.7% 85.2% 87.5% 94.6% 87.7% 94.5%
0.5171 64.9% 89.7% 78.9% 96.7% 78.5% 96.6%
0.5729 58.0% 91.6% 74.0% 97.3% 72.3% 97.8%
0.6928 (default) 43.2% 95.1% 59.1% 98.7% 57.6% 99.4%

What it was trained on

  • 705,444 distinct purchase descriptions from US federal contract awards, fiscal year 2025 (USAspending.gov, public domain). Labels come from the federal Product and Service Code on each award, rolled up to 25 categories.
  • 133,060 purchase-order lines from California state agencies, 2012 to 2015 (public domain). Their UNSPSC codes were mapped to the same 25 categories.
  • 43,977 company-style lines written by a large open model (Qwen3.8-27B, Apache 2.0) playing companies in 121 industries. Each written line was then shown to the same model without its category, and kept only when the model picked that category again.
  • Filed government codes are often wrong, about 18% in the federal data. The large model gave a second opinion on the most doubtful training rows. A label changed only when that model and a separate cross-check model both disagreed with the filed code.

Suppliers in the test sets never appear in training. No test line was used for training.

Limits

  • No real company's purchase file has tested it yet. The company-style results come from files written by large models. Real exports are messier. If you run it on your own file, add --summary summary.txt and the command line saves counts and percentages with no purchase text in them. We would be glad to see that summary in the Community tab of this page.
  • The company-style test was used twice to compare versions and once to choose the default review setting, so its numbers lean slightly in our favour.
  • The 25 categories follow government spending codes. A company with its own category list has to map these onto it. Some categories fit company buying poorly (aircraft and defense, research and development).
  • Small categories are weaker. Printers and network parts sit on a border between IT hardware, office equipment and electrical components, and the model often picks IT hardware.
  • A vague line made of real words can still get a confident answer. Of the federal lines that cannot be classified from their text, 17.6% were not flagged at the default setting.
  • The "clean" tests keep lines where two sources agree on the label, so they lean toward easier lines. On raw federal lines scored against filed codes as they are, accuracy is 68.8%.
  • The one-by-one label review was done by an AI model, not by a procurement specialist.

Categories

  • Aircraft, ships and defense equipment: weapons, ammunition, aircraft and ship parts, military gear
  • Vehicles, engines and heavy equipment: cars, trucks, tractors, cranes, forklifts, engines and vehicle parts
  • Industrial equipment and MRO supplies: hand and power tools, hardware, fasteners, pumps, valves, pipe, bearings, shop machinery
  • Building and construction materials: lumber, concrete, tile, paint, sheet metal, prefab buildings, landscaping materials
  • Electrical and electronic components: wire, connectors, breakers, lighting, generators, radios, alarms, electronic parts
  • Medical and laboratory supplies: drugs, medical and dental devices, surgical supplies, lab instruments and reagents
  • Fuels and chemicals: fuel, oil, lubricants, gases, industrial chemicals
  • IT hardware and software: computers, servers, network gear, software licenses and renewals
  • Office supplies, furniture and equipment: paper, pens, toner, furniture, office machines, books, packaging
  • Food and kitchen: food, drinks, catering supplies, kitchen and food-service equipment
  • Cleaning and janitorial supplies: cleaners, wipes, mops, soap, paper towels, toiletries
  • Clothing, textiles and safety gear: uniforms, footwear, fabric, protective and fire or rescue gear, holsters and duty gear
  • Recreation and miscellaneous goods: sports and recreation gear, musical instruments, anything that fits nowhere else
  • Research and development: contracted research, studies that create new knowledge, prototypes
  • Professional and management services: consulting, legal, financial, staffing, program support, analysis, administrative services
  • Construction and building repair: construction, renovation, building repair, architecture and engineering design
  • IT and telecom services: IT support, software development, hosting, internet, phone and data circuits
  • Environmental and social services: environmental cleanup, forestry and wildfire services, social programs, insurance
  • Equipment maintenance and installation: repair, maintenance, calibration, inspection or installation of equipment
  • Facility operations, utilities and janitorial: janitorial, grounds, security guards, waste, utilities, food-service operations
  • Medical services: doctors, nurses, clinical and care services
  • Printing, media and photography: printing, publishing, photography, video and mapping services
  • Training and education: courses, tuition, seminars, memberships tied to training
  • Travel and transportation: lodging, travel, freight, shipping, passenger and ambulance transport
  • Equipment and facility rental: lease or rental of equipment, vehicles, space or buildings

How it works

Two parts, averaged (0.4 to 0.6): a fine-tuned MiniLM-L12 (33M parameters, 8-bit ONNX) and a word-count model (TF-IDF over 300,000 words and word pairs with a linear layer). The first reads meaning. The second keeps the confidence score honest.

Check the numbers yourself

Every test file, the prompts that produced the company-style files, and a script that recomputes the tables on this page: https://huggingface.co/datasets/moteml/label-spend-bench

Questions, wrong labels, or a summary from your own file: open a discussion in the Community tab of this page.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for moteml/label-spend