# yyeonseoo/tobedoc architecture

> Architecture diagram of the GitHub repository yyeonseoo/tobedoc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yyeonseoo/tobedoc
- Repository: https://github.com/yyeonseoo/tobedoc

## Overview

MindCraft’s checked-in product is the schizophrenia persona research toolkit: it builds structured patient profiles, generates symptom-controlled interview variants, and evaluates their speech and realism. Its main study and companion experiments cover arm comparisons, response-length cutoffs, and symptom-level calibration. The graph focuses on runtime research workflows; reports and saved results are not runtime components. Some links reflect only the source index or documented capability, since excerpts are partial.

Main entry points: [`schizophrenia/persona/src/main_study.py`](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py) (Main study), [`schizophrenia/persona/src/compare_arms.py`](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/compare_arms.py) (Arm comparison), [`schizophrenia/persona/src/length_cutoff.py`](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/length_cutoff.py) (Length cutoff), [`schizophrenia/persona/src/patient_model.py`](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/patient_model.py) (Patient model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profile["Patient profiles"]
  node_psyche["PSYCHE MFC<br/>[psyche.py]"]
  node_psyche_prompts["PSYCHE prompts"]
  node_patient_model["Patient model<br/>[patient_model.py]"]
  node_tlc["TLC definitions<br/>[tlc.py]"]
end

subgraph group_generation["Interview generation"]
  node_main_study["Main study<br/>[main_study.py]"]
  node_interviews[("Interview data<br/>[main_study.py]")]
  node_translation["Interview translation<br/>[main_study.py]"]
end

subgraph group_experiments["Model experiments"]
  node_compare_arms["Arm comparison<br/>[compare_arms.py]"]
  node_length_cutoff["Length cutoff<br/>[length_cutoff.py]"]
  node_der_levels["Symptom levels<br/>[der_levels.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_blinding["Blind scoring sets<br/>[compare_arms.py]"]
  node_tlc_scoring["TLC scoring<br/>[tlc.py]"]
  node_main_evaluation["Study evaluation<br/>[main_study.py]"]
  node_text_metrics["Text metrics<br/>[text_metrics.py]"]
end

node_researcher(("Researcher"))
node_llm_services{{"LLM services"}}

node_researcher -->|"runs study"| node_main_study
node_researcher -->|"runs comparison"| node_compare_arms
node_researcher -->|"runs experiment"| node_length_cutoff
node_researcher -->|"runs experiment"| node_der_levels
node_psyche -->|"loads templates"| node_psyche_prompts
node_compare_arms -->|"creates MFCs"| node_psyche
node_patient_model -->|"uses definitions"| node_tlc
node_main_study -->|"uses prompts"| node_patient_model
node_main_study -->|"uses rubric"| node_tlc
node_main_study -->|"generates interviews"| node_llm_services
node_main_study -->|"stores interviews"| node_interviews
node_main_study -->|"translates interviews"| node_translation
node_main_study -->|"evaluates results"| node_main_evaluation
node_main_study -->|"computes metrics"| node_text_metrics
node_compare_arms -->|"builds prompts"| node_patient_model
node_compare_arms -->|"generates arms"| node_llm_services
node_compare_arms -->|"prepares blind sets"| node_blinding
node_compare_arms -->|"scores interviews"| node_tlc_scoring
node_length_cutoff -->|"builds prompts"| node_patient_model
node_length_cutoff -->|"uses rubric"| node_tlc_scoring
node_length_cutoff -->|"generates and judges"| node_llm_services
node_der_levels -->|"reuses model runner"| node_length_cutoff
node_der_levels -->|"varies symptom levels"| node_patient_model
node_der_levels -->|"uses rubric"| node_tlc_scoring
node_main_evaluation -->|"computes auxiliary metrics"| node_text_metrics

click node_psyche "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/psyche.py"
click node_psyche_prompts "https://github.com/yyeonseoo/tobedoc/tree/main/schizophrenia/persona/psyche"
click node_patient_model "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/patient_model.py"
click node_tlc "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/tlc.py"
click node_main_study "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py"
click node_compare_arms "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/compare_arms.py"
click node_length_cutoff "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/length_cutoff.py"
click node_der_levels "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/der_levels.py"
click node_interviews "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py"
click node_translation "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py"
click node_blinding "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/compare_arms.py"
click node_tlc_scoring "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/tlc.py"
click node_main_evaluation "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py"
click node_text_metrics "https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/text_metrics.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_psyche,node_psyche_prompts,node_patient_model,node_tlc toneBlue
class node_main_study,node_interviews,node_translation toneAmber
class node_compare_arms,node_length_cutoff,node_der_levels toneMint
class node_blinding,node_tlc_scoring,node_main_evaluation,node_text_metrics toneRose
class node_researcher,node_llm_services toneIndigo
```

## Components

### Patient profiles

- [PSYCHE MFC](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/psyche.py): `schizophrenia/persona/src/psyche.py`
- [PSYCHE prompts](https://github.com/yyeonseoo/tobedoc/tree/main/schizophrenia/persona/psyche): `schizophrenia/persona/psyche`
- [Patient model](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/patient_model.py): `schizophrenia/persona/src/patient_model.py`
- [TLC definitions](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/tlc.py): `schizophrenia/persona/src/tlc.py`

### Interview generation

- [Main study](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py): `schizophrenia/persona/src/main_study.py`
- [Interview data](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py): `schizophrenia/persona/src/main_study.py`
- [Interview translation](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py): `schizophrenia/persona/src/main_study.py`

### Model experiments

- [Arm comparison](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/compare_arms.py): `schizophrenia/persona/src/compare_arms.py`
- [Length cutoff](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/length_cutoff.py): `schizophrenia/persona/src/length_cutoff.py`
- [Symptom levels](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/der_levels.py): `schizophrenia/persona/src/der_levels.py`

### Evaluation

- [Blind scoring sets](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/compare_arms.py): `schizophrenia/persona/src/compare_arms.py`
- [TLC scoring](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/tlc.py): `schizophrenia/persona/src/tlc.py`
- [Study evaluation](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/main_study.py): `schizophrenia/persona/src/main_study.py`
- [Text metrics](https://github.com/yyeonseoo/tobedoc/blob/main/schizophrenia/persona/src/text_metrics.py): `schizophrenia/persona/src/text_metrics.py`

### Other components

- **Researcher**
- **LLM services**

## Connections

- Researcher → Main study: runs study (evidence: `schizophrenia/persona/src/main_study.py`)
- Researcher → Arm comparison: runs comparison (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Researcher → Length cutoff: runs experiment (evidence: `schizophrenia/persona/src/length_cutoff.py`)
- Researcher → Symptom levels: runs experiment (evidence: `schizophrenia/persona/src/der_levels.py`)
- PSYCHE MFC → PSYCHE prompts: loads templates (evidence: `schizophrenia/persona/src/psyche.py`)
- Arm comparison → PSYCHE MFC: creates MFCs (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Patient model → TLC definitions: uses definitions (evidence: `schizophrenia/persona/src/patient_model.py`)
- Main study → Patient model: uses prompts (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → TLC definitions: uses rubric (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → LLM services: generates interviews (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → Interview data: stores interviews (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → Interview translation: translates interviews (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → Study evaluation: evaluates results (evidence: `schizophrenia/persona/src/main_study.py`)
- Main study → Text metrics: computes metrics (evidence: `schizophrenia/persona/src/main_study.py`)
- Arm comparison → Patient model: builds prompts (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Arm comparison → LLM services: generates arms (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Arm comparison → Blind scoring sets: prepares blind sets (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Arm comparison → TLC scoring: scores interviews (evidence: `schizophrenia/persona/src/compare_arms.py`)
- Length cutoff → Patient model: builds prompts (evidence: `schizophrenia/persona/src/length_cutoff.py`)
- Length cutoff → TLC scoring: uses rubric (evidence: `schizophrenia/persona/src/length_cutoff.py`)
- Length cutoff → LLM services: generates and judges (evidence: `schizophrenia/persona/src/length_cutoff.py`)
- Symptom levels → Length cutoff: reuses model runner (evidence: `schizophrenia/persona/src/der_levels.py`)
- Symptom levels → Patient model: varies symptom levels (evidence: `schizophrenia/persona/src/der_levels.py`)
- Symptom levels → TLC scoring: uses rubric (evidence: `schizophrenia/persona/src/der_levels.py`)
- Study evaluation → Text metrics: computes auxiliary metrics (evidence: `schizophrenia/persona/src/main_study.py`)
