---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:111476
- loss:CosineSimilarityLoss
base_model: sergeyzh/LaBSE-ru-sts
widget:
- source_sentence: 'трюковый самокат plank 180 белый '
sentences:
- смарт-телевизор 75 sony kd-75x950h
- самокат для трюков плэнк 1.80 м белый
- xiaomi mi 11 8gb 128gb
- source_sentence: 'вейп vaporesso xros '
sentences:
- садовая ограда классика 4 2 м белый
- кухонные весы
- электронная сигарета voopoo drag
- source_sentence: серьги l atelier precieux 1628710
sentences:
- фильтр hepa для пылесоса варис st400
- потолочная люстра майтон nostalgia ceiling chandelier mod048pl-06g
- серьги atelier de bijoux 1628712
- source_sentence: 'мобильный геймпад триггерами x2 '
sentences:
- электроскутер nitro pro milano 750w led
- наушники без проводов мейзу ep52 lite
- геймпад с функцией триггеров x2
- source_sentence: комод 7 рисунком машинки 4 ящика
sentences:
- удлинитель far f 505 d lara выключателем 2 0м
- беззеркальный фотоаппарат nikon z50 kit 16-50mm ilce-7cl красный
- комод 8 с изображением супергероев 6 ящиков
datasets:
- seregadgl/data_cross_gpt_139k
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy
- cosine_accuracy_threshold
- cosine_f1
- cosine_f1_threshold
- cosine_precision
- cosine_recall
- cosine_ap
- cosine_mcc
model-index:
- name: SentenceTransformer based on sergeyzh/LaBSE-ru-sts
results:
- task:
type: binary-classification
name: Binary Classification
dataset:
name: eval
type: eval
metrics:
- type: cosine_accuracy
value: 0.9722640832436311
name: Cosine Accuracy
- type: cosine_accuracy_threshold
value: 0.630459189414978
name: Cosine Accuracy Threshold
- type: cosine_f1
value: 0.9724366041896361
name: Cosine F1
- type: cosine_f1_threshold
value: 0.5821653008460999
name: Cosine F1 Threshold
- type: cosine_precision
value: 0.9647847565278758
name: Cosine Precision
- type: cosine_recall
value: 0.9802107980210798
name: Cosine Recall
- type: cosine_ap
value: 0.9945729266353226
name: Cosine Ap
- type: cosine_mcc
value: 0.9445047865635516
name: Cosine Mcc
---
# SentenceTransformer based on sergeyzh/LaBSE-ru-sts
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sergeyzh/LaBSE-ru-sts](https://huggingface.co/sergeyzh/LaBSE-ru-sts) on the [data_cross_gpt_139k](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k) dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [sergeyzh/LaBSE-ru-sts](https://huggingface.co/sergeyzh/LaBSE-ru-sts)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [data_cross_gpt_139k](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k)
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("seregadgl/sts_v11")
# Run inference
sentences = [
'комод 7 рисунком машинки 4 ящика',
'комод 8 с изображением супергероев 6 ящиков',
'беззеркальный фотоаппарат nikon z50 kit 16-50mm ilce-7cl красный',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Binary Classification
* Dataset: `eval`
* Evaluated with [BinaryClassificationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
| Metric | Value |
|:--------------------------|:-----------|
| cosine_accuracy | 0.9723 |
| cosine_accuracy_threshold | 0.6305 |
| cosine_f1 | 0.9724 |
| cosine_f1_threshold | 0.5822 |
| cosine_precision | 0.9648 |
| cosine_recall | 0.9802 |
| **cosine_ap** | **0.9946** |
| cosine_mcc | 0.9445 |
## Training Details
### Training Dataset
#### data_cross_gpt_139k
* Dataset: [data_cross_gpt_139k](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k) at [9e1f5ca](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k/tree/9e1f5ca30088e6f61ca5b9a742b38ef2c4fc7f3e)
* Size: 111,476 training samples
* Columns: sentence1, sentence2, and label
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
нож кухонный 21см синий | кухонный нож 22см зелёный | 0.0 |
| блок питания универсальный для мерцающих флэш гирлянд rich led бахрома занавес нить белый | адаптер питания для мигающих led гирлянд "luminous decor" бахрома занавес нить зелёный | 0.0 |
| защитная пленка для apple iphone 6 прозрачная | protective film for apple iphone 6 transparent | 1.0 |
* Loss: [CosineSimilarityLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
```
### Evaluation Dataset
#### data_cross_gpt_139k
* Dataset: [data_cross_gpt_139k](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k) at [9e1f5ca](https://huggingface.co/datasets/seregadgl/data_cross_gpt_139k/tree/9e1f5ca30088e6f61ca5b9a742b38ef2c4fc7f3e)
* Size: 27,870 evaluation samples
* Columns: sentence1, sentence2, and label
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details | сумка дорожная складная полет оранжевая bradex td 0599 | сумка для путешествий складная брадекс orange | 1.0 |
| наушники sennheiser hd 450bt белый | наушники сенхайзер hd 450bt white | 1.0 |
| перчатки stg al-05-1871 синие серые черные зеленыеполноразмерные xl | перчатки stg al-05-1871 blue gray black green full size xl | 1.0 |
* Loss: [CosineSimilarityLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `learning_rate`: 4.7459131195420915e-05
- `weight_decay`: 0.03196240090522689
- `num_train_epochs`: 2
- `warmup_ratio`: 0.014344463935915175
- `fp16`: True
#### All Hyperparameters