Skip to main content

Python bindings for gline-rs: Inference Engine for GLiNER Models, written in Rust

Project description

fast_gliner: Python bindings for gline-rs (Inference Engine for GLiNER Models, written in Rust)

⏳ Installation

$ pip install fast_gliner

🚀 Quickstart

Named Entity Recognition

from fast_gliner import FastGLiNER

model = FastGLiNER.from_pretrained(
    model_id="onnx-community/gliner_multi-v2.1",
    onnx_path="onnx/model.onnx"
)

model.predict_entities("I am James Bond", ["person"])

Output:

[
    {
        'text': 'James Bond',
        'label': 'person',
        'score': 0.9012733697891235,
        'start': 5,
        'end': 15
    }
]

Relation Extraction

from fast_gliner import FastGLiNER

model = FastGLiNER.from_pretrained(
    model_id="onnx-community/gliner-multitask-large-v0.5",
    onnx_path="onnx/model.onnx"
)

text = "Bill Gates is the founder of Microsoft."

labels = ["person", "organization"]

schema = [
    {
        "relation": "founder",
        "subject_labels": ["person"],
        "object_labels": ["organization"]
    }
]

results = model.extract_relations(text, labels, schema)

from pprint import pprint
pprint(results)

Development

Set up environment

$ cd fast_gliner/bindings/python
$ make dev

Run code formatting

$ make style

Release package to PyPI

$ make
$ make release

References

[1] GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer.

@inproceedings{zaratiana-etal-2024-gliner,
    title = "{GL}i{NER}: Generalist Model for Named Entity Recognition using Bidirectional Transformer",
    author = "Zaratiana, Urchade  and
      Tomeh, Nadi  and
      Holat, Pierre  and
      Charnois, Thierry",
    editor = "Duh, Kevin  and
      Gomez, Helena  and
      Bethard, Steven",
    booktitle = "Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)",
    month = jun,
    year = "2024",
    address = "Mexico City, Mexico",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.naacl-long.300",
    doi = "10.18653/v1/2024.naacl-long.300",
    pages = "5364--5376",
    abstract = "Named Entity Recognition (NER) is essential in various Natural Language Processing (NLP) applications. Traditional NER models are effective but limited to a set of predefined entity types. In contrast, Large Language Models (LLMs) can extract arbitrary entities through natural language instructions, offering greater flexibility. However, their size and cost, particularly for those accessed via APIs like ChatGPT, make them impractical in resource-limited scenarios. In this paper, we introduce a compact NER model trained to identify any type of entity. Leveraging a bidirectional transformer encoder, our model, GLiNER, facilitates parallel entity extraction, an advantage over the slow sequential token generation of LLMs. Through comprehensive testing, GLiNER demonstrate strong performance, outperforming both ChatGPT and fine-tuned LLMs in zero-shot evaluations on various NER benchmarks.",
}

Project details


Download files

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

Source Distribution

fast_gliner-0.2.1.tar.gz (180.3 kB view details)

Uploaded Source

Built Distributions

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

fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-cp312-cp312-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fast_gliner-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fast_gliner-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fast_gliner-0.2.1-cp310-cp310-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

fast_gliner-0.2.1-cp39-cp39-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

fast_gliner-0.2.1-cp39-cp39-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file fast_gliner-0.2.1.tar.gz.

File metadata

  • Download URL: fast_gliner-0.2.1.tar.gz
  • Upload date:
  • Size: 180.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fast_gliner-0.2.1.tar.gz
Algorithm Hash digest
SHA256 40a3889e3c9c448f3557ec7e18e92649a0a479f31f29f9a8b48c5a8fdf2a6b94
MD5 9daf85d964a6b6fe324e9eb348193144
BLAKE2b-256 a59e29f7949d448fdbd44793fb966dbf850b3c417e5b49b7e97676a859987240

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ca0330ce93d3d2d169d5088d075361c30ce0cc4a16705672ffc8ca12631324d5
MD5 885c06859b31dd7cd0aeec1076724cfa
BLAKE2b-256 6edd7140c5b44a2918e969cabd6801f408be8856a785b3806d3b6bc5e36000e0

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 26c474f8777540a03d7c750fdf5ae635b2561b90a5928feefeaa4e4ae9bbd119
MD5 85de0da381f85ee3b54e22c4f1a99666
BLAKE2b-256 28b406152f1bdadd4f006aa78956c69b4182956f5082123a943dcc7107af1b2a

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c553861f5b395bedbdc5d7c9ba7e5420fb8440da578003ac9c4d08a6d3e05c08
MD5 516a7df3beaa5f4700d7701ca4dfb7a7
BLAKE2b-256 f40d1098b9b306904399bb1e83fe04a1064061d8d31b810e3dc2b59fc08985a5

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f09e9e660eaf189c8f42cedd20cea395c1559282b57ac4a0680ac4b6bf5fee9e
MD5 e05e1ff3abe307b88465c6240d67d1c1
BLAKE2b-256 d2d9b2b86ea1a42a8be7c5336230a15a11023d86358121519b6676ddd3a67732

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d936a3f8044301d2f2d020c8a31a0c514ea961e3866c1c81bf4264b2ecbbf8ae
MD5 bd221b663d724bc89e12cc7762587434
BLAKE2b-256 833e238417c34e58c9fe18a8c3a6aeb01d6854dcb2ef6ae653390ccfec20d799

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 02518c1dca5bac9a7bca5e5633620045355ac514dc92ba8df3943716826a7798
MD5 f38049fde3b3c42bf0c046020ad369f1
BLAKE2b-256 4e104385d34bcf8fe32779699f4349daa0f01d1aea8ca450487835bcfecf7a3c

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 287dc6a280678d696a9e70ea86a97019676ed6249c631a6857c7eaa9b1ccf344
MD5 a243304bc4e67d2e204b9e1a0be30a11
BLAKE2b-256 43dd508e44ebe55a70e7c3dd869feea969fbb6f61ac4eb6d45b6a2fc35e9d593

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a593f4fbe31920f76dde41f29be86e8360c3b0955711be00dcafa3b681650e30
MD5 804d1371300c910e2fdae2be1099e137
BLAKE2b-256 ffe50bcfcc400d152edd7955283935e78fe3577d7508fd07d67cbeef3e7de5d6

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3496cb6b62ded91e504240706fd8056cccc7576a0607ecbb60430df589a6659f
MD5 889bb606529c8927ff79e57bbc555979
BLAKE2b-256 aadaafb467ddd3216d1ff7f7c6f0c81de7b288eba19a4e8b13f20a3f4bce1426

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3a3414b3224ac155b731c75c90c2eed7815c652a47f7f66125c125736925eaa8
MD5 20bd8957afbb2a4c6d7be193c017715d
BLAKE2b-256 13053ec79f57d276c652a7a2be4d01babb1ffa4df11f48ffaeb01ed3e7c7b172

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75a8aab1713fa688fb9f1fe95a541d12f2df40bccc85298d227ce09db2238781
MD5 e09c0a75e24d2469ff43a8d85906f91b
BLAKE2b-256 f696e90030d9016a2b0fe38fb3624c1829e7a7645b4d922eae05e3c1bc73b225

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b69657ff43427de1fc6e907473ef6663116cc7f6719f9a6147908cbcc823ec0
MD5 e48c2aa6d3c8180ffa5c5e015e33ecf3
BLAKE2b-256 5e38bb1b6db1f7193273d299d315408c94d0ef6a6b56f17e9e04916b3bd10383

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29e4aaffa5c3efc456b57b84172be45db742b0a85a126da7678a879f57fac630
MD5 9db129b6cda49879d15f1688c53064cd
BLAKE2b-256 1ced9868bfa3be2e5c9a8a61592b180495ec5fbe7ae8c61ca7a6eb49095437dd

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4d60d6768ab762bbb14604674dd27396587634c8839ccfa6efd626b169dcc8f2
MD5 e7e62dcaa765a77ee7e07c356bf17a63
BLAKE2b-256 b3303d700a2035dba77a8f329962def5f8ddcd9a85dfa741bb9664093b94129a

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7fb73c192acb4c0386cc9b0e740b24e5d2485f3343ae45f79184e6535927f23c
MD5 ea53615e9c6b8ca0956293ea3691a06b
BLAKE2b-256 27751d6b43be7456bf85adcc11c6fda0390d93690c1286582d12f36ab7474795

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 883d3aa792db761fba1e7f126ce90fe88b395861ceafa9c9c9296097dfb29514
MD5 671e824dd4c9511cc9c303ffc6db6308
BLAKE2b-256 6bf942a8fc6c24fcaa0b99248c2ebba228026c39732f975fe8896ec8b18b1fc1

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3c8746edaab31ac99d2613a898116274168ea26908dc6ae2a2bc64b3cf948a9
MD5 9379b9901c8f7b0c7c90347214388907
BLAKE2b-256 01d1b399da1e3b0208f12bb47c4bac423c5b3cc5dc6cdf68987b525e8dfa1094

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 75090df1e7255c71c2ef963f52fd7230b268b12dc9fe8c38e73a6144d2c1478f
MD5 0ec1d1aa640a3ce70e728882e4589953
BLAKE2b-256 7f5150b667948aeeb773c22c49fbab28abe40104a4b98cfb7b4b9d85017e1f0e

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c901c5c1131cdb3e799d694a13643be839166cafc21a3ca8caa0e41ff7b8fb81
MD5 1ae354457249b66c0a055771d3a3c3de
BLAKE2b-256 3f2a8b53cac2161a17c8d523602198a7bcd7259ee1166de0de946aec67d1cbd4

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 06f10325a4aea09268920997fda24d063684b42ab076f0b82dae06089508635d
MD5 8fcc81340cb4eb7863cf7dac3018a011
BLAKE2b-256 9f00a27a723279dd9a8ec8905addf3f0c2b9d52237e398237314b002c0b28bfd

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2d74e822d86bb762ed86dcde9bdcf5f47c90b3fd054c0a9082232e5c7783282b
MD5 7e04c9069b94483d3d6608159c5c3575
BLAKE2b-256 bf6ac19a8c62a2fba3bac1b4e043000de2ed1f1fad1ccb4b4ba82abc04ea5b73

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c6243f75915d645a5a3f5dee4a362d853c947fe98e4763169a7366d3f58d9eea
MD5 345fef2f818b91132767c9183734a90d
BLAKE2b-256 e4af7bc7b7b81eb66ca5996c5468b7b390382cffa3d638268f885859c8445f37

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9eb473ea58af3a584b0a49bf8d5b0e6832ee20206f4cf263a48858f878fd3bf
MD5 52062a21c07044c9761a4cb3b85ccbea
BLAKE2b-256 c99028320487cc8b3cd2119e76dde1f4b39c8b2d74cd8bb3210970cdb4cc78b5

See more details on using hashes here.

File details

Details for the file fast_gliner-0.2.1-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fast_gliner-0.2.1-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a845e9ff08f780ab9c83fd513978585d035042279b9c123612646975b56a8cb6
MD5 7097a56c5c01ba0f1c77b3e18782a607
BLAKE2b-256 aa6c9453bfe52adef5ae5f6a9d2fb5668fb664f80c9d217fc51504e10d6a9778

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