Skip to content
Back to skills

Bertviz

ASecurity

"Route BertViz Transformer attention visualization, neuron-view,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
developmentjavascriptpythonjavabashapifrontendbackend

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 17 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill bertviz --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bertviz?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bertviz
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-bertviz/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-bertviz)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: bertviz
description: "Route BertViz Transformer attention visualization, neuron-view,
  notebook, and HTML export workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# BertViz

Use this repo skill when a task involves BertViz, Transformer attention
visualization, head/model view rendering, neuron-level query/key inspection, or
saving BertViz notebook visualizations as HTML.

## Install and quick check

For ordinary use:

```bash
pip install bertviz
```

For interactive notebooks also install and enable a notebook frontend such as
JupyterLab plus widgets:

```bash
pip install jupyterlab ipywidgets
```

Minimal package/API check:

```bash
python - <<'PY'
from bertviz import head_view, model_view
from bertviz.neuron_view import get_attention
print("bertviz import ok", head_view.__name__, model_view.__name__, get_attention.__name__)
PY
```

For a stronger no-network check, run [`scripts/check_bertviz_environment.py`](scripts/check_bertviz_environment.py).

## Route by task

| User need | Read next |
| --- | --- |
| Visualize standard self-attention tensors from Hugging Face or another Transformer model. | [`sub-skills/attention-views/SKILL.md`](sub-skills/attention-views/SKILL.md) |
| Render sentence-pair head/model views with `sentence_b_start`. | [`sub-skills/attention-views/SKILL.md`](sub-skills/attention-views/SKILL.md) |
| Render encoder, decoder, or cross-attention for sequence-to-sequence models. | [`sub-skills/attention-views/SKILL.md`](sub-skills/attention-views/SKILL.md) |
| Save BertViz output as standalone HTML or use it outside a notebook display call. | [`sub-skills/attention-views/SKILL.md`](sub-skills/attention-views/SKILL.md), or [`sub-skills/neuron-view/SKILL.md`](sub-skills/neuron-view/SKILL.md) for neuron view |
| Inspect query/key neuron contributions using BertViz's modified model classes. | [`sub-skills/neuron-view/SKILL.md`](sub-skills/neuron-view/SKILL.md) |
| Diagnose package installation, notebook display, PyTorch/IPython dependency, or JS asset issues. | [`references/troubleshooting.md`](references/troubleshooting.md) |
| Check whether this skill matches the current BertViz checkout/version. | [`references/repo-provenance.md`](references/repo-provenance.md) |

## Core distinctions

- `head_view` and `model_view` consume attention tensors. They are the right
  choice when the model can return Hugging Face-style attention weights with
  `output_attentions=True`.
- `neuron_view.show` computes a visualization payload from BertViz's modified
  BERT/GPT-2/RoBERTa/XLNet classes because neuron view needs query and key
  vectors, not only attention probabilities.
- BertViz is a visualization tool, not a model explanation guarantee. It helps
  inspect attention patterns but should not be presented as proving causal
  feature attribution.

## Repo-level references and scripts

- [`references/environment-and-install.md`](references/environment-and-install.md)
  explains dependencies, notebook frontend expectations, backend assumptions,
  and offline validation strategy.
- [`references/troubleshooting.md`](references/troubleshooting.md) covers
  cross-cutting install/import/display/runtime symptoms.
- [`references/repo-provenance.md`](references/repo-provenance.md) records the
  source snapshot and evidence paths used to build this skill.
- [`scripts/check_bertviz_environment.py`](scripts/check_bertviz_environment.py)
  checks imports, function signatures, packaged JavaScript assets, and optional
  neuron-view imports without downloading models.

## Safety defaults

- Do not run public notebooks or `from_pretrained(...)` examples automatically
  when network/model downloads are not explicitly allowed.
- Prefer bundled no-network helpers for validation: the root environment check,
  `attention-views/scripts/render_synthetic_attention.py`, and
  `neuron-view/scripts/validate_toy_bert_attention.py`.
- Keep generated outputs and saved HTML in user-chosen working directories;
  BertViz does not require modifying its installed package files.

Files in this skill

  • SKILL.md4 KB
  • references/environment-and-install.md2.6 KB
  • references/repo-provenance.md2.1 KB
  • references/repo-routing-metadata.json312 B
  • references/troubleshooting.md2.6 KB
  • scripts/check_bertviz_environment.py4.2 KB
  • sub-skills/attention-views/SKILL.md1.9 KB
  • sub-skills/attention-views/references/api-reference.md3.8 KB
  • sub-skills/attention-views/references/troubleshooting.md2.6 KB
  • sub-skills/attention-views/references/workflows.md4.7 KB
  • sub-skills/attention-views/scripts/render_synthetic_attention.py6.6 KB
  • sub-skills/neuron-view/SKILL.md3.3 KB
  • sub-skills/neuron-view/references/api-reference.md6.4 KB
  • sub-skills/neuron-view/references/model-compatibility.md4.5 KB
  • sub-skills/neuron-view/references/troubleshooting.md3.3 KB
  • sub-skills/neuron-view/references/workflows.md3.9 KB
  • sub-skills/neuron-view/scripts/validate_toy_bert_attention.py9.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.