Spaces:
Running
Running
ping98k commited on
Commit ·
88218fc
1
Parent(s): f92828b
Refactor README.md to enhance feature descriptions and improve usage instructions for clarity and consistency.
Browse files15 unmodified lines16171819202122232425262728293031323334354 unmodified lines4041424344454615 unmodified linesThis is a browser-based playground for exploring text embeddings, group similarity, and clustering using WebGPU and ONNX models.## How it works- **Input text** in the textarea. Use single newlines (`\n`) to separate lines within a group, and triple newlines (`\n\n\n`) to separate groups.- For each line, the following prompt is used:`Instruct: Given a textual input sentence, retrieve relevant categories that best describe it.\nQuery:{your sentence}`- All lines in a group are embedded in a single batch call, with pooling set to `mean` and normalization enabled.- Each group is averaged to a single embedding.- Cosine similarity is calculated between all group embeddings, resulting in a group-by-group similarity matrix.- The similarity matrix is visualized as a heatmap using Plotly (color range locked to 0–1).## K-Means Clustering & UMAP- Enter the number of clusters in the **Clusters:** input.- Click **Cluster & Show UMAP** to cluster all lines (ignoring groups) using K-Means and visualize the result with UMAP in a scatter plot.- 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.## Tech stack- [@huggingface/transformers](https://www.npmjs.com/package/@huggingface/transformers) (ESM, WebGPU)4 unmodified lines## Usage1. Enter or paste your text in the textarea.2. Separate groups with triple newlines if you want to compare group similarity.3. Click **Show Similarity Heatmap** to compute and visualize group similarities.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.---15 unmodified lines16171819202122232425262728293031324 unmodified lines3738394041424344454615 unmodified linesThis is a browser-based playground for exploring text embeddings, group similarity, and clustering using WebGPU and ONNX models.## Features- **Text search**: Use your browser's search (Ctrl+F) to quickly find and highlight text within the textarea or results.- **Text input**: Enter text in the textarea. Use single newlines (`\n`) to separate lines within a group, and triple newlines (`\n\n\n`) to separate groups.- **Group similarity heatmap**: Click **Show Similarity Heatmap** to compute and visualize cosine similarity between group embeddings as a heatmap.- **Search cluster reordering**: If a group header contains the word `search`, you can control how other groups and lines are ordered relative to the search group using the **Search Cluster Sort Mode** dropdown:- **By Group Similarity**: Orders groups by similarity to the search group, and lines within each group by similarity to the search group embedding.- **By Max Search Line**: Orders lines within each group by their maximum similarity to any line in the search group.- **K-Means & Balanced K-Means clustering**: Set the number of clusters and clustering type, then click **Clustering** to group all lines into clusters. The textarea is updated to reflect the new clusters.- **UMAP scatter plot**: Click **Cluster Plot** to visualize clusters in 2D using UMAP. Cluster names are shown in the legend.- **Cluster naming**: Click **Naming Cluster** to generate descriptive names for each cluster using a text generation model. Names are updated in both the textarea and the scatter plot legend.- **Progress bar**: All major actions display a progress bar during processing.## Tech stack- [@huggingface/transformers](https://www.npmjs.com/package/@huggingface/transformers) (ESM, WebGPU)4 unmodified lines## Usage1. Enter or paste your text in the textarea.2. Separate groups with triple newlines if you want to compare group similarity.3. (Optional) Use the **Search Cluster Sort Mode** dropdown to control how the search cluster reorders groups/lines.4. Click **Show Similarity Heatmap** to compute and visualize group similarities.5. To cluster all lines, set the number of clusters and click **Clustering**. The textarea and heatmap will update to reflect the new clusters.6. Click **Cluster Plot** to visualize clusters in 2D.7. Click **Naming Cluster** to generate descriptive names for each cluster.---
README.md+16-16