Skip to content

Commit

Permalink
Merge pull request #147 from soeren227/ba-implement-generator
Browse files Browse the repository at this point in the history
Ba implement generator
  • Loading branch information
soeren227 authored Jun 30, 2024
2 parents a9eb6f2 + c59d2e2 commit 87e7f46
Show file tree
Hide file tree
Showing 47 changed files with 6,384 additions and 126 deletions.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
# TracEX
# Generating Process Descriptions with Generative AI - TracEX Fork

[![GitHub stars](https://img.shields.io/github/stars/bptlab/TracEX)](https://github.com/bptlab/TracEX)
[![GitHub open issues](https://img.shields.io/github/issues/bptlab/TracEX)](https://github.com/bptlab/TracEX/issues)
[![GitHub closed pull requests](https://img.shields.io/github/issues-closed/bptlab/TracEX)](https://github.com/bptlab/TracEX/issues)
[![GitHub open pull requests](https://img.shields.io/github/issues-pr/bptlab/TracEX)](https://github.com/bptlab/TracEX/issues)
[![Pylint](https://github.com/bptlab/tracex/actions/workflows/pylint.yml/badge.svg)](https://github.com/bptlab/TracEX/blob/main/.github/workflows/pylint.yml)

This repository is a fork of the original TracEX project and contains the implementation of the bachelor's thesis "Generating Process Descriptions with Generative AI".
It also contains the evaluation data of the thesis and the "Patient Journey" configuration used to produce the presented results.

## Process Description Generation Tool
Follow the setup instructions from the original README below to start the TracEX tool.
Once you are on the landing page you can navigate to the "Process Description Generation" tab.
Here you can select the process description configuration you want to use, the degree of variation between the instances, and the number of instances you want to generate.
You can also specify whether you want to save the generated instances to the database, as text files or at all.
After you have configured the generation process, you can start the generation by clicking the "Generate new Process Description" button.
The generated instances will then be displayed along with the corresponding instance configuration.

If you want to adjust the generation process, you can find all the relevant code in the "tracex_project/patient_journey_generator" directory.
Specifically in generator.py.
There are three main functions responsible for the generation process:
- **execute_generate_process_description():** This function is called when the user starts the generation process. It reads the user input and calls the other two functions accordingly.
- **generate_process_description():** This function generates the process descriptions based on the user input.
- **get_instance_config():** This function determines the instance configuration based on the degree of variation. It implements the configuration matrix of the degree of variation.

## Evaluation Data
The evaluation data used in the thesis can be found in the "evaluation_data" directory.
For each batch of generated process descriptions there is a directory (low, medium, high) with the related process descriptions and their event logs.
All generated journeys, their traces, and event logs are also stored in the database.
You can access these indirectly through the TracEX tool (Database Results -> Evaluation) or directly over the admin page (http://127.0.0.1:8000/admin/, user: admin, password: admin).
In the evaluation view, you can filter for low, medium, and high to see the complete event log and DFG for the respective batch.

## Patient Journey Configuration
The patient journey configuration used in the thesis can be found in "tracex_project/patient_journey_generator/process_description_configurations/patient_journey_configuration.json".
There in the same directory there is an example configuration file for a different domain and case.
When creating a new configuration file, make sure to follow the framework of the thesis and the structure of the existing configuration files.

## Disclaimer
Please note that the TracEX extraction pipeline is currently unable to extract event logs from anything other than patient journeys.
Also, regarding the rest of the README and wiki, the information about the patient journey generator is outdated and does not apply to the process description generation tool.
___

TracEX aims to extract event logs from unstructured text, specifically written patient experiences known as patient journeys. By leveraging Large Language Models (LLMs), TracEX can automatically identify and extract relevant events, activities, timestamps and further information from natural langauge text. This enables healthcare professionals and researchers to gain valuable insights into patient experiences, treatment pathways, and potential areas for improvement in healthcare delivery.

This project was initiated and completed as part of the team's bachelor's degree under the supervision of the Business Process Technology chair at the Hasso Plattner Institute. The project was conducted in cooperation with [mamahealth](https://www.mamahealth.com/).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
I, a 18-year-old female farmer from Poland, divorced and grappling with obesity and osteoporosis, found myself confronted with unexpected lower back pains while tending to my farm duties. The Onset of Symptoms was sharp and unbearable, disrupting my daily routine significantly.

Concerned about the escalating discomfort, I promptly scheduled an Appointment with my primary care physician. During the Consultation, my fears were validated – my osteoporosis had exacerbated, triggering this sudden agony. The physician advocated for a Change in Lifestyle, emphasizing the importance of avoiding strenuous activities and focusing on a balanced diet to alleviate the distress.

Despite adhering to the Lifestyle Adjustments, the pain persisted, leading to my hospitalization. The Admission to the hospital was emotionally taxing, as I grappled with being separated from my farm and feeling isolated in an unfamiliar setting. The medical team prescribed Medications to manage the pain and fortify my bones, yet progress was gradual, leaving me grappling with Feelings of frustration and helplessness.

During my hospitalization, I underwent a series of Therapies and treatments to effectively address my osteoporosis. Though my time in the hospital was arduous, the attentive healthcare professionals provided the necessary assistance. Finally, after what felt like an eternity, I experienced Relief from the excruciating back pain.

Reflecting on my Journey as a Patient, I've come to appreciate the significance of tuning in to my body's signals and seeking prompt medical intervention. The path to recovery proved challenging and strenuous, yet with proper care and treatment, I managed to navigate through the hurdles posed by my preexisting health issues. This experience underscored the importance of self-care and the resilience required to surmount health adversities.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
As a 35-year-old male politician hailing from France, my world took an unforeseen twist as I began noticing peculiar symptoms. The initial subtle memory lapses and cognitive fog seemed trivial, attributing them to the stress of my demanding political career. However, as days turned into weeks, these mild signs escalated, impairing my ability to recollect crucial information and events.

Having gone through a divorce, I found myself without a partner to rely on for assistance, and the hectic nature of my occupation made it arduous to prioritize my well-being. Eventually, the forgetfulness started impeding my professional performance, prompting concerned colleagues to advise seeking medical attention. Reluctantly, I acquiesced and sought out a physician to delve into my mounting concerns.

In the doctor's office, I detailed my troubling symptoms and underwent a battery of tests to unveil the root cause of my cognitive deterioration. The diagnosis I received was shattering—early-onset dementia. With a backdrop of preexisting eczema, the notion of grappling with cognitive decline at this juncture in my life was beyond my wildest apprehensions. The doctor elucidated the condition's nuances and proffered guidance on lifestyle alterations to temper the symptoms.

Overwhelmed and apprehensive about what lay ahead, it became apparent that significant modifications to my daily routine were imperative. Embracing the doctor's counsel, I embarked on a journey of self-care prioritization, mental exercises, and the adoption of a healthier dietary and exercise regimen. These changes became pivotal in stalling the disease's advancement and upholding a semblance of normality amid the chaos.

Amidst the trials, I clung to resilience and the unwavering support of healthcare providers and dear ones. Hospital visits grew in frequency as the symptoms progressed, with each discharge engendering a blend of relief and trepidation about the uncertain future. Throughout this odyssey, emotions oscillated between hope and fear as I navigated the labyrinthine landscape of living with dementia.

Reflecting on the trajectory from symptom inception to symptom trajectory, it emerges as a tumultuous ride replete with a gamut of sentiments and encounters. This voyage imparted valuable lessons in fortitude, the imperativeness of self-care, and the significance of seeking aid when necessary. As I persist in managing my condition, gratitude abounds for the safety net enveloping me and the invaluable insights garnered along this arduous path.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
As a 25-year-old female engineer from Spain, I've always cherished my independence and vibrant lifestyle. However, a diagnosis of multiple sclerosis shifted my world drastically. The transition from the emergence of symptoms to their disappearance has been a whirlwind of emotions, obstacles, and determination.

It all commenced with the onset of unusual sensations like limb numbness and walking challenges. The moment symptoms first appeared was a terrifying experience that prompted me to seek medical attention. The diagnosis of multiple sclerosis during a doctor's visit was a defining instant in my journey.

Embracing the reality of my condition was daunting, particularly when factoring in my existing health concern of COPD. My emotions during this period, a mixture of fear, sorrow, and resilience, were captured through the event of processing these feelings. I recognized the need to stay strong not just for myself but also for my support system.

Frequent hospitalizations became part and parcel of my life as I navigated treatment regimens and symptom control. The timestamps associated with these occurrences reflected the extensive time spent in hospital settings, amidst the constant hum of machines and the reassuring presence of healthcare professionals. Each treatment session symbolized a step towards managing symptoms and enhancing my well-being.

In addition to medical interventions, I incorporated lifestyle adjustments to adapt to my new circumstances. Timestamped events included engaging in yoga, modifying my diet, and practicing mindfulness exercises, underscoring my dedication to holistic health. The unwavering support of my partner, unwavering throughout this journey, provided me with a steady source of strength.

As time progressed, the eventual relief of symptom alleviation neared. The gradual amelioration of my condition underscored my resilience and the unwavering commitment of my medical team. With each passing day, I felt a deep sense of gratitude for the strides made and the valuable insights gleaned from this arduous expedition.

Reflecting on my patient journey, I am reminded of the power of endurance, love, and self-nurturing. The timestamps associated with Diagnosis, Hospital Admission, Treatment, and Lifestyle Changes intricately weave together a story of bravery and personal development. While multiple sclerosis may have reshaped my life's trajectory, it has also imparted profound lessons on resilience, compassion, and the indomitable human spirit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
I am a 28-year-old male farmer hailing from France, where my days are spent immersed in the ebb and flow of agricultural tasks. But my reality took a dramatic turn when the diagnosis of diabetes type 1 shook the very foundation of my world, compounded by the existing challenge of epilepsy.

From the genesis of symptoms to their eventual dissipation, my journey has been a tumultuous odyssey of sensations and events. It all commenced with the subtle whispers of weariness and unexplained weight loss, marking the genesis of my tale - the Onset of Symptoms. These early indicators prompted a quest for medical guidance, culminating in the definitive moment of Diagnosis of diabetes type 1.

The diagnosis ushered in a wave of modifications in my daily habits - Lifestyle Adjustments. As a farmer, recalibrating my dietary choices and daily rhythms proved to be a formidable task, vital for the management of my condition. The unwavering support of my beloved wife, with whom I share a cherished marital bond, served as a beacon of light in navigating this transitional phase.

The adherence to Treatment and Medication regimens became the cornerstone of my routine existence. Regular consultations with healthcare professionals, diligent monitoring of blood glucose levels, and the administration of insulin injections seamlessly integrated into the fabric of my life. The perpetual vigilance demanded by diabetes management tested my mettle but also unveiled reservoirs of fortitude within me.

Yet, despite my earnest endeavors, there were days suffused with overwhelming Emotions of exasperation and vulnerability. The specter of hypoglycemia and the specter of health uncertainty weighed heavily on my psyche, imposing challenges both physical and emotional.

As my struggle to stabilize my condition intensified, the frequency of Hospital Admissions escalated. Each hospitalization served as a stark reminder of life's fragility and the paramount importance of self-preservation. The moment of Hospital Discharge bore a blend of relief and trepidation, heralding my return to the familiar yet unpredictable realm of managing my health beyond the hospital confines.

Ultimately, after enduring a rollercoaster of peaks and valleys, I arrived at the juncture of Symptom Dissipation. The gradual amelioration of my health and the waning manifestations of diabetes instilled in me a sense of triumph and thankfulness. The expedition was lengthy and grueling, but it imbued me with resilience and a renewed commitment to prioritize my well-being.

As I reflect on the traverse of my patient narrative, I am reminded of the innate resilience ingrained within me as a farmer, confronting the caprices of nature with steadfast determination. Although diabetes may have reshaped the trajectory of my life, it has also imparted invaluable lessons in perseverance, modesty, and appreciation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
An industrious Romanian female pilot at 38, my days are typically a whirlwind of professional duties and nurturing my relationship. However, the equilibrium of my bustling life was disrupted by the sudden emergence of symptoms linked to my type 2 diabetes.

It all commenced with the onset of symptoms, manifesting through unquenchable thirst, unrelenting fatigue, and an alarming increase in urination frequency. Initially dismissing these signals as mere byproducts of work-related stress, I strove forward until the symptoms exacerbated.

In due course, I recognized the gravity of the situation and sought out medical assistance, marking the pivotal Doctor Visit event. The diagnosis of type 2 diabetes by the physician struck me profoundly, catching me unawares given my absence of preexisting health conditions. This diagnosis event served as a catalyst for a paradigm shift in my health consciousness.

Subsequent to the diagnosis, a significant paradigm shift was necessitated in the form of Lifestyle Changes to manage my condition effectively. This transformative event entailed integrating regular physical exercise into my regimen, adopting a balanced dietary pattern, and meticulously monitoring my blood glucose levels. The adjustment proved to be a daunting endeavor, particularly given my demanding occupation as a pilot.

As time progressed, consistent attendance of Doctor Visits for routine checks and consultations on optimal diabetes management became an abiding feature of my routine. These visits evolved into a constant in my life, underlining the significance of prioritizing my health amidst the hustle and bustle of my professional life.

Furthermore, the prescription of specialized Medications aimed at regulating my blood sugar levels and mitigating the risk of complications assumed a central role in my day-to-day routine. This event underscored the imperative nature of discipline and steadfastness in preserving my health.

Despite the hurdles, my partnership provided solace and fortitude. The steadfast support and encouragement from my significant other during Hospital Discharges and Treatment sessions instilled within me a sense of gratitude and determination to remain vigilant about my health.

Amidst this patient odyssey, a kaleidoscope of emotions was traversed—from trepidation and ambiguity to grit and perseverance. Each sentiment intertwined with the events of this journey, molding my approach towards managing my diabetes and championing my well-being.

Ultimately, the passage from Symptom Onset to Lifestyle Changes has been a crucible of transformation, enlightening me on the essence of self-care, resilience, and the significance of seeking assistance during tumultuous junctures. As a female pilot grappling with type 2 diabetes, this voyage has not only influenced my health trajectory but also my worldview, serving as a poignant reminder of the human body's fragility and resilience.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
At the age of 65, I, a male lawyer hailing from Poland, have always prided myself on my capacity to tackle life's hurdles with tenacity and resolve. Nonetheless, the revelation of osteoporosis left me feeling as though the ground beneath me was slowly giving way.

The onset of my ordeal was marked by a niggling backache that seemed to exacerbate day by day. Initially brushing off the discomfort, I soldiered on through my hectic work commitments, attributing the pain to the stresses of life and the toll of age. Yet, as days turned into weeks, the dull ache morphed into sharp spasms that made prolonged sitting and even a good night's rest an arduous task.

Ultimately, prodded by my concerned spouse, I relented and sought out medical assistance. The diagnosis of osteoporosis blindsided me - a health condition I had never fathomed confronting. The physician elaborated on how my preexisting obesity likely magnified the strain on my bones, precipitating the onset of osteoporosis.

Subsequently, the discourse with my healthcare provider centered on exploring treatment modalities. A regimen of medication was prescribed to fortify my bones and mitigate fracture risks. Incorporating this new routine of medication intake served as a daily reminder of the evolution in my health status.

Over time, subtle ameliorations in my condition surfaced. The intense spasms in my back ebbed, rendering me more equipped to juggle the daily demands of both my professional and personal life. Gradually, the symptoms began to recede, allowing me to reestablish a semblance of normality.

Attaining the juncture of symptom abatement felt akin to a modest triumph in my quest for improved well-being. While the initial diagnosis of osteoporosis seemed like a formidable barrier, it ultimately spurred me to prioritize self-care and embrace positive lifestyle adjustments.

Upon retrospection of my patient voyage, I am appreciative of the unwavering support of my loved ones, the proficiency of my healthcare cadre, and the resilience that steered me through the adversities I encountered. As I press on along the trajectory to wellness, I carry forth the wisdom gleaned from this experience, greeting each day with gratitude and a rekindled sense of purpose.
Loading

0 comments on commit 87e7f46

Please sign in to comment.