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.1a4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baf5a0aa8b26c19aa8e9b80573a30c9255e6a4e2afb669fc8291f2b9070fec28 |
|
MD5 | 97cdbbb7afa0f2e9d883de1b27246fcd |
|
BLAKE2b-256 | 1329378b207372dbd257c24bb7e713348334801bded10613931f3dd72095c3ef |
Hashes for quickner-0.0.1a4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4ac4a0d95fb04c3634c5f7d91281ae8b067ed7fe19d210d58e0f5a599b9367e |
|
MD5 | d11fbf425cbff1369ee06d19c8cf349c |
|
BLAKE2b-256 | c88d7169bff40506949a2b93190124034874f5c353734662f79e4904ea33de50 |
Hashes for quickner-0.0.1a4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4797339581b0ca43cac2046a9f11d326361a5d60f93201ddf177a85210ffcef |
|
MD5 | eded013967e1b28501968e2ce24c6e39 |
|
BLAKE2b-256 | 9e90b1114c471e656d0543741f9487206ccfb6c642647168203c528eb045504f |
Hashes for quickner-0.0.1a4-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aca46d24789ea7c219a0edb7b2cd3a2020906ad68c9cde5ebe941bca0eb6bde8 |
|
MD5 | 357874a90ece2f520c1beba49281267e |
|
BLAKE2b-256 | 0a9c72d188cc2eb434a41d2b7d47fd8a0f5a72fbae989076268ae177d728ad01 |
Hashes for quickner-0.0.1a4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf011ed22247da191ec7dd38547c4bcb39c9d9d1c80bfabb1c2c0695eca0524 |
|
MD5 | b13f1b68e68a57ecd28316819307aff4 |
|
BLAKE2b-256 | 6e529bd52f6a623dc2a1c69ce69bdec8d6d5b4aa6328dbfad0d8124232310015 |
Hashes for quickner-0.0.1a4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff05671bf6073d5ada6f10e36af22a5d38566ea1c30e98254b70ad68ad61eff4 |
|
MD5 | 65eba1856ad20747e2cc90c8871aced0 |
|
BLAKE2b-256 | 071692a05b6c43ec737b794129ff9fdcadec570de8a8de6c80ccafcf11750110 |
Hashes for quickner-0.0.1a4-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fad6e02dafad7b0074939a4930ce73dd47363103f66d99c6bb104787b7ae845 |
|
MD5 | 1c57c07e986502c267c27e4f18700e1a |
|
BLAKE2b-256 | 7e0979514a44bcf23356b05a17dd291f74d609ea1fa06650578c13860a05082b |
Hashes for quickner-0.0.1a4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0874e9a4c9364e6752c8f20fb3de13420b8cf381b303194fbef48c715ff1ba |
|
MD5 | 9724c824dd029e0bd2950270b55a5b7b |
|
BLAKE2b-256 | b9d8e7d14a20d044566d29cdfb662057599ee5468c11a0189362cd8ca472b830 |
Hashes for quickner-0.0.1a4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eff2fe653f09ad452c6306da38025744cae18c893935a83d2304f5a7d1ac1d9e |
|
MD5 | ee04d2c15a2370d1f5ec8fbf28a4608d |
|
BLAKE2b-256 | 30f301ec516602316c52829ff7ec6a278bb4ce0513a957a2df9d9843d77f05f3 |
Hashes for quickner-0.0.1a4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949fd43108c0aafc143055d560f1eb47dbf8238b486fbf23a989c7beb141796e |
|
MD5 | 66e18113967963c9b4d425e792e8f01f |
|
BLAKE2b-256 | 0ed279d418b8fc4aacc1ed92145dbe411548f014ad2b6d06e772a5bd4cbc5fa0 |
Hashes for quickner-0.0.1a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8456aadd6e72092952a4395921698f1945e0a726d00c8378c792eb83efa0c21b |
|
MD5 | a161391db1e958d1111c2bac5e09dbdb |
|
BLAKE2b-256 | 98d321690939773c342e5f12f90f9b97a95aeffc84e0b7e38fc05cdf7922023b |
Hashes for quickner-0.0.1a4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c58ae3b4c85863335207c41ab5654cd0e53980649339d207c7b603b1897faf0 |
|
MD5 | 40bdabc479f9730b2acb0417f77cbe81 |
|
BLAKE2b-256 | 68b7910c8bc8742e49aa64f6042431d904a2cb3c97af8c9cc1792b2c37512f40 |
Hashes for quickner-0.0.1a4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97e432d7d43bfb4369471701b88a5a003da69f2a7360559ea82abe4e1b5e2fef |
|
MD5 | feb48a9df6709dade55f605eeec40a29 |
|
BLAKE2b-256 | 5641b828c02f3a313c8cdd76dcec8f579cb180a1fb5ce7fab840721f6279876f |
Hashes for quickner-0.0.1a4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4826b918e951c6a916b7ebb4f9baff2152ce149711d45dd94f88bfd1a1836dda |
|
MD5 | ad92c3236d2bf466207f2f3216fd6db6 |
|
BLAKE2b-256 | e9e6369734f9cead7c35137aee7b20046321eafd30598dd02e00b99e75e7d1fb |
Hashes for quickner-0.0.1a4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b16cff90a25de15a995aa658f8c49c45dea9aef891fedda0e4f515c771ee339 |
|
MD5 | ddae0f2a790349a0e6b2f5c96fc13663 |
|
BLAKE2b-256 | af8e5bfd16bdce50c795248ffb23422d19f948764130e32d3147a9a2bccc3c51 |
Hashes for quickner-0.0.1a4-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3233c36cab880eba068277b2808ecfbd6063569d956383459b73a7d15e14b1b |
|
MD5 | 1191fb1a3f60e24ebc4339273ad7ed0b |
|
BLAKE2b-256 | 34a70aaac10f441abd66bd3bdbe33a0829ba24710a18700cfc2d04a1eca7918a |
Hashes for quickner-0.0.1a4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f6952960053ae66720d5d43cdf9298ecc743b33af47a1848bcb9e8c57c9811 |
|
MD5 | ba47cb007da2ab07b0b867d6e14ca701 |
|
BLAKE2b-256 | f195be23dc0c91ca7acf203c1449fe953289ee421741e602b315a5a8a6b20558 |
Hashes for quickner-0.0.1a4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df120d77c0b72f15cd3b257e284cdbece49e79fcae9e1ffd6a1240a7169423d2 |
|
MD5 | 149a261c9a86c45d6316a1c42f410082 |
|
BLAKE2b-256 | 88e25e81ebcc5fa65d595e97fce1faf8f9bc22806a15cdedf00e34765ade9054 |