| Model | FP32 | INT8 | Task |
|---|---|---|---|
| gliner_multi-v2.1 | model.onnx | model_quantized.onnx | named entity recognition |
# onnxruntime-gpu for run it on GPU
pip install onnxruntime sentencepiece numpy protobuf
Every model folder has the same layout:
src/helper.py = onnx session builder (provider selection, threads, memory options)src/example.py = full pipeline: word split, sentencepiece tokenization, span enumeration, inference, greedy non-overlap selectiononnx/ = the model fileRun the commands from the repository root.
python3 gliner_multi-v2.1/src/example.py
0.970778 | person | Linus Torvalds
0.603953 | organization | Linux
0.978727 | place | Helsinki
0.859634 | organization | Linux Foundation
0.944801 | person | 田中太郎
0.674417 | organization | 東京大学
0.953844 | place | Tokyo
Note:
spm.model loaded via proto with the patchnormalizer_spec.add_dummy_prefix = False (required for the word-level alignment).[cls] [ent] type... [ent] type... [sep] word... [eos], with [ent] = 250103, [sep] = 250104.words_mask marks the first subword of each word with the word number (1-based), 0 elsewhere.\d|\D+), CJK characters are split one word each.gliner_multi-v2.1/onnx/model.onnx 1.1 GiBgliner_multi-v2.1/onnx/model_quantized.onnx 333 MiB