PyFastNER is the python implementation of FastNER, which is orginally developed using Java. It uses hash function to process multiple rules at the same time. Similar to FastNER, PyFastNER supports token-based rules (FastNER--under developing) and character-based rules (FastCNER). It is licensed under the MIT License.
Project description
PyFastNER
PyFastNER is the python implementation of FastNER, which is orginally developed using Java. It uses hash function to process multiple rules at the same time. Similar to FastNER, PyFastNER supports token-based rules (FastNER--under developing) and character-based rules (FastCNER). It is licensed under the Apache License, Version 2.0.
Install:
pip install PyFastNER
Examples:
Here is a simiple example of using external dictionary to find matches in an input string. It will return a dictionary of spans grouped by the named entity types.
from PyFastNER import FastCNER
# initiate fastner using external rule file
fastner = FastCNER('conf/crule_test.tsv')
# process an input string
res = fastner.processString('Pt came with fever, T 102.0F.')
# display processed results
for type in res.keys():
for span in res[type]:
print(span)
Here is another example if you need process a sentence within a document, where you just need to tell the offset of the sentence to the beginning of the document.
from PyFastNER import FastCNER
fastner = FastCNER('conf/crule_test.tsv')
res = fastner.processString('Pt came with fever, T 102.0F.',134)
For more examples, please refer to TestFastCNER.py
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 Distribution
File details
Details for the file PyFastNER-1.0.10.tar.gz
.
File metadata
- Download URL: PyFastNER-1.0.10.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d477fc4f7acbb68f0c828b0bed478206092bb8190997dfda006993db5813b262 |
|
MD5 | 4a210729ef67896ac61fc7b790340661 |
|
BLAKE2b-256 | b359005d6eae903c7d9a1861e8fd813ea7a03d65ab8807e6877a3dc12e5902da |
File details
Details for the file PyFastNER-1.0.10-py3-none-any.whl
.
File metadata
- Download URL: PyFastNER-1.0.10-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 259665dd8a84c907559645d2ce33ec807be0fb03664cfdb14a50aa6436cedb72 |
|
MD5 | b32c63c370346b3e0c2553000c1335b8 |
|
BLAKE2b-256 | 4190d9e2d9439ee6c22562a0b175e0fdd503304b60cec22b8a484955aeac7659 |