--- title: 📝 BERT + ELMo Sentence Embeddings Generator emoji: 🌍 colorFrom: gray colorTo: red --- # 📝 BERT + ELMo Sentence Embeddings Generator This is a Streamlit application that generates sentence embeddings using BERT and ELMo. It supports single sentence input as well as bulk analysis via CSV uploads. --- ## 🌟 Features - **Model Options**: Choose from multiple BERT variants or ELMo. - **Input Options**: - Single sentence - CSV file with a `sentence` column - **Embedding Generation**: - BERT (Base and Large, Cased and Uncased) - ELMo - **Output**: Download embeddings in a CSV file containing: - Original sentence - Source (Single or CSV) - Embedding vector - **Preview**: View a preview of embeddings for the first 5 sentences. --- ## 🖥️ How It Works 1. Select the desired model from the dropdown menu. 2. Enter a sentence or upload a CSV file with sentences. 3. Click **Generate Embeddings** to compute embeddings. 4. View the summary including: - Source type - Model used - Embeddings shape 5. Download the embeddings CSV for further use. --- ## 🧩 Use Cases - **Semantic Search**: Find similar sentences or phrases. - **Clustering**: Group sentences with similar meanings. - **Machine Learning**: Use embeddings as features for classification or regression. - **Visualization**: Explore embeddings in 2D/3D space for analysis. --- ## ⚠️ Notes - Ensure CSV files have a column named `sentence`. - BERT and ELMo produce embeddings of different dimensions. - Single sentence input returns embeddings of shape `(1, embedding_dim)`. - CSV input returns embeddings of shape `(num_sentences, embedding_dim)`.