Sort a customer message
Type something a customer might write. A small model trained in TrainLocal files it as a complaint, praise or a question. It runs in this browser tab; what you type is not sent anywhere.
Answer
The answer appears here, with how sure the model is about each category.
Sorted so far
Each message you sort lands in its tray. Reloading the page empties them.
Praise 0
Question 0
None of these 0
How this page was made
-
Train
In TrainLocal, the built-in sample was opened: three categories with twelve example sentences each. Training took a few seconds, in the browser.
-
Download
The Export step gave a folder: the trained model (13 KB), a loader script, and a copy of the ready-made language model it builds on. Those files are in this site as they came.
-
Use
Three lines put the model on a page:
import { loadModel } from './trainlocal-loader.js'; const model = await loadModel('./sample-customer-messages.trainlocal.json', { baseModelPath: './base-model/' }); const result = await model.classify('Can I pay by bank transfer?');
Good to know
- What it was taught
- 36 short sentences. It is a sample, so expect it to be wrong now and then, most often on praise and complaints that share words.
- “None of these”
- A message unlike anything it was taught, or one it cannot decide on, gets no category rather than a guess.
- What this page contacts
- This site, for the model files, and cdn.jsdelivr.net, for the open-source library that runs the model. Nothing you type leaves the tab.
- Make your own
- The whole page is in a public repository. Swap in a model you trained and change the tray names.