Spaces:
Sleeping
Sleeping
Commit History
-
Optional local LLM labelling with Ollama
Labelling via the Hugging Face Inference API needs paid credits once the monthly allowance is used up (HTTP 402), and sends the reports to a third- party provider. A local Ollama server avoids both. The app now offers a "Local (Ollama)" labelling backend, shown only when an Ollama server is reachable with at least one model pulled, so the hosted Space is unchanged. Prompts, label cleaning and caching are shared with the API path; local labels get their own cache files (llm_labels_ollama-...) and are kept out of the HF cost estimate. A placeholder token is passed so the user's HF token is never sent to the local server. generate_llm_labels() takes an optional base_url for the same in scripts, and run_pipeline.py exposes it as LLM_BASE_URL (None keeps the API).96f0c0e
-
Reseed the zero-shot category box when its widget state is dropped
Streamlit discards a widget's state when the widget is not rendered on a run, and several paths skip the Zero-Shot tab for a run or two (notably the st.stop() that holds the script while precomputed .npy/.json files are being uploaded). The category list then came back blank, with no way back to the preset short of re-picking it from the dropdown. The box is now reseeded from the selected preset whenever it is empty and the user has not edited it themselves; an on_change flag records a deliberate edit, so clearing the list by hand still sticks. Pre-existing behaviour, not introduced by the 2.0.0 refactor.ddba918
-
Ignore packaging build artefacts
b66e0f9 -
Version 2.0.0 everywhere; changelog; cite concept DOI and published method paper
pyproject (was 0.1.0) and CITATION.cff (was 1.0.0) now both say 2.0.0, and mosaic_core.__version__ reads it from the package metadata. The README badge uses the Zenodo concept DOI so it always resolves to the latest release.fd3956f -
Docs and Docker for the single app.py entry point and the mosaic_core API
README documents the Advanced analyses toggle, the library modules with runnable examples for metrics, zero-shot and condition comparison, and the updated test suite. Dockerfile (Hugging Face Space) now runs app.py.7b55048 -
Single entry point: the extended app becomes app.py
The old app.py was a strict subset of app2.py (its only extra, a 'Save JSONL' button, was a stub that saved nothing); the extended features are now behind a toggle instead.da4009f -
Put zero-shot and condition comparison behind an 'Advanced analyses' toggle
Off by default: the interface shows the core workflow (Main Results, Run History, Compare Runs). On (or ?advanced=1 in the URL): adds the Zero-Shot Classification and Condition Comparison tabs and the skip-pipeline upload mode.e65d62e -
app2.py calls mosaic_core instead of its own copies of the methods
Streamlit keeps only thin cached wrappers (model loading, progress bar). Match tables are identical to the previous version on a real 57x46-topic comparison.036b081 -
Test the methods in mosaic_core; run full suite plus a Streamlit-free job in CI
d198462 -
Move methods into mosaic_core: zero-shot, condition comparison, topic metrics
Zero-shot classification, centred-cosine condition comparison, MAD-calibrated match threshold, hub z-scores, greedy matching, shared-theme chi2 / Cramer's V, diversity ratio, C_embed and C_v now live in importable, Streamlit-free modules. Code is moved unchanged (checked output-equivalent against app2.py on randomised inputs). Streamlit and plotting libraries become the optional [app] extra.081f924 -
Embedding coherence as paper's C_embed; clarify centred-cosine docs; ignore local tutorial data
e6844dc
-
enhance comparison
0d5bf30
-
README: recommend pinned requirements.lock.txt (Python 3.11-3.13) for tutorial installs
290f0da -
Expand README: clear step-by-step Hugging Face token setup for LLM labelling
b5e5cc2 -
Add pinned requirements.lock.txt for reproducible tutorial installs
a6c6479 -
Fix zero-shot hang/crash: don't pickle embedding model via cache_data
b1b8e6c -
Zero-shot questionnaire presets (MPE92, 11D-ASC) + savable category sets; clearer centered-cosine threshold help, default 0.50
5f5e2fd
-
Zero-shot model match, LLM model picker, prompt persistence + tweaks, export label
- Zero-shot: auto-default the embedding model to the one detected in the uploaded precomputed .npy filename (+ warning), and add a clear dimension-mismatch error in run_zeroshot instead of BERTopic's cryptic X/Y matrix error. - LLM labelling: replace free-text model id with a dropdown (Llama-3.1-8B first) plus a Custom option. - Prompts: persist edits to disk (.mosaic_user_prompts.json) with a 'Save as my default' button; load them automatically; reset also clears the saved file. - Default label prompt: prefer concise noun phrases, avoid 'Experiencing/Perceiving' gerund prefixes. - Add an editable 'Export name' label used for downloaded filenames, decoupled from the storage folder so projects can be renamed post-run without recomputing.b041353
-
Reframe condition-comparison similarity as a correlation
Mean-centered cosine equals a Pearson correlation: +1 same, 0 unrelated, negative = contrasting. Threshold slider now 0.0-0.90 (default 0.45) instead of allowing negative thresholds, and the help/info/colorbar explain the scale so smaller-than-raw-cosine values and negative heatmap cells are not confusing.35796c2 -
Disable Streamlit file watcher on the Space
The watcher introspects every transformers module on each rerun, spamming the logs with harmless 'No module named torchvision' tracebacks from unused vision models. The watcher is pointless on a Space (code is static at runtime).e73fbc5 -
Fix matplotlib 3.9+ crash: replace removed cm.get_cmap with plt.get_cmap
Affected the zero-shot, condition-comparison, run-history and compare-runs bar charts (matplotlib.cm.get_cmap was removed in 3.9).84eca95 -
Add 'Load precomputed embeddings' data-source option
New input method in app2: upload a .npy + docs.json (from run_embeddings.py) and skip embedding entirely. A one-row-per-document CSV is synthesized so the rest of the pipeline (text column, counts, metadata, export) works unchanged; the uploaded files are written to the session cache path so the existing 'embeddings already exist' check goes straight to topic modelling. Validates that npy rows match docs.json length.d62b259 -
Fix condition comparison (mean-center embeddings), heatmap show-all toggle, CLI for run_embeddings, README local-embedding guide
- compute_condition_similarity now mean-centers embeddings before cosine, removing the anisotropy that made all topic pairs score 0.6-0.99 and unrelated topics appear strongly correlated. Scores now span ~ -0.4..0.9. - Heatmap uses a diverging scale centered at 0; added 'Show ALL topics' toggle alongside the top-N slider; annotations auto-hide on large grids. - Match-threshold slider rescaled for centered cosine (default 0.50). - run_embeddings.py: accept CLI args (--csv/--dataset/--model/--text-col/ --device/--no-split/--min-words); run_embeddings.sh forwards "$@". - README: add 'Pre-computing embeddings locally' section incl. HPC/SLURM.1bdf54e -
Add embed-only script, random seed, editable LLM prompts, sharper map, top-N heatmap
- run_embeddings.py / run_embeddings.sh: compute and save ONLY embeddings (no topic model, no LLM, no HF_TOKEN). Writes the files the app reads; SLURM script targets a GPU node (e.g. Artemis) for the Qwen 4B model. - app2: random seed control (sidebar) wired into both UMAPs and subsampling; topic-model disk cache is now config-keyed (per seed/config), with a legacy fallback, so changing settings actually recomputes. - app2: LLM system prompt and user template are now editable in the UI (with placeholder validation and reset); folded into the label cache key. - app2: topic map rendered as a high-DPI image (no more blur) with sliders for label size and DPI; PNG export uses the chosen DPI. - app2: cosine-similarity heatmap limited to the top-N largest topics per condition (default 10x10) for readability; export bumped to 300 DPI.0508a41 -
Deploy app2 on the Space and support Qwen 4B embeddings
- Dockerfile now runs app2.py (was app.py) so the Space serves the improved interface. - Add Qwen/Qwen3-Embedding-4B to the main embedding selectbox so precomputed 4B embeddings are usable in the main pipeline. - app2: fix zero-shot 3-value unpack crash, add reusable .zip bundle (embeddings + docs + topics summary), CPU/GPU runtime indicator, and per-session private upload workspace.63338bc -
Fix CoherenceModel crash from tokenization mismatch in app2
a22a56a -
Add app2.py (alternative interface) and its deps (plotly, seaborn, scipy)
ae99e4e -
added message for 2.0 version
a8cad6a
-
Add Step 4: save topic map, bar chart and CSV to outputs/
1e0b715 -
changes for HPC
6cd2787 -
modified cuda for artemis
5a396c4 -
restore paper to latest version
b9e3c51 -
added run pipeline for big dataset (precompute outside of streamlit
4779f83
-
Update app.py
Verified signaturef2d917b -
change figs for better readability of labels when many topics (datamapplot.create_plot)
Verified signature209cad8
-
Merge branch 'main' of https://github.com/romybeaute/MOSAICapp
6fc3400 -
modified paper
266166c -
Update README.md
Romy BeautéUnverified signature42d5f20 -
Update README.md
Romy BeautéUnverified signatured5ac244 -
Update README.md
Romy BeautéUnverified signature4df9730 -
Update README.md
Romy BeautéUnverified signature7ae4489 -
Update README.md
Romy BeautéUnverified signature4e7977e
-
emphasie mosaic_core
2e057a7 -
emphasie mosaic_core
7dbf734 -
emphasie mosaic_core
305687d -
emphasie mosaic_core
ae2cd1c -
trim to fit
c8b282a -
anil's feedbacks applied
d886c74
-
added sentence for generalisability
1ab85d6 -
added sentence for generalisability
307e9fb