Skip to contents

All functions

compute_run_ai_metrics()
Compute derived pre/post effect metrics from raw turn-level output
compute_run_ai_metrics_cumulative()
Compute cumulative chapter metrics against the original baseline
compute_run_ai_metrics_one_turn()
Compute one-turn ingroup/outgroup metrics from raw output
evaluate_text_analysis()
Evaluate text-analysis outputs against reference labels
fix_text_file()
Fix text file encoding and normalize punctuation/whitespace
list_book_chapters()
List book chapter files inside a books directory
make_annotation_prompt()
Build a numeric-response prompt for text analysis
make_baseline_prompt()
Build the baseline (Turn 1) prompt
make_post_prompt()
Build the post-intervention (Turn 2) prompt
make_treatment_prompt() build_simulate_treatment_prompt()
Build a concrete prompt for simulate_treatment()
nalanda()
A Random Historical Fact About Nalanda University
plot_chapter_scores_faceted()
Faceted plot of chapter scores
plot_chapter_trajectories()
Plot chapter trajectories by book
plot_chapters_over_time()
Plot chapters over time (multi-timepoint means)
plot_chapters_over_time_one_turn()
Plot chapter trajectories for one-turn simulations
plot_forest_books()
Create a forest plot of book-level polarization reduction effects
prepare_forest_books()
Prepare book-level data for forest plotting
rank_weighted()
Rank rows using a weighted rubric
read_book_texts()
Read book chapters into a nested list
rename_chapters()
Rename chapter text files in a folder to a sequential order
run_ai_cumulative_chapters()
Run AI model on books with cumulative chapter context
run_ai_on_chapters()
Run AI model on book chapters and collect structured responses
run_ai_on_chapters_one_turn()
Run AI model on book chapters with a single prompt per simulation
run_text_analysis()
Run row-wise text analysis with a prompt template
save_forest_plot()
Save a forest plot to PNG and PDF formats
simulate_treatment()
Simulate a generic multi-turn treatment workflow
summarize_chapter_scores()
Summarize simulated chapter scores
summarize_treatment_results()
Summarize generic treatment results
toy_run_ai_turns
Toy raw turn-level AI simulation output
toy_sim_results
Toy simulated chapter results