Added
- Support for loading ONNX variants of GLiNER models ([amitness](https://github.com/amitness)) - [#24](https://github.com/theirstory/gliner-spacy/pull/24)
- New configuration options:
- `load_onnx_model`: Enable ONNX model loading
- `onnx_model_file`: Specify path to ONNX model file
Performance
- ~5x faster inference when using ONNX models compared to PyTorch versions
Usage Example
python
custom_spacy_config = {
"gliner_model": "onnx-community/gliner_base", or "amitness/gliner_base"
"chunk_size": 250,
"labels": ["people", "company"],
"style": "ent",
"load_onnx_model": True,
"onnx_model_file": "onnx/model.onnx"
}
Compatible Models
- All GLiNER models have ONNX variants available at [onnx-community on Hugging Face](https://huggingface.co/onnx-community?search_models=gliner)
Contributors
- [amitness](https://github.com/amitness) - [#24](https://github.com/theirstory/gliner-spacy/pull/24)
v.0.0.8
- Fixes minor bug that assigned score when some spans were unaligned in the spaCy doc container
- Adds entry point to spacy so that you do not need to import the GlinerSpacy class to add it to a spaCy pipeline