Spaces:
Running
Running
ping98k
commited on
Commit
·
c00b847
1
Parent(s):
802de67
Update README.md to improve clarity and enhance K-Means clustering instructions
Browse files
README.md
CHANGED
@@ -6,12 +6,15 @@ colorTo: yellow
|
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
9 |
-
short_description: 'Exploring text embeddings and group similarity
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
# Embedding WebGPU Playground
|
13 |
|
14 |
-
This is a browser-based playground for exploring text embeddings
|
15 |
|
16 |
## How it works
|
17 |
- **Input text** in the textarea. Use single newlines (`\n`) to separate lines within a group, and triple newlines (`\n\n\n`) to separate groups.
|
@@ -23,18 +26,21 @@ This is a browser-based playground for exploring text embeddings and group simil
|
|
23 |
- Cosine similarity is calculated between all group embeddings, resulting in a group-by-group similarity matrix.
|
24 |
- The similarity matrix is visualized as a heatmap using Plotly (color range locked to 0–1).
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
29 |
|
30 |
## Tech stack
|
31 |
- [@huggingface/transformers](https://www.npmjs.com/package/@huggingface/transformers) (ESM, WebGPU)
|
32 |
- [ONNX Qwen3-Embedding-0.6B-ONNX](https://huggingface.co/onnx-community/Qwen3-Embedding-0.6B-ONNX)
|
33 |
- [Plotly.js](https://plotly.com/javascript/) (UMD)
|
|
|
34 |
|
35 |
## Usage
|
36 |
1. Enter or paste your text in the textarea.
|
37 |
-
2. Separate groups with triple newlines.
|
38 |
-
3. Click **
|
|
|
39 |
|
40 |
---
|
|
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
9 |
+
short_description: 'Exploring text embeddings and group similarity'
|
10 |
+
models:
|
11 |
+
- onnx-community/Qwen3-0.6B-ONNX
|
12 |
+
- onnx-community/Qwen3-Embedding-0.6B-ONNX
|
13 |
---
|
14 |
|
15 |
# Embedding WebGPU Playground
|
16 |
|
17 |
+
This is a browser-based playground for exploring text embeddings, group similarity, and clustering using WebGPU and ONNX models.
|
18 |
|
19 |
## How it works
|
20 |
- **Input text** in the textarea. Use single newlines (`\n`) to separate lines within a group, and triple newlines (`\n\n\n`) to separate groups.
|
|
|
26 |
- Cosine similarity is calculated between all group embeddings, resulting in a group-by-group similarity matrix.
|
27 |
- The similarity matrix is visualized as a heatmap using Plotly (color range locked to 0–1).
|
28 |
|
29 |
+
## K-Means Clustering & UMAP
|
30 |
+
- Enter the number of clusters in the **Clusters:** input.
|
31 |
+
- Click **Cluster & Show UMAP** to cluster all lines (ignoring groups) using K-Means and visualize the result with UMAP in a scatter plot.
|
32 |
+
- After clustering, the textarea is updated to group lines by cluster (triple newlines between clusters), and the heatmap is automatically refreshed to reflect the new groupings.
|
33 |
|
34 |
## Tech stack
|
35 |
- [@huggingface/transformers](https://www.npmjs.com/package/@huggingface/transformers) (ESM, WebGPU)
|
36 |
- [ONNX Qwen3-Embedding-0.6B-ONNX](https://huggingface.co/onnx-community/Qwen3-Embedding-0.6B-ONNX)
|
37 |
- [Plotly.js](https://plotly.com/javascript/) (UMD)
|
38 |
+
- [umap-js](https://github.com/PAIR-code/umap-js) (for 2D projection)
|
39 |
|
40 |
## Usage
|
41 |
1. Enter or paste your text in the textarea.
|
42 |
+
2. Separate groups with triple newlines if you want to compare group similarity.
|
43 |
+
3. Click **Show Similarity Heatmap** to compute and visualize group similarities.
|
44 |
+
4. To cluster all lines, set the number of clusters and click **Cluster & Show UMAP**. The textarea and heatmap will update to reflect the new clusters.
|
45 |
|
46 |
---
|