Package: zensols.mednlp
Medical natural language parsing and utility libraryA natural language medical domain parsing library.  This library:Provides an interface to theUTS(UMLSTerminology Services) RESTful
service with data caching (NIH login needed).Wraps theMedCATlibrary by parsing medical and clinical text into first
class Python objects reflecting the structure of the natural language
complete withUMLSentity linking withCUIsand other domain specific
features.Combines non-medical (such as POS and NER tags) and medical features (such asCUIs) in one API and resulting data structure and/or as aPandasdata
frame.Providescui2vecas aword embedding modelfor either fast indexing and
access or to use directly as features in aZensols Deep NLP embedding layermodel.Provides access tocTAKESusing as a dictionary likeStashabstraction.Includes a command line program to access all of these features without
having to write any code.DocumentationSee thefull documentation.
TheAPI referenceis also
available.ObtainingThe easiest way to install the command line program is via thepipinstaller.pip3installzensols.mednlpBinaries are also available onpypi.UsageTo parse text, create features, and extract clinical concept identifiers:>>>fromzensols.mednlpimportApplicationFactory>>>doc_parser=ApplicationFactory.get_doc_parser()>>>doc=doc_parser('John was diagnosed with kidney failure')>>>fortokindoc.tokens:print(tok.norm,tok.pos_,tok.tag_,tok.cui_,tok.detected_name_)JohnPROPNNNP-<N>--<N>-wasAUXVBD-<N>--<N>-diagnosedVERBVBN-<N>--<N>-withADPIN-<N>--<N>-kidneyNOUNNNC0035078kidney~failurefailureNOUNNNC0035078kidney~failure>>>print(doc.entities)(<John>,<kidneyfailure>)See thefull example, and for other
functionality, see theexamples.MedCAT ModelsBy default, this library the small MedCAT model used fortutorials, and is not
sufficient for any serious project.  To get the UMLS trained model,theMedCAT
UMLS request formfrom be filled out (see theMedCATrepository).After you obtain access and download the new model, add the following to~/.mednlprcwith the following:[medcat_status_resource]url=file:///location/to/the/downloaded/file/umls_sm_wstatus_2021_oct.zip'AttributionThis API utilizes the following frameworks:MedCAT: used to extract information from Electronic Health Records (EHRs)
and link it to biomedical ontologies like SNOMED-CT and UMLS.cTAKES: a natural language processing system for extraction of information
from electronic medical record clinical free-text.cui2vec: a new set of (like word) embeddings for medical concepts learned
using an extremely large collection of multimodal medical data.Zensols Deep NLP library: a deep learning utility library for natural
language processing that aids in feature engineering and embedding layers.ctakes-parser: parsescTAKESoutput in to aPandasdata frame.CitationIf you use this project in your research please use the following BibTeX entry:@inproceedings{landes-etal-2023-deepzensols,title="{D}eep{Z}ensols: A Deep Learning Natural Language Processing Framework for Experimentation and Reproducibility",author="Landes, Paul  andDi Eugenio, Barbara  andCaragea, Cornelia",editor="Tan, Liling  andMilajevs, Dmitrijs  andChauhan, Geeticka  andGwinnup, Jeremy  andRippeth, Elijah",booktitle="Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023)",month=dec,year="2023",address="Singapore, Singapore",publisher="Empirical Methods in Natural Language Processing",url="https://aclanthology.org/2023.nlposs-1.16",pages="141--146"}CommunityPlease star the project and let me know how and where you use this API.
Contributions as pull requests, feedback and any input is welcome.ChangelogAn extensive changelog is availablehere.LicenseMIT LicenseCopyright (c) 2021 - 2023 Paul Landes