metadata
title: Sentence Transformers
emoji: 🏢
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 5.33.1
app_file: app.py
pinned: false
Sentence Transformers Demo
Interactive web application for semantic text similarity analysis using Sentence Transformers models.
Features
1. Paraphrase Mining
- Find sentences with similar meaning in a text corpus
- Support for multiple language models
- Adjustable similarity threshold
- Export results in CSV format
2. Semantic Textual Similarity (STS)
- Calculate semantic similarity between two sets of sentences
- Uses advanced sentence transformation models
- Compare sentences in different languages
- Export results in CSV format
Available Models
Lajavaness/bilingual-embedding-large
: Multilingual model optimized for multiple languagessentence-transformers/all-mpnet-base-v2
: High-quality general-purpose modelintfloat/multilingual-e5-large-instruct
: Multilingual model with instructions
Requirements
- Python 3.8+
- Dependencies listed in
requirements.txt
Installation
- Clone the repository:
git clone https://github.com/yourusername/sentence-transformers.git
cd sentence-transformers
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
.\venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
Usage
- Start the application:
python app.py
Open your browser at
http://localhost:7860
Select the desired functionality:
- Paraphrase Mining: Upload a CSV file with sentences to analyze
- STS: Upload two CSV files with sentences to compare
Select the model and adjust the similarity threshold
Click "Process" to start the analysis
Download results in CSV format
CSV File Format
CSV files must contain a column named "text" with the sentences to analyze:
text
"First sentence to analyze"
"Second sentence to analyze"
...
Notes
- Temporary files are automatically cleaned up every 30 minutes
- Using complete sentences is recommended for better results
- Models may take time to load on first use
License
MIT
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference