Interactive visualization of text embeddings
! This repo is tested on a Windows platform
- Clone this repo to a folder of your choice
- In the root folder, create a file named ".env" and enter your OpenAI API key in the first line of this file in case you want to use the OpenAI API:
OPENAI_API_KEY="sk-....." - Save and close the .env file
- If you don't have an OpenAI API key yet, you can obtain one here: https://platform.openai.com/account/api-keys
- Click on + Create new secret key
- Enter an identifier name (optional) and click on Create secret key
- In case you want to use one of the open source models API's that are available on huggingface:
Enter your Hugging Face API key in the ".env" file :
HUGGINGFACEHUB_API_TOKEN="hf_....."
- If you don't have an Hugging Face API key yet, you can register at https://huggingface.co/join
- When registered and logged in, you can get your API key in your Hugging Face profile settings
- Open an Anaconda prompt or other command prompt
- Go to the root folder of the project and create a Python environment with conda with
conda env create -f appl-embedding-visualizer.yml
NB: The name of the environment is appl-embedding-visualizer by default. It can be changed to a name of your choice in the first line of the file appl-embedding-visualizer.yml - Activate this environment with
conda activate appl-embedding-visualizer
within the activated conda environment, type python tsne.py