Skip to content

tirilab/DREAM_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DREAM Generator

Environment Setup

  1. If you don’t have Python installed, install it from here

  2. Clone this repository

  3. Navigate into the project directory

    $ cd DREAM_generator
  4. Create a new virtual environment

    $ python -m venv venv
    $ source venv/bin/activate
  5. Install the requirements

    $ pip install -r requirements.txt

OpenAI API Key

Please refer this documentation to learn how to setup your OpenAI API Key.

After getting an API key use the command in the command line

export OPENAI_API_KEY='YOUR_API_KEY'

and change the YOUR_API_KEY with the actual API key.

Run script

To generate message data, first replace the api_key in script.py. Then run the following comment under the project directory:

$ python script.py -n [number of message data you want to generate] -f [file name of the synthetic messages] -tf [Taxonomy file name (in csv format)] -mf [Medicine list file name (in csv format)] -t [Taxonomy of the taxa3 as a string (optional: if you want to filter using taxa3 to generate messages of specific type)]

or use the command

$ python script.py -h

for help on the flag usage.

Data Samples

The taxonomy and medicine list files must be stored in assets folder. A sample file for each is available in the assets folder.

License and Citation

Data and script can be used as-is under the MIT License attached to the repository. Please cite this article if using this data or script:

Wang, Natalie and Lu, Yuzhi and Treewaree, Sukrit and Zirikly, Ayah and Nguyen, Michelle and Agarwal, Bhavik and Shah, Jash and Stevenson, James and Taylor, Casey O., Prompt Engineering to Generate Synthetic Patient Portal Drug-Related Communications (June 20, 2024). Available at SSRN: https://ssrn.com/abstract=4872174 or http://dx.doi.org/10.2139/ssrn.4872174

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages