ReHouSED NLP
Overview
This package is a medspaCy implementation of an NLP system for identifying patient housing stability in clinical texts. This system was originally developed in the Department of Veterans Affairs to study housing outcomes of Veterans participating in the Supportive Service for Veteran Families (SSVF) program. The development and validation of this system is described in "ReHouSED: A Novel Measurement of Veteran Housing Stability Using Natural Language Processing" by Chapman et al. (published Journal of Biomedical Informatics).
This system attempts to classify housing stability at two levels:
- Document-level: Each document processed by the NLP is classified as either "STABLY_HOUSED", "UNSTABLY_HOUSED", or "UNKNOWN"
- Patient-level: A set of documents over a period of time are processed and aggregated to a patient level. This is a numeric score ranging from 0-1 called "Relative Housing Stability in Electronic Documentation" (ReHouSED)
Detailed examples and explanations of the logic are provided in notebooks/
Disclaimer
This system is an approximation of the system described in the manuscript and has been modified to exclude logic specific to VA documentation. It is far from perfect and will certainly make mistakes!
Installation
You can install rehoused_nlp using pip:
pip install rehoused-nlp
Or the source code found in this repository:
python setup.py install
rehoused_nlp requires Python 3.7 or 3.8, medspaCy, and spaCy 2.2.X. spaCy 3 is not currently supported.
Quick start
Document-level example
from rehoused_nlp import build_nlp, visualize_doc_classification
nlp = build_nlp()
text = """
History of present illness: The patient was evicted from her apartment two months ago.
Since then she has lived in a shelter while looking for an apartment.
Past medical history:
1. Pneumonia
2. Afib
3. Homelessness
Housing Status: Stably Housed
Assessment/Plan: The patient was accepted to an apartment and signed the lease last week.
"""
doc = nlp(text)
visualize_doc_classification(doc)
Patient-level example
from rehoused_nlp import calculate_rehoused
import pandas as pd
df = pd.read_csv("path/to/data.tsv", sep="\t")
print("Input:")
df.head()
print("Output:")
rehoused = calculate_rehoused(df)
rehoused.head()
Input:
Output:
Metadata
Release files for rehoused-nlp 0.0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rehoused_nlp-0.0.1.0.tar.gz | 33.0 kB | Without provenance | Details for rehoused_nlp-0.0.1.0.tar.gz |
Release files / rehoused_nlp-0.0.1.0.tar.gz
| Download URL | rehoused_nlp-0.0.1.0.tar.gz |
|---|---|
| Size | 33.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
966444b59d247f9b9bd95b391df87bc1d939af3c7bd159316264aaa922da9986
|
|
BLAKE2b-256 checksum How to use checksums |
b30af5a83d7f1a9d91f75b4d243b37d2e0c22e67b42dabb6393da7d69fcf61a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for rehoused-nlp 0.0.1.0
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.