Download the PHP package kirschbaum-development/redactor-onnx without Composer
On this page you can find all versions of the php package kirschbaum-development/redactor-onnx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kirschbaum-development/redactor-onnx
More information about kirschbaum-development/redactor-onnx
Files in kirschbaum-development/redactor-onnx
Package redactor-onnx
Short Description In-process named entity recognition for kirschbaum-development/redactor, running an ONNX model through TransformersPHP with no sidecar.
License MIT
Informations about the package redactor-onnx
Kirschbaum Redactor ONNX
Redactor ONNX gives Kirschbaum Redactor an in-process named entity recogniser. It runs a token classification model through TransformersPHP inside the PHP worker, so the redactor can find names, places and organisations in prose with no sidecar to deploy and no network call to wait for.
The recogniser registers as the onnx driver. Everything else stays the redactor's: the gates that keep JSON and stack traces away from the model, the offset check, the circuit breaker, batching, operators and profiles.
Quick Start
Install the package, then download and load the model once so no job pays for it:
Select the driver in any profile's recognition block in config/redactor.php:
Then redact as usual:
How It Works
The model labels tokens, and the runtime reports no character offsets, so the recogniser finds each decoded token in the original text and folds the model's BIO labels into spans with exact offsets. Long texts are cut at whitespace into windows the model can hold in full, and every prose value the redactor gathers from a payload goes through the model in one batched call. Model labels such as PER are mapped to the names the redactor's profiles already use, such as PERSON.
The model loads on the first call and stays in memory, so the driver belongs in queue workers, Octane, exports and redactor:scan, where a process lives long enough to amortise the load.
Documentation
The full documentation lives in docs/:
| Page | What it covers |
|---|---|
| Getting Started | Requirements, installation, selecting the driver, warming the model, and where to run it. |
| Configuration | Every key in config/redactor-onnx.php with its type, default and environment variable. |
| How It Works | Alignment of tokens to characters, windows, batching, labels and failures. |
| Models | Choosing a model, tokenizer marks, memory and speed. |
| Testing | Faking the classifier in your suite, the opt-in real-model test, the package's own conventions. |
Requirements
- PHP 8.3, 8.4 or 8.5 with the
ffiextension - Laravel 12.x or 13.x
kirschbaum-development/redactor
Testing
See Testing for the opt-in test that downloads and runs the real model.
Changelog
See CHANGELOG.md.
License
MIT License. See LICENSE.md for details.
All versions of redactor-onnx with dependencies
ext-ffi Version *
illuminate/support Version ^12.0|^13.0
kirschbaum-development/redactor Version ^1.0
codewithkyrian/transformers Version ^0.6