NLP Annotation Helpers
Project description
NLP Annotations
A simple python package for dealing with different nlp annotation styles. No dependencies, and is very fast due to only using regular expressions.
You can install it with:
pip3 install nlp-annotations
Annotation Types
The following are the annotation types we support and how to convert it to another type.
Markdown Links
(Used by Rasa, etc...), these are in the form:
The weather is [sunny](weather) and the sky is [blue](color).
To convert this to an entity list you can:
markdown_links2entity_list("The weather is [sunny](weather) and the sky is [blue](color).")
# ('The weather is sunny and the sky is blue.', {'entities': [(15, 20, 'weather'), (36, 40, 'color')]})
Entity List
(Used by Spacy, etc...), these are in the form:
('The weather is sunny and the sky is blue.', {'entities': [(15, 20, 'weather'), (36, 40, 'color')]})
To convert this to a markdown links string, you can:
entity_list2markdown_links("The weather is sunny and the sky is blue.", [(15, 20, 'weather'), (36, 40, 'color')])
# 'The weather is [sunny](weather) and the sky is [blue](color).'
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
nlp-annotations-1.0.0.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for nlp_annotations-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987138a44334774d0244e71ac2e00e7c815f2a082c3c30f5d455bce5f7e9cde5 |
|
MD5 | 0730d64a503d1483935d90abf49e2f78 |
|
BLAKE2b-256 | 2602f1f7daf55366829b3de7bce9b09c5a969fa86a8e1e73a1bb712b4a59c39e |