Skip to main content

clinisift

clinisift is a multitool for processing clinical medical records.

The main goal is to provide easy, off-the-shelf access to common NLP processes when working with medical records:

  • Sentence Tokenization and Section Identification from unstructured clinical textual data
  • Named Entity Recognition of medication-related data and clinical entities from records
  • Intuitive visualization of extracted information

Some motivating examples that can be accomplished in only a few lines of code to illustrate possible use-cases:

  • Extract clinical problems and procedures mentioned in a record's CLINICAL HISTORY section.
  • When exploring a new dataset, visualize records with clinical and medication entities parsed and highlighted on-the-fly.
  • Check if both a particular medication and particular surgical procedure are mentioned in a patient's PAST MEDICAL HISTORY.

Quick Features

  • Parse - Extract clinical and medical entities through Transformers-based Named Entity Recognition, as well as other components like medical record section identification. Also supports any NER model that can be loaded as a HuggingFace pipeline
  • Analyze - Built-in methods to quickly filter through parsed data with as little code overhead as possible.
  • Visualize - spaCy-based visualizer that integrates with Transformers NER to visualize medical record parses on-the-fly, programmatically or via command line.

Get Started

Installation

Install via pip:

pip install clinisift

Or, from source:

git clone git@github.com:clinisift/clinisift.git
cd clinisift && pip install -e .

Quickstart

For a comprehensive overview of clinisift's capabilities, see the "Components" page on the wiki.

Components

clinisift is made up of Parser and Doc components. See the "Components" page on the wiki for an explanation of all the parameters.

class Parser(
    models=None,
    include_ents=[],
    exclude_ents=[],
    iob_resolve=True,
    sent_tokenizer="clinitokenizer",
    sent_per_line=False,
    extract_section_headers=False,
    section_header_expr=None,
    device=None,
) 

class Doc(
    filepath_or_str,
    parser,
    is_file=True
)

Examples

Below are some examples for common use-cases.

Extract all clinical entities and medications from a *.txt file

from clinisift.cliniparse import Parser
from clinisift.doc import Doc

parser = Parser() # med ner and clinical ner
doc = Doc(text_file_path, parser)

res = doc.parse()
# { "sentences": [...],
# "entities": [...l, }

Visualize entities extracted on-the-fly from a directory of .txt files

To launch a visualizer using the default Parser() config:

From the command line:

python -m clinisift.visualizer /my/data/dir

A Flask server will be launched:

img

img

The visualizer module can be integrated with any `Parser` for more customizability about the NER pipelines used, entities visualized, and so forth. More information is available in the wiki.

Metadata

Release files for clinisift 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clinisift 0.0.3
File Size Uploaded Provenance Actions
clinisift-0.0.3.tar.gz 9.7 kB Without provenance Details for clinisift-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clinisift 0.0.3
File Interpreter ABI Platform Actions
clinisift-0.0.3-py3-none-any.whl Python 3 none any Details for clinisift-0.0.3-py3-none-any.whl

Total release size: 19.0 kB

Release files / clinisift-0.0.3.tar.gz

Download URL clinisift-0.0.3.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dd8411202ce06db635cfa31a5b870e7d8d7edbefbab07e80f1bc57d08032dbf
BLAKE2b-256 checksum
How to use checksums
fb7b30a01883b316bd3953d9698043af1772884d7aab9eaeffb825fd595b33cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release files / clinisift-0.0.3-py3-none-any.whl

Download URL clinisift-0.0.3-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26325cdb2f3c35e949ac33bfaf1827b4148db94a77382ba397409778f439cba0
BLAKE2b-256 checksum
How to use checksums
ad9a7e5534bfddcb03e7fd5f6ec7773eb4c44744d1afc14f66f10349be1e892d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Security for clinisift 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page