Skip to content

HackyRoot/embedding_visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedding Visualization Tool

An interactive web application for visualizing text embeddings from multiple AI models in 3D space. This tool allows you to compare embeddings from OpenAI, Google Gemini, and Cloudflare's BAAI/BGE models.

Features

  • Support for multiple embedding models:
    • OpenAI Ada 002 (1536 dimensions)
    • Google Gemini (768 dimensions)
    • Cloudflare BAAI BGE-Large-EN-V1.5 (1024 dimensions)
  • Interactive 3D visualization using Plot.ly
  • PCA dimensionality reduction
  • Real-time embedding generation
  • User-friendly interface

Prerequisites

  • Python 3.11 or higher
  • API keys for:
    • OpenAI
    • Google Cloud (with Gemini API access)
    • Cloudflare (with AI Worker access)

Installation

  1. Clone the repository:
git clone https://github.com/YOUR_USERNAME/embedding_visualization.git
cd embedding_visualization
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_google_api_key
CLOUDFLARE_API_KEY=your_cloudflare_api_key
CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id

Running the Application

  1. Ensure your virtual environment is activated:
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Start the Flask server:
python app.py
  1. Open your web browser and navigate to:
http://localhost:5000

Example

Tech Stack

  • Backend: Flask web framework
  • Frontend: HTML, CSS, JavaScript
  • Visualization: Plot.ly
  • Dimensionality Reduction: PCA (scikit-learn)

About

Vector embeddings visualization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published