Structured Output in the browser with Transformers.js 4.3
- Source
- youtube.com
- Author
- Hugging Face
- Date
Context
Language models sometimes return text that almost, but not quite, matches the format a expects. Transformers.js 4.3, Hugging Face's JavaScript library for running models in the browser, adds a separate package, transformers-structured-output, that hooks into generation, the step where the chooses each next piece of text, and makes sure every piece follows a JSON or regular expression. The video description also links the 4.3.0 release notes.
Constraining generation this way is meant to make the output's shape reliable so code can parse it. It does not make the contents correct, and the short video's description gives no tests of speed or accuracy. Hugging Face also published a longer walkthrough of the same release.
- Program — A set of instructions stored so that a computer can run it.
- Model — A computational system that uses learned patterns to produce an output from information supplied to it.
- Schema — A written description of a data format: which fields exist, what kind of value each holds and which are required.
- Token — A piece of text, such as a word, part of a word or a punctuation mark, that a language model represents as numbers and handles as a unit.
Checking sign-in…
Loading comments…






