# medspaCy

> Python library of clinical NLP and text processing components built on the spaCy framework.

medspaCy is an open-source Python library from the medspacy organization that adds clinical text processing tools to spaCy pipelines. It covers sentence segmentation, concept extraction, contextual analysis, and section detection. The project's README describes it as currently in beta, with version 1.3.1 released on 2024-11-21.

## What It Is

medspaCy bundles several modular packages for working with clinical text, each usable on its own or as part of a spaCy pipeline. Users load a default clinical pipeline with `medspacy.load()`, or wrap an existing spaCy model, and then add rules to extract concepts.

## Components and Workflow

The modules cover preprocessing of clinical text, clinical sentence splitting, rule-based named entity extraction with target rules, and an implementation of the ConText algorithm for detecting negation, uncertainty and other entity attributes. Further modules handle section detection, postprocessing of extracted entities, I/O to structured data and databases, and visualization of extracted entities. SpacyQuickUMLS, based on a fork of QuickUMLS, provides UMLS concept extraction.

## Language Support

Since May 2024, rules and resources can be distributed in languages other than English. English has ConText rules, section rules, and a QuickUMLS sample. French and Dutch have ConText rules, and several other languages have only limited resources or none, according to the README.

## Recent Release

Version 1.3.1 batches database writes of concepts into SQLite, supports spaCy up to 3.8.2, drops Python 3.6 and 3.7 support, and optionally adds sentence boundaries to section headers.

## Features
- Clinical sentence segmentation
- Rule-based concept extraction with target rules
- ConText algorithm for negation and uncertainty detection
- Clinical section detection
- Preprocessing and postprocessing of clinical text and entities
- Database I/O and conversion to structured data
- Entity visualization
- UMLS concept extraction via SpacyQuickUMLS
- Multi-language rule support

## Integrations
spaCy, QuickUMLS, PyRuSH, SQLite, UMLS

## Platforms
API, DEVELOPER_SDK

## Pricing
Open Source

## Version
1.3.1

## Links
- Website: https://github.com/medspacy/medspacy
- Repository: https://github.com/medspacy/medspacy
- EveryDev.ai: https://www.everydev.ai/tools/medspacy
