Skip to content

Commit 190af65

Browse files
Release v0.9.5: reproducible Colab-from-GitHub + pinned online version (#3)
* fix(pipeline): B1-B5 ordering/guards, N1-N3 stats, t-SNE metric and determinism excluded_codes and group replace before embedding; RoBERTa chunk tokenize; cross-POS multiset preserve; edge labels use raw similarity; t-SNE precomputed distance for similarity matrices with deterministic keep order. * chore: stop tracking pytest bytecode under tests/ * docs(notebook): restore Core principles block in usage guide Keep author-facing intro markdown with ARS and Ethnography citations. * chore(notebook): pin kernelspec to cmap_vis_replication * fix(notebook,pipeline): B1/B2 wrapper ordering + safe list-column parser Reorder all four teaching-notebook wrappers (run_heatmap_pipeline, run_tsne_pipeline, run_heatmap_network_plain_pipeline, run_heatmap_network_pipeline) to match the core pipeline contract: exclude codes before sentence extraction (B1), and rebuild filtered_sentences after group-label replacement so the co-occurrence / PMI / TF-IDF methods embed the replaced text (B2). Replace eval() on stringified codes/data_group cells with a bounded, list[str]-only parse_list_column_cell in vis_tool_core.py and all four notebook wrappers; it fails loud on tuples, malformed literals, non-string items, and oversized cells instead of executing arbitrary code. Add discriminating wrapper-ordering tests and list-column parser tests. Document the supported clustering method/metric pairs (PMI = cosine only) and the Ward-linkage clustered-heatmap design note in the README. * fix(p1b-oom): fold Sol OOM docs + release-hygiene findings P1b-OOM disposition (Sol/ultra out-of-model review). Gate targets B1/B2/eval confirmed clean; folding the doc/config/metadata findings only. - README: clustered heatmap is unconditional (clustered= flag is not gated); TF-IDF experimental variant requires distance_metric="raw_weighted" (F10, F11) - notebook: align method labels to README — method 2 "Jaccard" -> "Co-occurrence"; PMI described as PPMI, cosine-only; core comment typo co-occurrnece->co-occurrence - notebook kernelspec cmap_vis_replication -> python3 (portable; was local env) (F4) - .gitignore: re-exclude function/__pycache__/ and the foreign CDPH org_cooccurrence_network.py so neither can reach the public repo (F8, F9) Deferred (tracked follow-up): F2 empty-seed None-guard, F3 singleton memory, F5 pytest dep, F6 parser char-bound, F1 chunking (pre-existing), F7 nltk-at-collection. * Release v0.9.5: reproducible Colab-from-GitHub notebook + pinned online version - On Colab the notebook now self-installs: it clones the pinned release tag (v0.9.5) into a tag-specific folder and verifies the checkout is exactly that tag before importing, so the online notebook and the function/ package always come from the same version. This is a no-op outside Colab (local runs unaffected). - Point the Open-in-Colab badge and links (README, paper, notebook) at the pinned tag so the online version is reproducible rather than tracking a moving branch. - Add a note for users importing from ATLAS.ti / NVivo / MAXQDA (CMAP QDPX Converter). - Widen supported torch to <2.9 so it runs on the current Colab torch (2.8). - Add CITATION.cff. * Add Beyond Text (2015) + open-access links; widen supported torch/scikit-learn - Core Principles: add Abramson & Dohan 2015, "Beyond Text: Using Arrays to Represent and Analyze Ethnographic Data" (Sociological Methodology) with an open-access link, and add an open-access link for the 2018 computational ethnography paper. - Widen the supported/required ranges for the packages Colab provides so the environment check passes on current Colab: scikit-learn to <1.8 and torch to <3 (kept the notebook check and requirements.txt in sync). * Reword Colab setup: "packages Colab does not ship" -> "packages that aren't already on Colab" Plainer language in the Colab setup cell's guidance and comment; no behavior change. * Collapse Setup and Helper Functions cells by default in Colab (cellView=form)
1 parent 62659a2 commit 190af65

19 files changed

Lines changed: 1746 additions & 199 deletions

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ __marimo__/
148148
!README.md
149149
!visualization_toolkit_final.ipynb
150150
!LICENSE.md
151+
!CITATION.cff
151152
# PNG files are now ignored
152153
*.png
153154
!environment.yml
@@ -159,3 +160,13 @@ __marimo__/
159160
!/input
160161
!/documentation
161162
!/documentation/**
163+
!/function
164+
!/function/**
165+
!/tests
166+
!/tests/**
167+
!pytest.ini
168+
tests/__pycache__/
169+
# Re-exclude bytecode under the un-ignored source dirs
170+
function/__pycache__/
171+
# Foreign module from another lane (CDPH org-cooccurrence network) — keep it out of this public repo
172+
function/org_cooccurrence_network.py

CITATION.cff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
title: "CMAP Visualization Toolkit"
4+
type: software
5+
authors:
6+
- family-names: "Abramson"
7+
given-names: "Corey M."
8+
affiliation: "Rice University"
9+
- family-names: "Nian"
10+
given-names: "Yuhan (Victoria)"
11+
affiliation: "Rice University"
12+
version: "0.9.5"
13+
date-released: "2026-07-18"
14+
doi: "10.5281/zenodo.17162829"
15+
license: "BSD-3-Clause"
16+
repository-code: "https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit"
17+
url: "https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit"

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An easy-to-use toolkit for visualizing patterns in qualitative data, helping researchers see and share connections between words, concepts and themes alongside in-depth accounts.
44

5-
[![GitHub release](https://img.shields.io/github/v/release/Computational-Ethnography-Lab/cmap_visualization_toolkit?include_prereleases)](https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit/releases)
5+
[![GitHub release](https://img.shields.io/github/v/release/Computational-Ethnography-Lab/cmap_visualization_toolkit?include_prereleases)](https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit/releases) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Computational-Ethnography-Lab/cmap_visualization_toolkit/blob/v0.9.5/visualization_toolkit_final.ipynb)
66

77
## Table of Contents
88
- [Overview](#overview)
@@ -44,7 +44,7 @@ Coming from ATLAS.ti, NVivo, or MAXQDA? The [CMAP QDPX Converter](https://github
4444

4545
### Notebook Version & Local Installation
4646

47-
For an introduction, in an easy to use online version (not for sensitive data) check out the collab version [here](https://colab.research.google.com/drive/1n90EDMSiXhIaOULUMPJ4W4hqdZCh1NQw?usp=sharing)
47+
For an introduction, in an easy to use online version (not for sensitive data) check out the Colab version [here](https://colab.research.google.com/github/Computational-Ethnography-Lab/cmap_visualization_toolkit/blob/v0.9.5/visualization_toolkit_final.ipynb) — it opens the current notebook straight from this repo and self-installs on first run.
4848
You can find a short tutorial on using the toolkit in collab [here](https://vimeo.com/1122226315)). You can read a general description in the working paper [here](https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit/blob/main/documentation/paper.md).
4949
---
5050

@@ -334,6 +334,23 @@ This section also includes validation checks to:
334334

335335
These definitions are critical for interpretability in downstream visualization and clustering.
336336

337+
### Clustering Methods and Supported Distance Metrics
338+
339+
Word-to-word similarity can be computed with one of four methods, chosen with `clustering_method` and paired with a `distance_metric`:
340+
341+
- **1 — RoBERTa embeddings:** contextual embeddings compared with cosine similarity.
342+
- **2 — Co-occurrence:** `cosine` uses frequency-sensitive context vectors; the default uses the Jaccard index (set-based, binary overlap).
343+
- **3 — PMI (Positive Pointwise Mutual Information):** supported with `distance_metric = "cosine"` **only**. PMI builds context vectors whose similarity is meaningful under cosine; other metrics are not defined for this method, so pairing PMI with a non-cosine metric is an unsupported configuration rather than a defect. Use `"cosine"` with method 3.
344+
- **4 — TF-IDF weighted co-occurrence:** `cosine` (or `default`) uses cosine similarity; `distance_metric = "raw_weighted"` selects an experimental unnormalized-sum variant. No other `distance_metric` value is supported for this method.
345+
346+
Combining a method and metric outside these supported pairings — most notably PMI with a non-cosine metric — will not produce a usable similarity matrix. This is expected behavior: select a supported method/metric pair.
347+
348+
### Hierarchical Clustering (Ward Linkage) in the Clustered Heatmap
349+
350+
The heatmap output always includes a dendrogram-ordered version, shown side by side with the standard (unclustered) heatmap, that groups words using hierarchical clustering (Ward linkage) applied to the rows and columns of the word-by-word similarity matrix. This places similar words next to one another and reveals nested groupings.
351+
352+
Ward linkage here operates on each word's full similarity *profile* (its row/column in the matrix). It is a deliberate choice for producing interpretable dendrograms and word groupings, not a transformation of the individual similarity values. The values shown in the standard (unclustered) heatmap are unchanged; the clustered view only reorders and annotates them.
353+
337354
## Troubleshooting
338355

339356
Here are solutions to common issues you might encounter:

documentation/paper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The main paper charts organization and functions. Full mathematical details, rel
6161

6262

6363
# CMAP Organization
64-
CMAP can be run in either a Jupyter environment [via Github](https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit.git) or Google Colab [Colab Link](https://colab.research.google.com/drive/1n90EDMSiXhIaOULUMPJ4W4hqdZCh1NQw?authuser=1#scrollTo=1jgH13I3xLbA&uniqifier=1).
64+
CMAP can be run in either a Jupyter environment [via Github](https://github.com/Computational-Ethnography-Lab/cmap_visualization_toolkit.git) or Google Colab [Colab Link](https://colab.research.google.com/github/Computational-Ethnography-Lab/cmap_visualization_toolkit/blob/v0.9.5/visualization_toolkit_final.ipynb).
6565
Colab is recommended for learning the methods and experimenting with public datasets. For sensitive data or extended development, users can clone the GitHub repository and run the included installation script locally.
6666

6767
```bash

0 commit comments

Comments
 (0)