GLiNER.cpp: Generalist and Lightweight Named Entity Recognition for C++ with Python bindings
Forked from: https://github.com/Knowledgator/GLiNER.cpp --> see there for the original repo
GLiNER.cpp is a C++-based inference engine for running GLiNER (Generalist and Lightweight Named Entity Recognition) models. GLiNER can identify any entity type using a bidirectional transformer encoder, offering a practical alternative to traditional NER models and large language models.
TlDr;
# clone the repo
cd GLiNER.cpp && python -m pip install .
Example
ONNX model example
import gliner_cpp
import time
cfg = gliner_cpp.Config(12, 512)
MODEL_PATH = "./models/model.onnx"
TOKENIZER_PATH = "./models/tokenizer.json"
start = time.time()
model = gliner_cpp.Model(MODEL_PATH, TOKENIZER_PATH, cfg)
end = time.time()
print(f"Loading model took: {end - start} seconds")
test = "The capital of France is Paris. I visited last in September last year."
entities = ["LOCATION", "COUNTRY", "DATE"]
start = time.time()
spans = model.inference([test], entities)
for span in spans:
print(span)
end = time.time()
print(f"Inference took: {end - start} seconds")
Release files for gliner-cpp 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gliner_cpp-0.1.tar.gz | 914.3 kB | Details |
Built distributions (wheels)
Total release size:236.6 MB
Release files / gliner_cpp-0.1.tar.gz
| Download URL | gliner_cpp-0.1.tar.gz |
|---|---|
| Size | 914.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eea96f1a4bf82b2f31a4709c6f3039d0e87e1fb69453f0ce5c48e1213e2d3a1d
|
|
BLAKE2b-256 checksum How to use checksums |
dd292ce54cdc9c2d34045762c6ffa10ba38bee534133c2dadf19ae6e02017d50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | gliner_cpp-0.1-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
33fdef62f4de9036aa2afa94eaff570a13184226b6d0ae9687f278cfc2d6e3dc
|
|
BLAKE2b-256 checksum How to use checksums |
dd088119e83a5b90b66caee9b668c72129876550f2c68393151a6955048c32ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | gliner_cpp-0.1-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
4a457f097b96b7b73b16c675e8aabb6a936087503ab0cdb136f8ddb10b36a6a4
|
|
BLAKE2b-256 checksum How to use checksums |
110a7f46a095a40b39cf40712041774b6c51f531083be182ad6b7a85dac0aa02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | gliner_cpp-0.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.3 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d8534a6181208f3a80f9165afc4f8375c7344a816383981d2338fcb18d9625e6
|
|
BLAKE2b-256 checksum How to use checksums |
e58e6b3174fa8bd2d74c32b794a0a8ca8ceb833dbdaf6b7d22f432f568feaa7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / gliner_cpp-0.1-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | gliner_cpp-0.1-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
774b83351a6cbf5f40f1ca7f6f34a0a130123ba931bddb01b79edfcba4354ca2
|
|
BLAKE2b-256 checksum How to use checksums |
a9578082139c340b1c0a184e72166ed56b689e0b6de77d596f7dfac8ec2b5f13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | gliner_cpp-0.1-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
ca34701bbadee8cfde8fa3d1eac639ab1fc7ffa9671f41ee19a34fd66eef5917
|
|
BLAKE2b-256 checksum How to use checksums |
6c08dd588174e0b5916b7d014d7035d27518fb7156c3e17cc6c41e5797999ecb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | gliner_cpp-0.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.3 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b929292e714e4241d4051e0995b14e4bbf6b0d03f53ac047d96d812b2c8d1dab
|
|
BLAKE2b-256 checksum How to use checksums |
71efa9afa3eec4fc39819cde5de19ee1011fca450e8d0f4ffd5512a36891f8b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / gliner_cpp-0.1-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | gliner_cpp-0.1-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
ade33adbcf777138b8b2edb43e284663d35666d233791e512665266b748b48a7
|
|
BLAKE2b-256 checksum How to use checksums |
f05ae78570f18b73b54915f5188df156415603bc667e4fd6294a40f9cd136d1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | gliner_cpp-0.1-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
de9483702aa9a608d58ba36a3c01eb2c47e7a9c3bec22b258193e478afb25c79
|
|
BLAKE2b-256 checksum How to use checksums |
24f41ac8eceaecbb9d5514eb46a7bccaddf0a50b98ce94454f851d2816dd2baf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / gliner_cpp-0.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | gliner_cpp-0.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.3 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c4badfe12ddcaf2c3398f33ecf16516d7627c907495a730b17f59343006b1c96
|
|
BLAKE2b-256 checksum How to use checksums |
9764f377cd65cdb83d1a2bf5673cf34b7c93c6192283833186c5e5c26859fa8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|