Spaces:
Sleeping
Sleeping
File size: 1,199 Bytes
a70668e 37e5bdb 924cd30 a70668e 9108ddd a70668e 37e5bdb a70668e 37e5bdb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ---
title: Word Importance Evaluator
emoji: 🔬
colorFrom: yellow
colorTo: blue
sdk: gradio
sdk_version: "5.49.1"
app_file: app.py
pinned: false
license: mit
---
# Word Importance Evaluator
Drop-one embedding analysis using `sentence-transformers/static-retrieval-mrl-en-v1`.
Each word's importance score = the semantic distance introduced by omitting that word
from the prompt (higher = more critical to the meaning).
## Features
- **Importance bar chart** — horizontal bars coloured by a hot→cold colormap, with a draggable threshold line
- **Distribution per word** — violin-style sampled spread showing where each word's importance would land under paraphrase jitter
- **Threshold filter** — highlighted HTML output and summary of words above the cutoff
- **Multi-line prompt support** — all lines are concatenated into a single word list
## Usage
1. Paste a prompt (e.g. a Stable Diffusion caption)
2. Adjust the importance threshold (default 0.30)
3. Adjust distribution sample count if desired
4. Click **Analyse →**
## Files
| File | Purpose |
|---|---|
| `app.py` | Full Gradio Space — core evaluator code is unchanged |
| `requirements.txt` | Python dependencies |
|