
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
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
The following are the annotation types we support and how to convert it to another type.
(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:
from nlp_annotations import markdown_links2entity_list
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')]})
For other situations that you may wish to add extra logic, there is also a generator:
from nlp_annotations import markdown_string_link_generator
for link in markdown_string_link_generator("The weather is [sunny](weather) and the sky is [blue](color)."):
print(f"- word={link.word}, entity={link.entity}, start={link.start}, end={link.end}")
# - word=sunny, entity=weather, start=15, end=31
# - word=blue, entity=color, start=47, end=60
(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:
from nlp_annotations import entity_list2markdown_links
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).'
FAQs
NLP Annotation Helpers
We found that nlp-annotations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.