---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:96724
- loss:Matryoshka2dLoss
- loss:MatryoshkaLoss
- loss:TripletLoss
- loss:MultipleNegativesRankingLoss
- loss:CoSENTLoss
base_model: NbAiLab/nb-sbert-base
widget:
- source_sentence: installere nytt gulv i låve
sentences:
- sparkling av 130 kvm vegg på loft
- legge nytt gulv i låve
- plenanlegg
- source_sentence: Beskjæring av høy hekk
sentences:
- Beskjæring/ kapping av tre
- Fornyelse av fasade
- Bytting av garasjeport motor
- source_sentence: Søker takstmann til nyoppusset 3 roms leilighet på Nordnes/sentrum.
Hjørneleilighet, heis, stor altan på 11m2
sentences:
- Montering av nytt kjøkken
- Installere varmepumpe
- Tilstandsrapport med verdivurdering, enebolig, Bærum
- source_sentence: Skadedyrsokntroll
sentences:
- asfaltering
- Oppføring av garasje
- Veggedyr bekjempelse
- source_sentence: Støp og fliselegging av gang
sentences:
- Reparasjon av råteskader på hus
- hagearbeid i fellesområder
- Støp av gulv i kjeller
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on NbAiLab/nb-sbert-base
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base). It maps sentences & paragraphs to a 64-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:** [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base)
- **Maximum Sequence Length:** 75 tokens
- **Output Dimensionality:** 64 dimensions
- **Similarity Function:** Cosine Similarity
### 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': 75, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
```
## 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("ostoveland/SBertBaseMittanbudver3")
# Run inference
sentences = [
'Støp og fliselegging av gang',
'Støp av gulv i kjeller',
'Reparasjon av råteskader på hus',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 64]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Training Details
### Training Datasets
#### Unnamed Dataset
* Size: 55,426 training samples
* Columns: sentence_0
, sentence_1
, and sentence_2
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | sentence_2 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Vaskerom
| Ønsker tilbud på legging av våtromsbelegg lite bad:
| Verdivurdering av 177 kvm stor enebolig.
|
| Bytte lås i leilighet i Obos borettslag, Galgeberg.
| Bytte postkasselås
| Helsparkling av betongvegger med tapet
|
| Legging av mikrosement
| Ønsker tilbud på mikrosement
| Betongsaging - 2 nye utvendige vinduer
|
* Loss: [Matryoshka2dLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
```json
{
"loss": "TripletLoss",
"n_layers_per_step": 1,
"last_layer_weight": 1.0,
"prior_layers_weight": 1.0,
"kl_div_weight": 1.0,
"kl_temperature": 0.3,
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": 1
}
```
#### Unnamed Dataset
* Size: 22,563 training samples
* Columns: sentence_0
and sentence_1
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details | Trefelling - 1 stor gran og en osp
| trefelling av stor gran og osp
|
| Bærebjelker - vurdering
| sjekk av bærebjelker
|
| Mindre graveoppdrag - 30m2 x 40cm dypt
| mindre gravearbeid
|
* Loss: [Matryoshka2dLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"n_layers_per_step": 1,
"last_layer_weight": 1.0,
"prior_layers_weight": 1.0,
"kl_div_weight": 1.0,
"kl_temperature": 0.3,
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": 1
}
```
#### Unnamed Dataset
* Size: 18,735 training samples
* Columns: sentence_0
, sentence_1
, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------|
| type | string | string | float |
| details | Pusse murvegg
| Pusse opp vegg
| 0.75
|
| Flyttevask av leilighet på 35 kvm
| Flyttevask av leilighet på 40 kvm
| 0.95
|
| Flis 30x 60 - 40m2
| Flislegging av gulv, 40m2
| 0.75
|
* Loss: [Matryoshka2dLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
```json
{
"loss": "CoSENTLoss",
"n_layers_per_step": 1,
"last_layer_weight": 1.0,
"prior_layers_weight": 1.0,
"kl_div_weight": 1.0,
"kl_temperature": 0.3,
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": 1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `num_train_epochs`: 4
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters