@maxr0ssi/embedding-lab 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/EmbeddingExplorer.d.ts +7 -0
- package/dist/EmbeddingExplorer.d.ts.map +1 -0
- package/dist/components/InputPanel/CustomInput.d.ts +8 -0
- package/dist/components/InputPanel/CustomInput.d.ts.map +1 -0
- package/dist/components/InputPanel/ExamplePicker.d.ts +2 -0
- package/dist/components/InputPanel/ExamplePicker.d.ts.map +1 -0
- package/dist/components/InputPanel/InputPanel.d.ts +2 -0
- package/dist/components/InputPanel/InputPanel.d.ts.map +1 -0
- package/dist/components/InputPanel/WordBar.d.ts +3 -0
- package/dist/components/InputPanel/WordBar.d.ts.map +1 -0
- package/dist/components/InspectorPanel/DimensionComparison.d.ts +12 -0
- package/dist/components/InspectorPanel/DimensionComparison.d.ts.map +1 -0
- package/dist/components/InspectorPanel/InspectorPanel.d.ts +2 -0
- package/dist/components/InspectorPanel/InspectorPanel.d.ts.map +1 -0
- package/dist/components/InspectorPanel/NeighborOverlay.d.ts +17 -0
- package/dist/components/InspectorPanel/NeighborOverlay.d.ts.map +1 -0
- package/dist/components/InspectorPanel/NeighborTable.d.ts +10 -0
- package/dist/components/InspectorPanel/NeighborTable.d.ts.map +1 -0
- package/dist/components/PlotPanel/DimensionPicker.d.ts +5 -0
- package/dist/components/PlotPanel/DimensionPicker.d.ts.map +1 -0
- package/dist/components/PlotPanel/ModeToggle.d.ts +2 -0
- package/dist/components/PlotPanel/ModeToggle.d.ts.map +1 -0
- package/dist/components/PlotPanel/PlotPanel.d.ts +2 -0
- package/dist/components/PlotPanel/PlotPanel.d.ts.map +1 -0
- package/dist/data/examples/index.d.ts +10 -0
- package/dist/data/examples/index.d.ts.map +1 -0
- package/dist/embedding-lab.cjs.js +1961 -0
- package/dist/embedding-lab.css +1 -0
- package/dist/embedding-lab.es.js +64723 -0
- package/dist/hooks/useThemeColors.d.ts +16 -0
- package/dist/hooks/useThemeColors.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/api.d.ts +8 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/plotly-custom.d.ts +7 -0
- package/dist/lib/plotly-custom.d.ts.map +1 -0
- package/dist/math/dimensionAnalysis.d.ts +15 -0
- package/dist/math/dimensionAnalysis.d.ts.map +1 -0
- package/dist/math/distance.d.ts +27 -0
- package/dist/math/distance.d.ts.map +1 -0
- package/dist/math/projection.d.ts +7 -0
- package/dist/math/projection.d.ts.map +1 -0
- package/dist/store/actions.d.ts +2 -0
- package/dist/store/actions.d.ts.map +1 -0
- package/dist/store/embeddingStore.d.ts +13 -0
- package/dist/store/embeddingStore.d.ts.map +1 -0
- package/dist/store/selectors.d.ts +31 -0
- package/dist/store/selectors.d.ts.map +1 -0
- package/dist/types.d.ts +161 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Embedding Geometry Lab
|
|
2
|
+
|
|
3
|
+
Interactive visualization tool for exploring word and sentence embeddings.
|
|
4
|
+
|
|
5
|
+
> Words are vectors; meaning is movement.
|
|
6
|
+
|
|
7
|
+
## What is this?
|
|
8
|
+
|
|
9
|
+
A representation-learning microscope. Pick words, plot their embeddings in 2D/3D, explore raw dimensions, build semantic axes, scrub through transformer layers, and watch meaning emerge from geometry.
|
|
10
|
+
|
|
11
|
+
## Docs
|
|
12
|
+
|
|
13
|
+
- [Architecture & Design](docs/design/architecture.md)
|
|
14
|
+
|
|
15
|
+
## Stack
|
|
16
|
+
|
|
17
|
+
- **Frontend:** React + TypeScript + Plotly
|
|
18
|
+
- **Backend:** Python (reuses ResumeAI API) + HuggingFace transformers
|
|
19
|
+
- **Package:** `@maxr0ssi/embedding-lab`
|
|
20
|
+
|
|
21
|
+
## Status
|
|
22
|
+
|
|
23
|
+
Design phase.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EmbeddingExplorerProps } from './types';
|
|
2
|
+
import './styles/base.css';
|
|
3
|
+
import './styles/header.css';
|
|
4
|
+
import './styles/plot.css';
|
|
5
|
+
import './styles/split-pane.css';
|
|
6
|
+
export declare function EmbeddingExplorer({ apiBaseUrl, apiKey, className, initialExample, height, scrollContent, hideHeader, style, }: EmbeddingExplorerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=EmbeddingExplorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddingExplorer.d.ts","sourceRoot":"","sources":["../src/EmbeddingExplorer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAatD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AAEjC,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,MAAM,EACN,SAAS,EACT,cAAc,EACd,MAAe,EACf,aAAa,EACb,UAAU,EACV,KAAK,GACN,EAAE,sBAAsB,2CAkKxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../../styles/input.css';
|
|
2
|
+
interface CustomInputProps {
|
|
3
|
+
apiBaseUrl?: string;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function CustomInput({ apiBaseUrl, apiKey }: CustomInputProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=CustomInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomInput.d.ts","sourceRoot":"","sources":["../../../src/components/InputPanel/CustomInput.tsx"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAC;AAEhC,UAAU,gBAAgB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CA+GnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExamplePicker.d.ts","sourceRoot":"","sources":["../../../src/components/InputPanel/ExamplePicker.tsx"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,4CAyB5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputPanel.d.ts","sourceRoot":"","sources":["../../../src/components/InputPanel/InputPanel.tsx"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,4CA6CzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WordBar.d.ts","sourceRoot":"","sources":["../../../src/components/InputPanel/WordBar.tsx"],"names":[],"mappings":"AAEA,OAAO,0BAA0B,CAAC;AAkBlC,wBAAgB,OAAO,mDA0EtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DimensionComparison as ComparisonData } from '../../math/distance';
|
|
2
|
+
import '../../styles/comparison.css';
|
|
3
|
+
interface DimensionComparisonProps {
|
|
4
|
+
wordA: string;
|
|
5
|
+
wordB: string;
|
|
6
|
+
comparison: ComparisonData;
|
|
7
|
+
onPlotDims: (dimX: number, dimY: number, force2D?: boolean) => void;
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function DimensionComparison({ wordA, wordB, comparison, onPlotDims, onBack, }: DimensionComparisonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=DimensionComparison.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DimensionComparison.d.ts","sourceRoot":"","sources":["../../../src/components/InspectorPanel/DimensionComparison.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,6BAA6B,CAAC;AAErC,UAAU,wBAAwB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,MAAM,GACP,EAAE,wBAAwB,2CAqE1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InspectorPanel.d.ts","sourceRoot":"","sources":["../../../src/components/InspectorPanel/InspectorPanel.tsx"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,4CAkD7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EmbeddingState } from '../../types';
|
|
2
|
+
import '../../styles/overlay.css';
|
|
3
|
+
interface NeighborOverlayProps {
|
|
4
|
+
selectedText: string | null;
|
|
5
|
+
selectedIndex: number | null;
|
|
6
|
+
neighbors: {
|
|
7
|
+
index: number;
|
|
8
|
+
text: string;
|
|
9
|
+
similarity: number;
|
|
10
|
+
}[];
|
|
11
|
+
state: EmbeddingState;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onPlotDims: (dimX: number, dimY: number, force2D?: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function NeighborOverlay({ selectedText, selectedIndex, neighbors, state, onClose, onPlotDims, }: NeighborOverlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=NeighborOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeighborOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/InspectorPanel/NeighborOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,0BAA0B,CAAC;AAElC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrE;AAED,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,aAAa,EACb,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,GACX,EAAE,oBAAoB,kDAmEtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface NeighborTableProps {
|
|
2
|
+
neighbors: {
|
|
3
|
+
index: number;
|
|
4
|
+
text: string;
|
|
5
|
+
similarity: number;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
export declare function NeighborTable({ neighbors }: NeighborTableProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=NeighborTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeighborTable.d.ts","sourceRoot":"","sources":["../../../src/components/InspectorPanel/NeighborTable.tsx"],"names":[],"mappings":"AAEA,UAAU,kBAAkB;IAC1B,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClE;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,kBAAkB,kDAiC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DimensionPicker.d.ts","sourceRoot":"","sources":["../../../src/components/PlotPanel/DimensionPicker.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC;AAQnC,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,kDA4KtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModeToggle.d.ts","sourceRoot":"","sources":["../../../src/components/PlotPanel/ModeToggle.tsx"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,mDAyCzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlotPanel.d.ts","sourceRoot":"","sources":["../../../src/components/PlotPanel/PlotPanel.tsx"],"names":[],"mappings":"AASA,wBAAgB,SAAS,4CAwUxB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PremadeExample } from '../../types';
|
|
2
|
+
interface ExampleMeta {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const exampleManifest: ExampleMeta[];
|
|
8
|
+
export declare function loadExample(id: string): PremadeExample | null;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,WAAW,EAaxC,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAS7D"}
|