---
language: []
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dataset_size:n<1K
- loss:CoSENTLoss
base_model: sentence-transformers/LaBSE
widget:
- source_sentence: Personnel contractuel
sentences:
- Vacataire
- Départ définitif pour cause de mutation
- Fin du temps partiel thérapeutique
- source_sentence: Prolongation de stage
sentences:
- Titularisation
- Renouvellement du congé de longue durée
- Fin du temps partiel thérapeutique
- source_sentence: ' avancement d''échelon'
sentences:
- 'Avancement d''échelon '
- Renouvellement du congé de longue durée
- Disponibilité pour suivre un conjoint ou un partenaire lié par un PACS
- source_sentence: Sanction disciplinaire
sentences:
- Sanction suite à une infraction disciplinaire
- Départ définitif - Radiation des cadres
- Disponibilité pour suivre un conjoint ou un partenaire lié par un PACS
- source_sentence: Temps partiel surcotisé
sentences:
- Temps partiel surcotisé de droit
- Départ définitif - Radiation des cadres
- Fin du temps partiel thérapeutique
pipeline_tag: sentence-similarity
---
# SentenceTransformer based on sentence-transformers/LaBSE
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/LaBSE](https://huggingface.co./sentence-transformers/LaBSE). 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:** [sentence-transformers/LaBSE](https://huggingface.co./sentence-transformers/LaBSE)
- **Maximum Sequence Length:** 256 tokens
- **Output Dimensionality:** 768 tokens
- **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': 256, '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): Dense({'in_features': 768, 'out_features': 768, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
(3): 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("aminlouhichi/CDGSmilarity")
# Run inference
sentences = [
'Temps partiel surcotisé',
'Temps partiel surcotisé de droit',
'Départ définitif - Radiation des cadres',
]
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]
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 295 training samples
* Columns: premise
, hypothesis
, and label
* Approximate statistics based on the first 1000 samples:
| | premise | hypothesis | label |
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
Compte rendu d'entretien professionnel
| Synthèse des discussions professionnelles
| 0.9820208462484844
|
| Congé Accident de trajet
| Arrêt de travail pour accident de trajet
| 0.9755981363214147
|
| Retrait ou suppression du CTI (complément de traitement indiciaire)
| Retrait du Complément de Traitement Indiciaire (CTI)
| 0.9524167934189104
|
* Loss: [CoSENTLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 74 evaluation samples
* Columns: premise
, hypothesis
, and label
* Approximate statistics based on the first 1000 samples:
| | premise | hypothesis | label |
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details | Sanction disciplinaire
| Mesure punitive suite à une violation du règlement
| 0.958828679924412
|
| Départ définitif / Radiation - Décès
| Départ définitif suite au décès d'un agent
| 0.9003635138326387
|
| Nomination par intégration directe
| Intégration immédiate avec nomination
| 0.9993378836623817
|
* Loss: [CoSENTLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 30
- `warmup_ratio`: 0.1
- `fp16`: True
#### All Hyperparameters