Generate a 3D map of links based on their embeddings using OpenAI's embedding API
- Clone this repo and cd into its root directory
- Create a file called
key.txtin the root directory and paste in your OpenAI API key there - Run
python3 -m venv venvto create a virtual environment - Run
source venv/bin/activateto activate it - Run
pip install -r requirements.txtto install dependency - Run
python main.pyto run the script (it will prompt you to provide URLs and page titles) - You can view your completed map at
viz/index.html. - You can drag the nodes of the map around to rotate the map in 3D
- You can also zoom in and out using normal zoom gestures
- Clicking on the nodes or text labels should take you to the original URLs
- You can see an example map at
example_viz/index.htmlwhich was generated from some Wikipedia pages (the source data and embeddings can be found intest_dataandtest_embeddings) - The
example_vizfolder is also publicly hosted so you can test interacting with the map at https://example-embed-map.netlify.app/