Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyNegEx

PyNegEx is a PyPI modular package based on Chapman's NegEx implementation. NegEx is a rule-based algorithm to detect assertion in clinical texts.

Motivation behind PyNegEx is to provide the community with a modern python packaing for the algorithm to guarantee easy usage and a space for better maintainability, e.g. add support for other languages.

Requirements

Tested so far on:

  • Python 3.8+

Install

pip install pynegex

Usage

import pynegex

pynegex.run(text="patient hat kein Fieber",
            ent_tag="Fieber",
            triggerset_name="cotik-de",
          )
# ['negated', 'patient [PREN]hat kein[PREN] [NEGATED]Fieber[NEGATED]']

Supported languages are specificed with triggerset_name:

  • 'en' or 'chapman-en' for English
  • 'de' or 'cotik-de' for German

Speculation is enabled by default, but you can change it by passing speculation=False.

Modifications

PyNegex uses the original implementation by Chapman with support for German (triggerset by Cotik etal 2016). PyNegEx includes hotfixes for known issues with the original implementation (for more details see CHANGELOG)

Credits & License

PyNegEx contains code parts that are released in compliance with their original license which is Python 2.5.4. These code parts are essentially negex algorithm.

Furthermore, credits for the other languages support:

  • German: Cotik et al 2016.

CONTRIBUTIONS

Feel free to support this package by adding support for other languages.

Release files for pynegex 0.0.3.dev0

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

Source distribution (sdist)

Source distribution for pynegex 0.0.3.dev0
File Size Uploaded
pynegex-0.0.3.dev0.tar.gz 13.7 kB Details

Built distribution (wheel)

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

Total release size: 27.4 kB

Release files / pynegex-0.0.3.dev0.tar.gz

Download URL pynegex-0.0.3.dev0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb53bc502eee0fae6d47a7eea2bd4ced916b6db9da98f5ba09a2603242a9228
BLAKE2b-256 checksum
How to use checksums
4ee31a8ce96be57a2c3a3a53194937bd0dad4de699424e0df62d9b2c266978f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / pynegex-0.0.3.dev0-py3-none-any.whl

Download URL pynegex-0.0.3.dev0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9f50458e9b47e6bf14bde2fabe0b41a9177c7c565ab61453bce96587c278b5c
BLAKE2b-256 checksum
How to use checksums
b0552c3e226c1c8b002d68f6724e01f087aabd719e5d07254ff8d810f04f4119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.0.3.dev0 This release

2 release files

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