negspacy
A spaCy pipeline component for negating concepts in text (NegEx).
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, permissive licensing, and fills a specific need in NLP pipelines where negation context matters. Best suited for clinical or scientific text processing; general-purpose NLP projects may not need it unless negation handling is a core requirement.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a spaCy language model to be installed separately (e.g., en_core_web_sm).
- Requires Python >= 3.10.
- Low friction install with a single runtime dependency on spacy.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with no warranty or liability constraints.
last release 2026-04-20 (116 days) · last repo commit 2026-04-20 · 279 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 121,299 downloads/mo, #11,987 on PyPI
Alternatives
Verify before relying
pip install negspacy
import spacy
from negspacy.negation import Negex
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("negex")
doc = nlp("She does not like Steve Jobs.")
for e in doc.ents:
print(e.text, e._.negex)- Whether the NegEx algorithm's accuracy or performance characteristics are documented or tested against standard benchmarks.
- Whether the package works with spaCy models beyond en_core_web_sm or if there are known compatibility limitations.
What it is and what it does
negspacy is a spaCy pipeline component that detects negation in text using the NegEx algorithm, originally developed for clinical discharge summaries. It adds a negation attribute to entities and spans, marking whether they are negated in context. The package works by matching negation patterns (preceding negations like 'not', following negations like 'declined', pseudo-negations that are false triggers, and termination phrases like 'but' that reset negation scope) against text around recognized entities.
The package provides three built-in termset configurations: general English (en), clinical English (en_clinical, the default), and a more sensitive clinical variant. Users can customize patterns on the fly, apply negation detection to entity spans or noun chunks, and integrate it into any spaCy 3.0+ pipeline. It's designed for information extraction tasks where distinguishing between asserted and negated concepts matters—particularly in clinical NLP but applicable to any domain where negation context affects meaning.
Use it for
- Extract medical findings from clinical notes while correctly identifying which conditions are negated or ruled out.
- Build clinical decision support systems that distinguish between patient symptoms present versus absent.
- Process scientific literature to identify negated claims or non-findings in research abstracts.
- Improve entity extraction accuracy in domains where negation reverses the semantic meaning of a mention.
- Analyze customer feedback or survey responses to separate complaints from things customers explicitly do not want.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, permissive licensing, and fills a specific need in NLP pipelines where negation context matters. Best suited for clinical or scientific text processing; general-purpose NLP projects may not need it unless negation handling is a core requirement.
Install
negspacy on PyPI
Before you install
Low friction install with a single runtime dependency on spacy. Actively maintained as of 2026-04-20 with 279 repository stars and recent activity.
Requires a spaCy language model to be installed separately (e.g., en_core_web_sm). Requires Python >= 3.10.
License in practice
MIT License permits unrestricted use, modification, and distribution with no warranty or liability constraints.
Quickstart
pip install negspacy
import spacy
from negspacy.negation import Negex
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("negex")
doc = nlp("She does not like Steve Jobs.")
for e in doc.ents:
print(e.text, e._.negex)
Verify before relying
- Whether the NegEx algorithm's accuracy or performance characteristics are documented or tested against standard benchmarks.
- Whether the package works with spaCy models beyond en_core_web_sm or if there are known compatibility limitations.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagespacy |
| Maintenance | Actively maintained 116 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 121,299 / month, #11,987 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/EngineeringTyping :: Typed |
Evidence: negspacy-1.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “negation detection spacy”
- negspacyAdds negation detection to spaCy pipelines using the NegEx algorithm,…
- spacy-language-detectionAdds language detection to spaCy pipelines at document and sentence…
- PyRuSHPyRuSH segments clinical and telegraphic text into sentences using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also date-spacy · spacy-language-detection · spacy · pytextrank · textacy · spacy-transformers · ja-ginza · PyRuSH · pysbd · flair