skillfed

PyRuSH

PyRuSH is the python implementation of RuSH (Rule-based sentence Segmenter using Hashing), which is originally developed using Java. RuSH is an efficient, reliable, and easy adaptable rule-based sentence segmentation solution. It is specifically designed to handle the telegraphic written text in clinical note. It leverages a nested hash table to execute simultaneous rule processing, which reduces the impact of the rule-base growth on execution time and eliminates the effect of rule order on accuracy.

pyrush v1.0.13 76.7K downloads/30d#14,600 on PyPI13
Permissive license MIT Active released

What it is and what it does

PyRuSH is a Python port of the Java RuSH sentence segmenter, designed specifically for clinical and telegraphic text where standard sentence boundaries are ambiguous or irregular. It uses a nested hash table to apply rule-based segmentation efficiently, avoiding the rule-order dependencies and performance degradation that plague large rule sets. The package integrates with spaCy 3.x as a sentencizer component, making it usable in standard NLP pipelines alongside other spaCy tools.

The core use case is splitting clinical notes—which often contain abbreviations, line breaks, and formatting inconsistencies—into meaningful sentence units. It depends on spacy, Cython, PyFastNER, quicksectx, loguru, and setuptools, so installation requires compilation on some platforms. The package supports Python 3.6 and later, with prebuilt wheels for recent Python versions across major operating systems.

Use it for:

  • Segment clinical notes into sentences before downstream NLP tasks like entity extraction or relation prediction.
  • Preprocess telegraphic or abbreviated text (e.g., medical shorthand) where standard sentence splitters fail.
  • Integrate rule-based sentence segmentation into a spaCy pipeline without writing custom components.
  • Handle medical text with irregular formatting, multiple line breaks, and clinical abbreviations.
  • Adapt segmentation rules for domain-specific text by modifying the rule configuration file.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyRuSH segments clinical and telegraphic text into sentences using rule-based hashing, handling abbreviations and formatting irregularities common in medical notes.

Yes, if you work with clinical notes or telegraphic text and need reliable sentence segmentation. The rule-based approach and spaCy integration make it a solid choice for medical NLP pipelines. Install friction is moderate due to compiled dependencies, but wheels are available for common platforms. No known vulnerabilities and active maintenance are positive signals. Caveat: you must obtain or create a rule configuration file; the package does not ship with defaults.

Install

pyrush on PyPI

pip

pip install pyrush

uv

uv add pyrush

poetry

poetry add pyrush

Installing PyRuSH

Before you install

Medium install friction due to compiled dependencies (Cython, spacy, PyFastNER, quicksectx). Actively maintained with recent releases; last commit 2024-12-04 and latest release 2026-03-28. Wheels available for Python 3.9–3.13 across macOS, Linux, and Windows.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install PyRuSH
from PyRuSH import RuSH
rush = RuSH('path/to/rush_rules.tsv')
sentences = rush.segToSentenceSpans("Your clinical text here.")
for s in sentences:
    print(text[s.begin:s.end])

Requires a rule configuration file (rush_rules.tsv); the package does not ship with default rules, so you must provide or locate a rules file separately.

Verify before relying

  • Whether default or example rule files are available in the repository or documentation.
  • Performance benchmarks comparing PyRuSH to other clinical sentence segmenters.
  • Specific clinical note formats or edge cases the rule set handles best.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies 6 — Cython, setuptools, spacy, PyFastNER, quicksectx, loguru
Maintenance actively maintained — 139 days since the last release
Last repo commit
First released
Downloads 76,692/month — #14,600 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyrush-1.0.13-cp310-cp310-macosx_11_0_arm64.whl; pyrush-1.0.13-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyrush-1.0.13-cp310-cp310-musllinux_1_2_x86_64.whl; pyrush-1.0.13-cp310-cp310-win_amd64.whl; pyrush-1.0.13-cp311-cp311-macosx_11_0_arm64.whl; pyrush-1.0.13-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyrush-1.0.13-cp311-cp311-musllinux_1_2_x86_64.whl; pyrush-1.0.13-cp311-cp311-win_amd64.whl; pyrush-1.0.13-cp312-cp312-macosx_11_0_arm64.whl; pyrush-1.0.13-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyrush-1.0.13-cp312-cp312-musllinux_1_2_x86_64.whl; pyrush-1.0.13-cp312-cp312-win_amd64.whl; pyrush-1.0.13-cp313-cp313-macosx_11_0_arm64.whl; pyrush-1.0.13-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyrush-1.0.13-cp313-cp313-musllinux_1_2_x86_64.whl; pyrush-1.0.13-cp313-cp313-win_amd64.whl; pyrush-1.0.13-cp39-cp39-macosx_11_0_arm64.whl; pyrush-1.0.13-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyrush-1.0.13-cp39-cp39-musllinux_1_2_x86_64.whl; pyrush-1.0.13-cp39-cp39-win_amd64.whl

Keywords: PyRuSH, NLP, sentenczier, sentence segmentation

Programming Language :: Python :: 3

Tags

clinical sentence segmentationrule-based sentence splittermedical text NLPsentence boundary detectionclinical note processingtelegraphic text parsingspacy sentence component
clinical-nlpsentence-segmentationspacy-component

More Linguistic packages