Skip to main content

Python bindings for the GLiNER C++ inference library

Project description

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")

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gliner_cpp-0.1.tar.gz (914.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gliner_cpp-0.1-cp312-cp312-musllinux_1_2_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

gliner_cpp-0.1-cp312-cp312-manylinux_2_34_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

gliner_cpp-0.1-cp312-cp312-macosx_11_0_arm64.whl (34.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gliner_cpp-0.1-cp311-cp311-musllinux_1_2_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

gliner_cpp-0.1-cp311-cp311-manylinux_2_34_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

gliner_cpp-0.1-cp311-cp311-macosx_11_0_arm64.whl (34.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gliner_cpp-0.1-cp310-cp310-musllinux_1_2_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

gliner_cpp-0.1-cp310-cp310-manylinux_2_34_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

gliner_cpp-0.1-cp310-cp310-macosx_11_0_arm64.whl (34.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file gliner_cpp-0.1.tar.gz.

File metadata

  • Download URL: gliner_cpp-0.1.tar.gz
  • Upload date:
  • Size: 914.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for gliner_cpp-0.1.tar.gz
Algorithm Hash digest
SHA256 eea96f1a4bf82b2f31a4709c6f3039d0e87e1fb69453f0ce5c48e1213e2d3a1d
MD5 816921aa144cbf7aae1850c664e3cb7f
BLAKE2b-256 dd292ce54cdc9c2d34045762c6ffa10ba38bee534133c2dadf19ae6e02017d50

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 33fdef62f4de9036aa2afa94eaff570a13184226b6d0ae9687f278cfc2d6e3dc
MD5 d470df1eacfc165df28bcefc71c15007
BLAKE2b-256 dd088119e83a5b90b66caee9b668c72129876550f2c68393151a6955048c32ba

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4a457f097b96b7b73b16c675e8aabb6a936087503ab0cdb136f8ddb10b36a6a4
MD5 eda3f29bf5f36a4b8dac621696525fa0
BLAKE2b-256 110a7f46a095a40b39cf40712041774b6c51f531083be182ad6b7a85dac0aa02

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8534a6181208f3a80f9165afc4f8375c7344a816383981d2338fcb18d9625e6
MD5 06c2d9eb9f9d5b0a171434f47bfa24ec
BLAKE2b-256 e58e6b3174fa8bd2d74c32b794a0a8ca8ceb833dbdaf6b7d22f432f568feaa7f

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 774b83351a6cbf5f40f1ca7f6f34a0a130123ba931bddb01b79edfcba4354ca2
MD5 38bb4af3d439348dfc0279e60afddc91
BLAKE2b-256 a9578082139c340b1c0a184e72166ed56b689e0b6de77d596f7dfac8ec2b5f13

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca34701bbadee8cfde8fa3d1eac639ab1fc7ffa9671f41ee19a34fd66eef5917
MD5 70d979d5f30723eacdca69880c4c8aa5
BLAKE2b-256 6c08dd588174e0b5916b7d014d7035d27518fb7156c3e17cc6c41e5797999ecb

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b929292e714e4241d4051e0995b14e4bbf6b0d03f53ac047d96d812b2c8d1dab
MD5 7523b8fdce675dda8ca688da775dfc57
BLAKE2b-256 71efa9afa3eec4fc39819cde5de19ee1011fca450e8d0f4ffd5512a36891f8b0

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ade33adbcf777138b8b2edb43e284663d35666d233791e512665266b748b48a7
MD5 6212153f28bcddafa022e6b098c19964
BLAKE2b-256 f05ae78570f18b73b54915f5188df156415603bc667e4fd6294a40f9cd136d1b

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 de9483702aa9a608d58ba36a3c01eb2c47e7a9c3bec22b258193e478afb25c79
MD5 47b00bfea0d8fde2ce9a9aa969262b3e
BLAKE2b-256 24f41ac8eceaecbb9d5514eb46a7bccaddf0a50b98ce94454f851d2816dd2baf

See more details on using hashes here.

File details

Details for the file gliner_cpp-0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gliner_cpp-0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4badfe12ddcaf2c3398f33ecf16516d7627c907495a730b17f59343006b1c96
MD5 ad6d56a8d637e26d25035ae4d5460989
BLAKE2b-256 9764f377cd65cdb83d1a2bf5673cf34b7c93c6192283833186c5e5c26859fa8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page