--- emoji: 📊 title: 🤖 BERT + ELMo Sentence Similarity Analyzer --- # 🤖 BERT + ELMo Sentence Similarity Analyzer This Gradio app allows you to compute semantic similarity between sentences using **BERT** and **ELMo** embeddings. Users can add sentences, select a BERT variant, and see pairwise similarity matrices. --- ## 🚀 Features - Supports multiple BERT variants: - **BERT Large Uncased** (1024 dims, recommended for similarity) - **BERT Large Cased** (1024 dims, preserves capitalization) - **BERT Base Uncased** (768 dims, faster) - **BERT Base Cased** (768 dims) - **ELMo embeddings** (1024 dims, context-aware) - Mean-pooling over tokens for BERT - Pairwise cosine similarity using PyTorch & Scikit-learn - Clear and reset stored sentences anytime - Easy-to-use Gradio interface with live status updates --- ## 📖 How to Use 1. **Choose Model**: Select your preferred BERT variant (uncased recommended for semantic similarity). 2. **Add Sentences**: Type a sentence and click **Add Sentence**. 3. **Repeat**: Add at least 2 sentences to compute similarity. 4. **Compute Similarity**: Click **Compute Similarity** to generate pairwise similarity matrices. 5. **Clear All**: Reset all stored sentences and embeddings. > Values closer to `1.0` indicate higher semantic similarity. --- ## 🧰 Requirements Install dependencies from `requirements.txt`: ```bash pip install -r requirements.txt