# anannmaya/emotionawarefmd architecture

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

- Interactive diagram: https://gitdiagram.com/anannmaya/emotionawarefmd
- Repository: https://github.com/anannmaya/emotionawarefmd

## Overview

This is a dissertation research pipeline for studying affect in financial misinformation and evaluating whether affective features improve detection. Its main workflow compares text-only and emotion-aware models on paired financial datasets, then tests generalisation on RFC-Bench; a supplementary FinBERT experiment provides a separate model-family comparison. RQ1 analysis, failure analysis and result-generation are distinct branches. The README documents capabilities and runnable entry points; source excerpts show selected model calls, but most data-preparation and analysis internals were not sampled, so their connections are not inferred.

Main entry points: [`outputs`](https://github.com/anannmaya/emotionawarefmd/tree/main/outputs) (Experiment outputs), [`src/models/run_rq2_cross_validation.py`](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_cross_validation.py) (Pair-preserving CV), [`src/models/run_rq2_finbert_experiment.py`](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_finbert_experiment.py) (FinBERT experiment), [`src/models/run_rq2_nested_weighted_cross_validation.py`](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_nested_weighted_cross_validation.py) (Weighted nested CV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_liar2prep["LIAR2 preparation"]
  node_liar2inputs["LIAR2 model inputs"]
  node_candidates["LIAR2 candidates"]
  node_rfcprep["RFC preparation"]
  node_affect["Affective features"]
  node_liar2data["LIAR2-Finance"]
  node_factorsdata["FACTors-Finance"]
  node_rfcdata["RFC-Bench features"]
end

subgraph group_classical["Classical experiments"]
  node_cv["Pair-preserving CV"]
  node_nested["Weighted nested CV"]
  node_selection["Classical model selection"]
  node_screen["Classical screening"]
  node_rfcclassical["Classical RFC evaluation"]
  node_rfcweighted["Weighted RFC evaluation"]
end

subgraph group_finbert["FinBERT experiments"]
  node_finbertexperiment["FinBERT experiment"]
  node_finbertmodel["FinBERT model and training"]
  node_finbertio["FinBERT data I/O<br/>[finbert_rq2_io.py]"]
  node_finbertanalysis["FinBERT summaries"]
  node_samesplit["Same-split comparison"]
end

subgraph group_analysis["Analysis and results"]
  node_rq1liar["LIAR2 affect analysis"]
  node_rq1factors["FACTors affect analysis"]
  node_rq1summary["RQ1 comparison"]
  node_failure["RFC failure analysis"]
  node_profiles["Failure affect profiles"]
  node_finaltables["Final result tables"]
  node_figures["Dissertation figures"]
  node_outputs["Experiment outputs"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs analysis"| node_rq1liar
node_researcher -->|"runs analysis"| node_rq1factors
node_researcher -->|"runs experiment"| node_nested
node_researcher -->|"runs evaluation"| node_rfcweighted
node_researcher -->|"runs experiment"| node_finbertexperiment
node_researcher -->|"runs analysis"| node_failure
node_researcher -->|"generates tables"| node_finaltables
node_researcher -->|"generates figures"| node_figures
node_nested -->|"uses utilities"| node_cv
node_selection -->|"uses utilities"| node_cv
node_screen -->|"uses utilities"| node_cv
node_rfcclassical -->|"uses selection"| node_selection
node_rfcclassical -->|"uses utilities"| node_cv
node_rfcweighted -->|"uses utilities"| node_nested
node_rfcweighted -->|"uses utilities"| node_cv
node_finbertexperiment -->|"uses summaries"| node_finbertanalysis
node_finbertexperiment -->|"uses I/O"| node_finbertio
node_finbertexperiment -->|"uses training"| node_finbertmodel
node_finbertio -->|"uses utilities"| node_finbertmodel
node_finbertanalysis -->|"uses utilities"| node_finbertmodel
node_samesplit -->|"uses utilities"| node_cv
node_samesplit -->|"uses selection"| node_selection
node_rq1liar -->|"summarised with"| node_rq1summary
node_rq1factors -->|"summarised with"| node_rq1summary
node_researcher -->|"runs comparison"| node_rq1summary
node_researcher -->|"runs evaluation"| node_rfcclassical
node_researcher -->|"runs comparison"| node_samesplit
node_researcher -.->|"runs screening"| node_screen
node_rq1liar -.->|"writes results"| node_outputs
node_rq1factors -.->|"writes results"| node_outputs
node_rq1summary -.->|"writes results"| node_outputs
node_nested -.->|"writes results"| node_outputs
node_finbertexperiment -.->|"writes results"| node_outputs
node_failure -.->|"compared by"| node_profiles
node_finaltables -.->|"writes tables"| node_outputs
node_figures -.->|"writes figures"| node_outputs

click node_liar2prep "https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/create_liar2_final_dataset.py"
click node_liar2inputs "https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/preprocess_liar2_model_inputs.py"
click node_candidates "https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/prepare_liar2_candidates.py"
click node_rfcprep "https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/prepare_rfc_bench.py"
click node_affect "https://github.com/anannmaya/emotionawarefmd/blob/main/notebooks/Affective%20Features%20Extraction.ipynb"
click node_liar2data "https://github.com/anannmaya/emotionawarefmd/blob/main/data/processed/model_ready/liar2_finance_full.csv"
click node_factorsdata "https://github.com/anannmaya/emotionawarefmd/blob/main/data/processed/model_ready/factors_finance_full_final.csv"
click node_rfcdata "https://github.com/anannmaya/emotionawarefmd/blob/main/data/features/rfc_bench_with_affective_features_512.csv"
click node_cv "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_cross_validation.py"
click node_nested "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_nested_weighted_cross_validation.py"
click node_selection "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_classical_nested_model_selection.py"
click node_screen "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/screen_rq2_classical_models.py"
click node_rfcclassical "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_classical_rfc_external_evaluation.py"
click node_rfcweighted "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_rfc_weighted_external_evaluation.py"
click node_finbertexperiment "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_finbert_experiment.py"
click node_finbertmodel "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_utils.py"
click node_finbertio "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_io.py"
click node_finbertanalysis "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_analysis.py"
click node_samesplit "https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_same_split_classical_finbert_comparison.py"
click node_rq1liar "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_liar2_affective_patterns.py"
click node_rq1factors "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_factors_affective_patterns.py"
click node_rq1summary "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/summarise_rq1_across_datasets.py"
click node_failure "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_rq2_rfc_weighted_failures.py"
click node_profiles "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/compare_rq2_rfc_failure_affective_profiles.py"
click node_finaltables "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/create_rq2_final_tables.py"
click node_figures "https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/create_dissertation_final_figures.py"
click node_outputs "https://github.com/anannmaya/emotionawarefmd/tree/main/outputs"

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_liar2prep,node_liar2inputs,node_candidates,node_rfcprep,node_affect,node_liar2data,node_factorsdata,node_rfcdata toneBlue
class node_cv,node_nested,node_selection,node_screen,node_rfcclassical,node_rfcweighted toneAmber
class node_finbertexperiment,node_finbertmodel,node_finbertio,node_finbertanalysis,node_samesplit toneMint
class node_rq1liar,node_rq1factors,node_rq1summary,node_failure,node_profiles,node_finaltables,node_figures,node_outputs toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [LIAR2 preparation](https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/create_liar2_final_dataset.py): `src/data/create_liar2_final_dataset.py`
- [LIAR2 model inputs](https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/preprocess_liar2_model_inputs.py): `src/data/preprocess_liar2_model_inputs.py`
- [LIAR2 candidates](https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/prepare_liar2_candidates.py): `src/data/prepare_liar2_candidates.py`
- [RFC preparation](https://github.com/anannmaya/emotionawarefmd/blob/main/src/data/prepare_rfc_bench.py): `src/data/prepare_rfc_bench.py`
- [Affective features](https://github.com/anannmaya/emotionawarefmd/blob/main/notebooks/Affective%20Features%20Extraction.ipynb): `notebooks/Affective Features Extraction.ipynb`
- [LIAR2-Finance](https://github.com/anannmaya/emotionawarefmd/blob/main/data/processed/model_ready/liar2_finance_full.csv): `data/processed/model_ready/liar2_finance_full.csv`
- [FACTors-Finance](https://github.com/anannmaya/emotionawarefmd/blob/main/data/processed/model_ready/factors_finance_full_final.csv): `data/processed/model_ready/factors_finance_full_final.csv`
- [RFC-Bench features](https://github.com/anannmaya/emotionawarefmd/blob/main/data/features/rfc_bench_with_affective_features_512.csv): `data/features/rfc_bench_with_affective_features_512.csv`

### Classical experiments

- [Pair-preserving CV](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_cross_validation.py): `src/models/run_rq2_cross_validation.py`
- [Weighted nested CV](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_nested_weighted_cross_validation.py): `src/models/run_rq2_nested_weighted_cross_validation.py`
- [Classical model selection](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_classical_nested_model_selection.py): `src/models/run_rq2_classical_nested_model_selection.py`
- [Classical screening](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/screen_rq2_classical_models.py): `src/models/screen_rq2_classical_models.py`
- [Classical RFC evaluation](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_classical_rfc_external_evaluation.py): `src/models/run_rq2_classical_rfc_external_evaluation.py`
- [Weighted RFC evaluation](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_rfc_weighted_external_evaluation.py): `src/models/run_rq2_rfc_weighted_external_evaluation.py`

### FinBERT experiments

- [FinBERT experiment](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_finbert_experiment.py): `src/models/run_rq2_finbert_experiment.py`
- [FinBERT model and training](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_utils.py): `src/models/finbert_rq2_utils.py`
- [FinBERT data I/O](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_io.py): `src/models/finbert_rq2_io.py`
- [FinBERT summaries](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/finbert_rq2_analysis.py): `src/models/finbert_rq2_analysis.py`
- [Same-split comparison](https://github.com/anannmaya/emotionawarefmd/blob/main/src/models/run_rq2_same_split_classical_finbert_comparison.py): `src/models/run_rq2_same_split_classical_finbert_comparison.py`

### Analysis and results

- [LIAR2 affect analysis](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_liar2_affective_patterns.py): `src/analysis/analyse_liar2_affective_patterns.py`
- [FACTors affect analysis](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_factors_affective_patterns.py): `src/analysis/analyse_factors_affective_patterns.py`
- [RQ1 comparison](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/summarise_rq1_across_datasets.py): `src/analysis/summarise_rq1_across_datasets.py`
- [RFC failure analysis](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/analyse_rq2_rfc_weighted_failures.py): `src/analysis/analyse_rq2_rfc_weighted_failures.py`
- [Failure affect profiles](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/compare_rq2_rfc_failure_affective_profiles.py): `src/analysis/compare_rq2_rfc_failure_affective_profiles.py`
- [Final result tables](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/create_rq2_final_tables.py): `src/analysis/create_rq2_final_tables.py`
- [Dissertation figures](https://github.com/anannmaya/emotionawarefmd/blob/main/src/analysis/create_dissertation_final_figures.py): `src/analysis/create_dissertation_final_figures.py`
- [Experiment outputs](https://github.com/anannmaya/emotionawarefmd/tree/main/outputs): `outputs`

### Other components

- **Researcher**

## Connections

- Researcher → LIAR2 affect analysis: runs analysis (evidence: `README.md`)
- Researcher → FACTors affect analysis: runs analysis (evidence: `README.md`)
- Researcher → Weighted nested CV: runs experiment (evidence: `README.md`)
- Researcher → Weighted RFC evaluation: runs evaluation (evidence: `README.md`)
- Researcher → FinBERT experiment: runs experiment (evidence: `README.md`)
- Researcher → RFC failure analysis: runs analysis (evidence: `README.md`)
- Researcher → Final result tables: generates tables (evidence: `README.md`)
- Researcher → Dissertation figures: generates figures (evidence: `README.md`)
- Weighted nested CV → Pair-preserving CV: uses utilities (evidence: `src/models/run_rq2_nested_weighted_cross_validation.py`)
- Classical model selection → Pair-preserving CV: uses utilities (evidence: `src/models/run_rq2_classical_nested_model_selection.py`)
- Classical screening → Pair-preserving CV: uses utilities (evidence: `src/models/screen_rq2_classical_models.py`)
- Classical RFC evaluation → Classical model selection: uses selection (evidence: `src/models/run_rq2_classical_rfc_external_evaluation.py`)
- Classical RFC evaluation → Pair-preserving CV: uses utilities (evidence: `src/models/run_rq2_classical_rfc_external_evaluation.py`)
- Weighted RFC evaluation → Weighted nested CV: uses utilities (evidence: `src/models/run_rq2_rfc_weighted_external_evaluation.py`)
- Weighted RFC evaluation → Pair-preserving CV: uses utilities (evidence: `src/models/run_rq2_rfc_weighted_external_evaluation.py`)
- FinBERT experiment → FinBERT summaries: uses summaries (evidence: `src/models/run_rq2_finbert_experiment.py`)
- FinBERT experiment → FinBERT data I/O: uses I/O (evidence: `src/models/run_rq2_finbert_experiment.py`)
- FinBERT experiment → FinBERT model and training: uses training (evidence: `src/models/run_rq2_finbert_experiment.py`)
- FinBERT data I/O → FinBERT model and training: uses utilities (evidence: `src/models/finbert_rq2_io.py`)
- FinBERT summaries → FinBERT model and training: uses utilities (evidence: `src/models/finbert_rq2_analysis.py`)
- Same-split comparison → Pair-preserving CV: uses utilities (evidence: `src/models/run_rq2_same_split_classical_finbert_comparison.py`)
- Same-split comparison → Classical model selection: uses selection (evidence: `src/models/run_rq2_same_split_classical_finbert_comparison.py`)
- LIAR2 affect analysis → RQ1 comparison: summarised with (evidence: `README.md`)
- FACTors affect analysis → RQ1 comparison: summarised with (evidence: `README.md`)
- Researcher → RQ1 comparison: runs comparison (evidence: `README.md`)
- Researcher → Classical RFC evaluation: runs evaluation (evidence: `README.md`)
- Researcher → Same-split comparison: runs comparison (evidence: `README.md`)
- Researcher → Classical screening: runs screening
- LIAR2 affect analysis → Experiment outputs: writes results
- FACTors affect analysis → Experiment outputs: writes results
- RQ1 comparison → Experiment outputs: writes results
- Weighted nested CV → Experiment outputs: writes results
- FinBERT experiment → Experiment outputs: writes results
- RFC failure analysis → Failure affect profiles: compared by
- Final result tables → Experiment outputs: writes tables
- Dissertation figures → Experiment outputs: writes figures
