Skip to content

Commit c71f016

Browse files
committed
feat: add visualization with Atlas
1 parent 84fe98c commit c71f016

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

playground/12-embeddings.ipynb

+35
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,41 @@
294294
"# This line actaully generates the embeddings\n",
295295
"plot_embeddings = [embedding_from_string(plot, model=\"text-embedding-ada-002\") for plot in movie_plots]"
296296
]
297+
},
298+
{
299+
"attachments": {},
300+
"cell_type": "markdown",
301+
"metadata": {},
302+
"source": [
303+
"## Visualizing our embeddings with Atlas"
304+
]
305+
},
306+
{
307+
"cell_type": "code",
308+
"execution_count": 18,
309+
"metadata": {},
310+
"outputs": [],
311+
"source": [
312+
"from nomic import atlas"
313+
]
314+
},
315+
{
316+
"cell_type": "code",
317+
"execution_count": 21,
318+
"metadata": {},
319+
"outputs": [],
320+
"source": [
321+
"data = movies[[\"Title\", \"Genre\"]].to_dict(\"records\")"
322+
]
323+
},
324+
{
325+
"cell_type": "code",
326+
"execution_count": null,
327+
"metadata": {},
328+
"outputs": [],
329+
"source": [
330+
"atlas.map_embeddings(embeddings=np.array(plot_embeddings), data=data)"
331+
]
297332
}
298333
],
299334
"metadata": {

playground/embeddings/screenshot.png

187 KB
Loading

requirements.txt

+11
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ asttokens==2.2.1
99
async-timeout==4.0.2
1010
attrs==23.1.0
1111
backcall==0.2.0
12+
backoff==2.2.1
1213
beautifulsoup4==4.12.2
1314
bleach==6.0.0
1415
blinker==1.6.2
1516
certifi==2022.12.7
1617
cffi==1.15.1
1718
charset-normalizer==3.1.0
1819
click==8.1.3
20+
cohere==4.3.0
1921
comm==0.1.3
2022
debugpy==1.6.7
2123
decorator==5.1.1
@@ -36,6 +38,7 @@ isoduration==20.11.0
3638
itsdangerous==2.1.2
3739
jedi==0.18.2
3840
Jinja2==3.1.2
41+
jsonlines==3.1.0
3942
jsonpointer==2.3
4043
jsonschema==4.17.3
4144
jupyter==1.0.0
@@ -47,15 +50,19 @@ jupyter_server==2.5.0
4750
jupyter_server_terminals==0.4.4
4851
jupyterlab-pygments==0.2.2
4952
jupyterlab-widgets==3.0.7
53+
loguru==0.7.0
54+
markdown-it-py==2.2.0
5055
MarkupSafe==2.1.2
5156
matplotlib-inline==0.1.6
57+
mdurl==0.1.2
5258
mistune==2.0.5
5359
multidict==6.0.4
5460
nbclassic==0.5.5
5561
nbclient==0.7.3
5662
nbconvert==7.3.1
5763
nbformat==5.8.0
5864
nest-asyncio==1.5.6
65+
nomic==1.1.6
5966
notebook==6.5.4
6067
notebook_shim==0.2.2
6168
numpy==1.24.3
@@ -74,7 +81,9 @@ prompt-toolkit==3.0.38
7481
psutil==5.9.5
7582
ptyprocess==0.7.0
7683
pure-eval==0.2.2
84+
pyarrow==12.0.0
7785
pycparser==2.21
86+
pydantic==1.10.7
7887
Pygments==2.15.1
7988
pyrsistent==0.19.3
8089
python-dateutil==2.8.2
@@ -90,6 +99,7 @@ regex==2023.3.23
9099
requests==2.28.2
91100
rfc3339-validator==0.1.4
92101
rfc3986-validator==0.1.1
102+
rich==13.3.5
93103
Send2Trash==1.8.0
94104
six==1.16.0
95105
sniffio==1.3.0
@@ -114,5 +124,6 @@ webencodings==0.5.1
114124
websocket-client==1.5.1
115125
Werkzeug==2.3.3
116126
widgetsnbextension==4.0.7
127+
wonderwords==2.2.0
117128
yarl==1.9.1
118129
zipp==3.15.0

0 commit comments

Comments
 (0)