This project uses sentence embeddings to visualize and analyze the relationship between different sentences in a 2D or 3D space. It supports two main dimensionality reduction techniques: PCA (Principal Component Analysis) for 3D visualization and t-SNE (t-Distributed Stochastic Neighbor Embedding) for 2D visualization.
├── README.md
├── requirements.txt
└── src
├── app.py
└── utils.py
- Generate Sentence Embeddings: Using pre-trained models from SentenceTransformers.
- Visualize Embeddings: Visualize the relationship between sentences using 3D PCA or 2D t-SNE.
- Clustering: Optionally apply KMeans clustering to group similar sentences.
- Export Results: Download the projection results as a CSV file.
-
Clone the repository:
git clone https://github.com/yourusername/sentence-embedding-visualization.git cd sentence-embedding-visualization
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
To run the app locally, use the following command:
streamlit run app.py