Code and data used in the manuscript 'Archetypes of desired futures for nature and people to inspire transformative change'
Abstract
Cleaning_database_with_LLM.ipynb Applies the Qwen2.5-32B-Instruct large language model (4-bit quantised, GPU) to the raw visions dataset in two sequential steps: (1) classifying each entry into thematic categories (Global Vision, Sectoral Vision, Org Mission, Product Pitch, Vague) to filter out non-vision content; (2) extracting and standardising the core vision statement from retained entries, including translation of non-English text into English and removal of organisational boilerplate. Outputs an Excel file with added classification flags (Qwen_Flag) and extracted vision text (Qwen_vision). Use Visions.xlsx and new_visions.xlsx (includes additional visions added from the Kunming-Montreal Global Biodiversity Framework) as the input datasets. Keywords_search.ipynb Performs rule-based keyword detection on the filtered and LLM-processed vision texts. Applies 32 regular-expression patterns covering biodiversity, ecosystem, and GBF Kunming-Montreal thematic terms. Generates binary indicator columns for each keyword category, computes a summary nature-keyword score, and compares automated detections against human-coded nature variables (Species, Ecosystems, Biodiversity) to identify under- and over-coding. Outputs an enriched Excel file used as input for topic modelling. Use Visions_Qwen.xlsx as the input dataset. Vision_archetypes_topic_modelling.ipynb Evaluates three unsupervised topic modelling approaches — NMF, LDA, and BERTopic — applied to both raw and LLM-standardised vision texts, to discover recurring thematic archetypes. Includes automated K-selection for NMF and LDA (K = 10–15), domain-specific stopword filtering, UMass coherence scoring, and relevance-weighted topic labelling. For each method and text variant, computes Spearman correlations between topic weights and the nature/people axes, and Kruskal-Wallis tests across vision quadrants. Saves per-method results (topic words, correlations, KW tests) and a combined Excel workbook, along with diagnostic and comparison figures. Use Visions_Qwen_Keywords.xlsx as the input dataset. Visions_archetypes_for_vis.ipynb Loads the pre-trained BERTopic model (Raw text) identified as optimal in the modelling step, and produces the final publication-ready figures and statistical outputs. Uses manually assigned archetype names for the 23 identified topics (e.g., Green Economy, Regenerating Nature, Empowering Communities). Generates four figures: a quadrant scatter plot, a topic–axis correlation scatter plot (Spearman r, nature vs. people), a Kruskal-Wallis prevalence heatmap across vision quadrants, and a hierarchical dendrogram of topic similarity. Exports a results Excel file with correlation and KW test tables and a quadrant summary.
Fields of Study & Subjects
Computational and Text Analysis Methods
Topic Modeling
Organizational Strategy and Culture
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 26 February 2026
- Language
- EN
- Document type
- Book