---
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: Ny duk til markise på 5.6 meter
sentences:
- oppussing av tegl fasade
- Installere ny markiseduk 5.6 meter
- installasjon av vann og kloakk
- source_sentence: Sette inn rør i pipe
sentences:
- montering av rør i pipe
- bytte og flytte varmtvannsbereder
- saging av betong for dører
- source_sentence: Helsparkling og pussing av vegger i en leilighet på 70 kvm
sentences:
- fullsparkling og pussing av vegger i 70 kvm leilighet
- støttemur med bunnfundament, 26 meter lang og 3 meter høy
- trappeteppe legging
- source_sentence: Montering av peisovn, samt finsparkling av brannmur bak peisovnen
sentences:
- Verditakst av leilighet i Oslo
- Montering av Nordpeis Sakai Peisovn - Lillestrøm
- Etterisolering og bytte av kledning
- source_sentence: Ny utvendig trapp til 2.etg
sentences:
- Installere utvendig trapp til 2. etasje
- Flyttelass fra Tromsø til Bodø
- tapetsere en vegg
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/SBertBaseMittanbudver2")
# Run inference
sentences = [
'Ny utvendig trapp til 2.etg',
'Installere utvendig trapp til 2. etasje',
'tapetsere en vegg',
]
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 |
Varmekabler soverom
| Legging av varmekabler
| Bytte vv bereder,
|
| Pga liten vannskade trengs det å fjerne / legge nytt laminat på kjøkken 9,5m2
| Legge laminatgulv, samt montere gulvlister
| Garderobe med innfelte fronter
|
| Sette opp gjerde i stål
| Stålgjerde på natursteinsmur
| Legge pergo-gulv på soverom
|
* 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 | bygge terrasse på 41 kvm
| 41 kvadratmeter terrasse i første etasje
|
| tapetsering av stue og spisestue
| tapetsere stue og spisestue
|
| Pusse opp en klinikk i Trondheim
| oppussing av klinikk i Trondheim
|
* 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 | Overflateoppussing av Pilestredet Park
| renovere hus på 120kvm
| 0.9
|
| Tømme og koble fra varmtvannsbereder under kjøkkenbenk i 2 etg, samt montere ny 200 l. bereder i 1.etg, under trapp.
| Bytte varmtvannsbereder fra kjøkken til under trapp
| 0.95
|
| Kjerneboring
| Boring for rør
| 0.35
|
* 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
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters