ehrmonize


Nameehrmonize JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summaryehrmonize is package to abstract medical concepts using large language models.
upload_time2024-07-02 16:47:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 João Matos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ai ehr llms ehrmonize electronic health records large language models medical concept abstraction
VCS
bugtrack_url
requirements pandas python-dotenv google-cloud-bigquery db-dtypes openai boto3 tokencost tqdm fsspec huggingface-hub
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EHRmonize

Welcome to `EHRmonize`, a Python package to abstract medical concepts using large language models.

[![arXiv](https://img.shields.io/badge/arXiv-2407.00242-b31b1b.svg)](https://arxiv.org/abs/2407.00242)
[![Python 3.9](https://img.shields.io/badge/python-3.9-red.svg)](https://www.python.org/downloads/release/python-390/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-EHRmonize-blue)](https://huggingface.co/datasets/AIWongLab/ehrmonize)
[![PyPI version](https://badge.fury.io/py/ehrmonize.svg)](https://badge.fury.io/py/ehrmonize)
[![Documentation Status](https://readthedocs.org/projects/ehrmonize/badge/?version=latest)](https://ehrmonize.readthedocs.io/en/latest/?badge=latest)
[![PR Welcome Badge](https://badgen.net/https/pr-welcome-badge.vercel.app/api/badge/aiwonglab/ehrmonize)](https://github.com/aiwonglab/ehrmonize/issues?q=archived:false+is:issue+is:open+sort:updated-desc+label%3A%22help%20wanted%22%2C%22good%20first%20issue%22)


## Suggested Citation

> Matos, J., Gallifant, J., Pei, J., & Wong, A. I. (2024). EHRmonize: A framework for medical concept abstraction from electronic health records using large language models. arXiv. https://arxiv.org/abs/2407.00242

```
@article{
    matos2024ehrmonize,
      title={EHRmonize: A Framework for Medical Concept Abstraction from Electronic Health Records using Large Language Models}, 
      author={João Matos and Jack Gallifant and Jian Pei and A. Ian Wong},
      year={2024},
      eprint={2407.00242},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2407.00242}, 
}
```

## Documentation 

For documentation, please see: https://ehrmonize.readthedocs.io/. We are currently working on a demo that will soon be available on Google Colaboratory.

## Motivation
Processing and harmonizing the vast amounts of data captured in complex electronic health records (EHR) is a challenging and costly task that requires clinical expertise. Large language models (LLMs) have shown promise in various healthcare-related tasks. We herein introduce `EHRmonize`, a framework designed to abstract EHR medical concepts using LLMs.

## Rationale
`EHRmonize` is designed with two main components: a corpus generation and an LLM inference pipeline. The **first step** entails querying the EHR databases to extract and the text/concepts across various data domains that need categorization. The **second step** employs LLM few-shot prompting across different tasks. The objective is to leverage the vast medical text exposure of LLMs to convert raw input medication data into useful, predefined classes.

## Dataset 
Our curated and labeled dataset is accessible on
[HuggingFace](https://huggingface.co/datasets/AIWongLab/ehrmonize).

## Current supported tasks

| Type          | Task                          |
|---------------|-------------------------------|
| Free-text     | [*task_generic_drug* ](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_generic_route)           |
|               | [task_generic_route](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_generic_drug)          |
| Multiclass    | [task_multiclass_drug](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_multiclass_drug)              |
| Binary        | [task_binary_drug](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_binary_drug) |
| Custom        | [task_custom](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_custom)                      |


## Current supported models / engines / APIs

| API           | model_id                                      |
|---------------|-----------------------------------------------|
| [OpenAI](https://platform.openai.com/docs/api-reference/chat/create)        | gpt-4                                         |
|               | gpt-4o                                        |
|               | gpt-3.5-turbo (discouraged!)                  |
| [AWS Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html)   | anthropic.claude-3-5-sonnet-20240620-v1:0     |
|               | meta.llama3-70b-instruct-v1:0                 |
|               | mistral.mixtral-8x7b-instruct-v0:1            |

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ehrmonize",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "AI, EHR, LLMs, ehrmonize, electronic health records, large language models, medical concept abstraction",
    "author": null,
    "author_email": "Jo\u00e3o Matos <joao.matos@duke.edu>, \"A. Ian Wong\" <a.ian.wong@duke.edu>",
    "download_url": "https://files.pythonhosted.org/packages/56/5c/b04206861914d107e7ee90d2186814a338cd1b7e0e12a4f838176550dfa4/ehrmonize-0.1.2.tar.gz",
    "platform": null,
    "description": "# EHRmonize\n\nWelcome to `EHRmonize`, a Python package to abstract medical concepts using large language models.\n\n[![arXiv](https://img.shields.io/badge/arXiv-2407.00242-b31b1b.svg)](https://arxiv.org/abs/2407.00242)\n[![Python 3.9](https://img.shields.io/badge/python-3.9-red.svg)](https://www.python.org/downloads/release/python-390/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)\n[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-EHRmonize-blue)](https://huggingface.co/datasets/AIWongLab/ehrmonize)\n[![PyPI version](https://badge.fury.io/py/ehrmonize.svg)](https://badge.fury.io/py/ehrmonize)\n[![Documentation Status](https://readthedocs.org/projects/ehrmonize/badge/?version=latest)](https://ehrmonize.readthedocs.io/en/latest/?badge=latest)\n[![PR Welcome Badge](https://badgen.net/https/pr-welcome-badge.vercel.app/api/badge/aiwonglab/ehrmonize)](https://github.com/aiwonglab/ehrmonize/issues?q=archived:false+is:issue+is:open+sort:updated-desc+label%3A%22help%20wanted%22%2C%22good%20first%20issue%22)\n\n\n## Suggested Citation\n\n> Matos, J., Gallifant, J., Pei, J., & Wong, A. I. (2024). EHRmonize: A framework for medical concept abstraction from electronic health records using large language models. arXiv. https://arxiv.org/abs/2407.00242\n\n```\n@article{\n    matos2024ehrmonize,\n      title={EHRmonize: A Framework for Medical Concept Abstraction from Electronic Health Records using Large Language Models}, \n      author={Jo\u00e3o Matos and Jack Gallifant and Jian Pei and A. Ian Wong},\n      year={2024},\n      eprint={2407.00242},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https://arxiv.org/abs/2407.00242}, \n}\n```\n\n## Documentation \n\nFor documentation, please see: https://ehrmonize.readthedocs.io/. We are currently working on a demo that will soon be available on Google Colaboratory.\n\n## Motivation\nProcessing and harmonizing the vast amounts of data captured in complex electronic health records (EHR) is a challenging and costly task that requires clinical expertise. Large language models (LLMs) have shown promise in various healthcare-related tasks. We herein introduce `EHRmonize`, a framework designed to abstract EHR medical concepts using LLMs.\n\n## Rationale\n`EHRmonize` is designed with two main components: a corpus generation and an LLM inference pipeline. The **first step** entails querying the EHR databases to extract and the text/concepts across various data domains that need categorization. The **second step** employs LLM few-shot prompting across different tasks. The objective is to leverage the vast medical text exposure of LLMs to convert raw input medication data into useful, predefined classes.\n\n## Dataset \nOur curated and labeled dataset is accessible on\n[HuggingFace](https://huggingface.co/datasets/AIWongLab/ehrmonize).\n\n## Current supported tasks\n\n| Type          | Task                          |\n|---------------|-------------------------------|\n| Free-text     | [*task_generic_drug* ](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_generic_route)           |\n|               | [task_generic_route](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_generic_drug)          |\n| Multiclass    | [task_multiclass_drug](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_multiclass_drug)              |\n| Binary        | [task_binary_drug](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_binary_drug) |\n| Custom        | [task_custom](https://ehrmonize.readthedocs.io/en/latest/autoapi/ehrmonize/ehrmonize/index.html#ehrmonize.ehrmonize.EHRmonize.task_custom)                      |\n\n\n## Current supported models / engines / APIs\n\n| API           | model_id                                      |\n|---------------|-----------------------------------------------|\n| [OpenAI](https://platform.openai.com/docs/api-reference/chat/create)        | gpt-4                                         |\n|               | gpt-4o                                        |\n|               | gpt-3.5-turbo (discouraged!)                  |\n| [AWS Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html)   | anthropic.claude-3-5-sonnet-20240620-v1:0     |\n|               | meta.llama3-70b-instruct-v1:0                 |\n|               | mistral.mixtral-8x7b-instruct-v0:1            |\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Jo\u00e3o Matos  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "ehrmonize is package to abstract medical concepts using large language models.",
    "version": "0.1.2",
    "project_urls": {
        "documentation": "https://ehrmonize.readthedocs.io/",
        "homepage": "https://github.com/aiwonglab/ehrmonize/",
        "repository": "https://github.com/aiwonglab/ehrmonize/"
    },
    "split_keywords": [
        "ai",
        " ehr",
        " llms",
        " ehrmonize",
        " electronic health records",
        " large language models",
        " medical concept abstraction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b091dd99bff12218ad5b9e48260023d89db6c0a104b6fc3a536343a40d2535f8",
                "md5": "d454150c997dcb249447877702151466",
                "sha256": "d4a21287efe43d11aa6a0953f10eec68c10074c9a34277aee61507ca912530b9"
            },
            "downloads": -1,
            "filename": "ehrmonize-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d454150c997dcb249447877702151466",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11025,
            "upload_time": "2024-07-02T16:47:50",
            "upload_time_iso_8601": "2024-07-02T16:47:50.944050Z",
            "url": "https://files.pythonhosted.org/packages/b0/91/dd99bff12218ad5b9e48260023d89db6c0a104b6fc3a536343a40d2535f8/ehrmonize-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "565cb04206861914d107e7ee90d2186814a338cd1b7e0e12a4f838176550dfa4",
                "md5": "ccdf3b32a71c77b695f319330c750935",
                "sha256": "13ca33047db5fe6eb0601a5113b10394874c91ecfeb5df6fbf69afc092860cfd"
            },
            "downloads": -1,
            "filename": "ehrmonize-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ccdf3b32a71c77b695f319330c750935",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 6478585,
            "upload_time": "2024-07-02T16:47:54",
            "upload_time_iso_8601": "2024-07-02T16:47:54.451040Z",
            "url": "https://files.pythonhosted.org/packages/56/5c/b04206861914d107e7ee90d2186814a338cd1b7e0e12a4f838176550dfa4/ehrmonize-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-02 16:47:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aiwonglab",
    "github_project": "ehrmonize",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "python-dotenv",
            "specs": []
        },
        {
            "name": "google-cloud-bigquery",
            "specs": []
        },
        {
            "name": "db-dtypes",
            "specs": []
        },
        {
            "name": "openai",
            "specs": []
        },
        {
            "name": "boto3",
            "specs": []
        },
        {
            "name": "tokencost",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "fsspec",
            "specs": []
        },
        {
            "name": "huggingface-hub",
            "specs": []
        }
    ],
    "lcname": "ehrmonize"
}
        
Elapsed time: 0.32062s