A fast and simple NER tool
Project description
Quickner is a new tool to quickly annotate texts for NER (Named Entity Recognition). It is written in Rust and accessible through a Python API.
Quickner is blazing fast, simple to use, and easy to configure using a TOML file.
Installation
pip install quickner # or pip3 install quickner
Usage
from quickner import Quickner
# Initialize the annotator
quick = Quickner() # or Quickner("config.toml") if the config file is not in the current directory
# Annotate the texts using the config file
quick.process() # or annotator.process(True) to save the annotated data to a file
quick.to_jsonl("annotations.jsonl") # save the annotations to a jsonl file
quick.to_spacy("annotations.spacy") # save the annotations to a spaCy file
Load from file
Initialize the Quickner object from a file containing existing annotations.
Quickner.from_jsonl
and Quickner.from_spacy
are class methods that return a Quickner object and are able to parse the annotations and entities from a jsonl or spaCy file.
from quickner import Quickner
quick = Quickner.from_jsonl("annotations.jsonl") # load the annotations from a jsonl file
quick = Quickner.from_spacy("annotations.json") # load the annotations from a spaCy file
Single text annotation
from quickner import Document, Entity
# Create a document from a string
rust = Document.from_string("rust is made by Mozilla")
# Create a list of entities
entities = [Entity("Rust", "Programming Language"), Entity("Mozilla", "ORG")]
# Annotate the document with the entities, case_sensitive is set to False by default
rust.annotate(entities, case_sensitive=True)
>>> rust
Document(id=0, text=Rust is made by Mozilla, label=[(0, 4, Programming Language), (16, 23, ORG)])
## Configuration
The configuration file is a TOML file with the following structure:
```toml
# Configuration file for the NER tool
[general]
# Mode to run the tool, modes are:
# Annotation from the start
# Annotation from already annotated texts
# Load annotations and add new entities
[logging]
level = "debug" # level of logging (debug, info, warning, error, fatal)
[texts]
[texts.input]
filter = false # if true, only texts in the filter list will be used
path = "texts.csv" # path to the texts file
[texts.filters]
accept_special_characters = ".,-" # list of special characters to accept in the text (if special_characters is true)
alphanumeric = false # if true, only strictly alphanumeric texts will be used
case_sensitive = false # if true, case sensitive search will be used
max_length = 1024 # maximum length of the text
min_length = 0 # minimum length of the text
numbers = false # if true, texts with numbers will not be used
punctuation = false # if true, texts with punctuation will not be used
special_characters = false # if true, texts with special characters will not be used
[annotations]
format = "spacy" # format of the output file (jsonl, spaCy, brat, conll)
[annotations.output]
path = "annotations.jsonl" # path to the output file
[entities]
[entities.input]
filter = true # if true, only entities in the filter list will be used
path = "entities.csv" # path to the entities file
save = true # if true, the entities found will be saved in the output file
[entities.filters]
accept_special_characters = ".-" # list of special characters to accept in the entity (if special_characters is true)
alphanumeric = false # if true, only strictly alphanumeric entities will be used
case_sensitive = false # if true, case sensitive search will be used
max_length = 20 # maximum length of the entity
min_length = 0 # minimum length of the entity
numbers = false # if true, entities with numbers will not be used
punctuation = false # if true, entities with punctuation will not be used
special_characters = true # if true, entities with special characters will not be used
[entities.excludes]
# path = "excludes.csv" # path to entities to exclude from the search
License
MOZILLA PUBLIC LICENSE Version 2.0
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Authors
- [Omar MHAIMDAT]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for quickner-0.0.1a5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7671d6708c5b900d08b1ac1bf3b51fccd30c47db83c2f914e37d732ff52bdd1d |
|
MD5 | 80d6a7c14f2a3d9a2738218162be9f2e |
|
BLAKE2b-256 | abdd2524225ded13ec50d3faab14d8afdba16781f97c793cac6daa629fbdf683 |
Hashes for quickner-0.0.1a5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25670d23fdbd1f3b57614a4befdecb9ff09d2bbbc5686b5a91283cc1e236d413 |
|
MD5 | f0e628ec2579732a00f5fbad1121575b |
|
BLAKE2b-256 | 307ac40fb96bb59d7386f1a0c771e8107a826bc1975243bf4f2881abb4e2da59 |
Hashes for quickner-0.0.1a5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812ed385ad305e3bfee9dc83cfb90d4334f7d73aaa5ece96e373ee5506ab11e2 |
|
MD5 | 56d00e549411faff3f263369ca95fd53 |
|
BLAKE2b-256 | 589be84b8a0ec8ecffd22b1aa9630dafc43a968b8a68b7b1a7dbde04d8732ded |
Hashes for quickner-0.0.1a5-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a280df9659f1144c05b849d9d0b87d012755c9b9ce37d48f264024ea7b47a6f6 |
|
MD5 | b831056105feada38c34e1858cd3c1e4 |
|
BLAKE2b-256 | 2deca41f8a435e93817020c35d071b151e4ec6ca216bba881066f147f8c9ce34 |
Hashes for quickner-0.0.1a5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93463576ec5c4ab400258a3d9c662d07d41e7cab42a27f6860fdea652979de89 |
|
MD5 | 23b5f55837bc366b071eb4d889b67401 |
|
BLAKE2b-256 | afa665449665e9a7f889e328e76e3939fd6a9fa279845be84fce4456466d886b |
Hashes for quickner-0.0.1a5-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d07be1721dc93257589158c8cbd451933b36e3aaa133304c483161ed71db034 |
|
MD5 | e85620f229948a0c8068e0494cedd09c |
|
BLAKE2b-256 | ac31e70bf659fb59a6ca0bd716d80074cb8d73f97538a0bb89c660ea82cff2c3 |
Hashes for quickner-0.0.1a5-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 353bf9eb6e51a56dc4e3d3dc45110f59c22b653e8099ae1b1a44c232a2656bfe |
|
MD5 | ed5638994da76405e95909ae9cd6f91f |
|
BLAKE2b-256 | c0ddd5b5f8041b68889c9cb03c89240fe2c62c685fccc1a1a46636fd578904d4 |
Hashes for quickner-0.0.1a5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812497048b6c770b1b28bdac9f43ab66f2c140d12ec4e1d297332fe28854718c |
|
MD5 | 0d16026df143dde61b5342670558b5cc |
|
BLAKE2b-256 | 9f7ace0ab496296ec77dd828f76c34fe8047aa30413c9f06e237da653b3c9287 |
Hashes for quickner-0.0.1a5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 160cb3b12b8c1026e741b773f2b689e082bc2325b705316247d5e98b46634afa |
|
MD5 | 2ddf4abf6591ce7ca53a695414883841 |
|
BLAKE2b-256 | 2209fd41662aa9967dbde528daa92780ffec9d6345d95db03cb8bcaad9227315 |
Hashes for quickner-0.0.1a5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a92df49628d70b185c768cc8c9412220975dc0cfa7e3f77c8308979a6d9b86 |
|
MD5 | 6554b60c3cf02eb96610b912d240f904 |
|
BLAKE2b-256 | fc47b21f866ffac7aa14c69fa7ebba1d65711406c46523c4118af8d413f723fa |
Hashes for quickner-0.0.1a5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02afe243f4a66b3d551b7e675f90f4313cfc681c57a0b8cb8b56acb990463c71 |
|
MD5 | 61bab4a9f6cb7dbfde6b51068fe87706 |
|
BLAKE2b-256 | 7d9fc093c86af69f4312d7208c3abe88b24bd307f58571987808599edc97e02c |
Hashes for quickner-0.0.1a5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872f276e11d0bdabe503eed8f78fc5a61846eb6568e6fba85532f6cc52a4af8b |
|
MD5 | 55d6d1b8addbc5f9b3b2b71b9f5cead1 |
|
BLAKE2b-256 | 4f9b5df6bc425adf64e5da72d319de4fe01291e28041c67085a9bec6eff82508 |
Hashes for quickner-0.0.1a5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0fe3d8b61996dc7f7e7ebe2c60f16bbb6634054d8e159c37830e3add7ab14ad |
|
MD5 | 5f1c5a27cee7dce58068170473f31d4a |
|
BLAKE2b-256 | 7ec8a04f1f3976eeadd7c91bab81a6604dd21b12ee060cc073aa01181b75de82 |
Hashes for quickner-0.0.1a5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8c9c220309e9dc3752f59030eb5322b5cf451bc8c62c470190bb9d71ac0e51 |
|
MD5 | 64e39b6ba3a9910f230901b0e3250c73 |
|
BLAKE2b-256 | ad515384bd519b4b52680fb33331e7364debb6910e3c18dca293fe0e246a3b2b |
Hashes for quickner-0.0.1a5-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef62d63751650b9a79f4895f4df250bb558c163b10fb318e3b1e3f7414f38790 |
|
MD5 | d4233fc7b72cf273011da4b8d37c2e4d |
|
BLAKE2b-256 | ae0b1e078888ac34ee424612238b5f65506f6b889dc668fe4dc444fbc85973f0 |
Hashes for quickner-0.0.1a5-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70f78f8335244acae5829e8f16b3fa65d59a6648490d7984c9abf50b85fa35c |
|
MD5 | a79fe33a11117491b9f8b490ae36b85a |
|
BLAKE2b-256 | 8073d71327835267cefaddc67f8e2aba0b4cba9fb832e89ae683bbb5c2d3e446 |
Hashes for quickner-0.0.1a5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f8ee2ec12f52fbc2a921e10d0c7e7a350adf00b3bae8bdcb657576781a29924 |
|
MD5 | 797d5df8d8180887516001ec301b0700 |
|
BLAKE2b-256 | 807939a743e611db6fb2f7b6c63ad87834dd1c59131a0fbf959a40616a24269d |
Hashes for quickner-0.0.1a5-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7667ecc40975c39d8a37b5d054c4fa2f6a9c044cef69b6d9f2942df27d500c63 |
|
MD5 | 4019df01bf9ff52464bdd9e9718e0832 |
|
BLAKE2b-256 | a990ceca23036f5b63c08b8651c5b680189a479d0c3c28238abb356d3e3ffdc3 |