--- id: negspacy version: "1.1.0" license: MIT License Copyright (c) 2019 Jeno Pizarro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) license_treatment: permissive maintenance: active --- # negspacy — A spaCy pipeline component for negating concepts in text (NegEx). License: permissive · Maintenance: active · Downloads: 121.3K/mo ## 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 above — verify before relying. Adds negation detection to spaCy pipelines using the NegEx algorithm, marking whether named entities or spans in text are negated. 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 pip install negspacy uv add negspacy poetry add negspacy ## Installing negspacy 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. 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) Requires a spaCy language model to be installed separately (e.g., en_core_web_sm). Requires Python >= 3.10. 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: MIT License Copyright (c) 2019 Jeno Pizarro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 121.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags negation detection spacy, negex algorithm nlp, clinical text negation, entity negation spacy pipeline, negate concepts nlp, negation in medical text, spacy negation component, negation-detection, clinical-nlp, spacy-component [View on SkillFed](https://skillfed.io/packages/negspacy) · [View on PyPI](https://pypi.org/project/negspacy/)