Mental health assessments often rely on detailed clinical notes which can be time-intensive and laborious to create, particularly for psychiatrists aiming to provide the best care possible for their patients. By automating this process, we can:
- Ensure more consistent and objective mental health assessments.
- Reduce clinician workload, allowing them to spend more time providing direct care.
- Provide structured insights for further analysis and research.
QuantitativePsyche evaluates psychiatric admission notes to determine severity scores and justifications for mental health dimensions, including:
- Mood
- Anxiety
- Depression
- Suicidality
This pipeline parses psychiatric notes, runs inference using LLaMA, and outputs results with severity scores and justifications. By leveraging the speed of Cerebras Inference, the processing of enormous volumes of medical text is feasible.
- Reads raw psychiatric admission notes and formats them into prompts compatible with LLaMA.
- Output:
formatted_prompts.csv— Contains:- Original
report - Formatted
promptfor LLaMA.
- Original
- Directs the formatted prompts to the Cerebras Cloud API and retrieves responses using the LLaMA model.
- Output:
results.csv— Contains:- Original
report - Raw responses from the LLaMA model.
- Original
- Parses and extracts severity scores and justifications for mood, anxiety, depression, and suicidality from the raw LLaMA response.
- Output:
parsed_results.csv— Contains:- Original
report - Scores and justifications for each dimension:
mood_score,mood_justificationanxiety_score,anxiety_justificationdepression_score,depression_justificationsuicidality_score,suicidality_justification
- Original
- Install dependencies:
pip install pandas cerebras-cloud-sdk python-dotenv
- Place input files into the
admission_notesfolder.
- Run the pipeline:
python src/main.py
- Structured results are saved in the output folder:
formatted_prompts.csv- prompts sent to LLaMa for each patientresults.csv- raw scores and justifications received from queryparsed_results.csv- final data output after post-processing