This project aims to visualize Bible chapters in a 3D space by embedding their textual content using OpenAI's text-embedding-ada-002 model, then applying t-SNE for dimensionality reduction.
-
Clone the repository: git clone https://github.com/dominicpeel/bible-chapters-embedding.git
-
Change directory into the project folder: cd bible-chapters-embedding
-
Install the required packages: pip install -r requirements.txt
-
Set up your OpenAI API key in a
.env
file: echo "OPENAI_API_KEY=your_api_key" > .env
Run the create_embeddings to generate the embeddings of Bible chapters:
python create_embeddings.py
Run the embeddings_vis.py to visualize the embeddings in a 3D scatter plot using t-SNE dimensionality reduction:
python embeddings_vis.py
The script will output a 3D scatter plot of the Bible chapters in your browser.
The project outputs the following files:
embeddings.csv
: A CSV file containing the embeddings for each chapter.embeddings_3d.csv
: A CSV file containing the reduced 3D coordinates for each chapter.
MIT, of course :)