Sentence Similarity
sentence-transformers
Safetensors
camembert
feature-extraction
Generated from Trainer
dataset_size:800
loss:CosineSimilarityLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use mnaguib/sentence-camembert-large-finetuned-clister with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use mnaguib/sentence-camembert-large-finetuned-clister with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("mnaguib/sentence-camembert-large-finetuned-clister") sentences = [ "Le toucher rectal est normal.", "Devant la réticence initiale, une symptomatologie délirante est suspectée, mais elle ne sera jamais verbalisée par la patiente.", "Le toucher vaginal était normal.", "Sur le plan biologique , ce patient présente à l'admission :" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Updated model version
Browse files- README.md +54 -42
- config.json +1 -1
- model.safetensors +1 -1
- special_tokens_map.json +6 -42
- tokenizer.json +0 -0
- tokenizer_config.json +1 -8
README.md
CHANGED
|
@@ -8,40 +8,39 @@ tags:
|
|
| 8 |
- loss:CosineSimilarityLoss
|
| 9 |
base_model: dangvantuan/sentence-camembert-large
|
| 10 |
widget:
|
| 11 |
-
- source_sentence:
|
| 12 |
-
aux dépens de la surrénale.
|
| 13 |
sentences:
|
| 14 |
-
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
-
|
|
|
|
| 18 |
sentences:
|
| 19 |
-
- Elle ne présente aucun autre antécédent médical pertinent.
|
| 20 |
-
- Les suites opératoires étaient simple.
|
| 21 |
-
- Le bilan d’extension comprenait une tomodensitométrie (TDM) thoraco-abdomino-pelvienne.
|
| 22 |
-
- source_sentence: La T.D.M (Figure 2) montrait une tumeur surrénalienne surrénalien
|
| 23 |
-
bilatérale de densité hétérogène.
|
| 24 |
-
sentences:
|
| 25 |
-
- L’évolution était favorable avec un recul de 12 mois.
|
| 26 |
-
- L’exploration découvrait une tumeur surrénalienne sphérique de la taille d’une
|
| 27 |
-
mandarine.
|
| 28 |
- Une mise à plat avec ligature de l’artère hypogastrique a été réalisée.
|
| 29 |
-
-
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
sentences:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
- La patiente ne fume pas, ne prend que très rarement de l’alcool et n’a pas d’allergie
|
| 33 |
aux médicaments.
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
| 39 |
sentences:
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
- L’
|
| 43 |
-
|
| 44 |
-
- Une cystoprostatectomie totale avec dérivation selon Bricker est réalisée.
|
| 45 |
pipeline_tag: sentence-similarity
|
| 46 |
library_name: sentence-transformers
|
| 47 |
---
|
|
@@ -92,12 +91,12 @@ Then you can load this model and run inference.
|
|
| 92 |
from sentence_transformers import SentenceTransformer
|
| 93 |
|
| 94 |
# Download from the 🤗 Hub
|
| 95 |
-
model = SentenceTransformer("
|
| 96 |
# Run inference
|
| 97 |
sentences = [
|
| 98 |
-
'Le
|
| 99 |
-
'
|
| 100 |
-
|
| 101 |
]
|
| 102 |
embeddings = model.encode(sentences)
|
| 103 |
print(embeddings.shape)
|
|
@@ -175,19 +174,19 @@ You can finetune this model on your own dataset.
|
|
| 175 |
|
| 176 |
#### Unnamed Dataset
|
| 177 |
|
| 178 |
-
* Size:
|
| 179 |
* Columns: <code>id_1</code>, <code>id_2</code>, and <code>label</code>
|
| 180 |
-
* Approximate statistics based on the first
|
| 181 |
| | id_1 | id_2 | label |
|
| 182 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 183 |
| type | string | string | float |
|
| 184 |
-
| details | <ul><li>min: 8 tokens</li><li>mean:
|
| 185 |
* Samples:
|
| 186 |
-
| id_1
|
| 187 |
-
|:---------------------------------------------------------
|
| 188 |
-
| <code>
|
| 189 |
-
| <code>
|
| 190 |
-
| <code>
|
| 191 |
* Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
|
| 192 |
```json
|
| 193 |
{
|
|
@@ -202,7 +201,7 @@ You can finetune this model on your own dataset.
|
|
| 202 |
- `per_device_train_batch_size`: 16
|
| 203 |
- `per_device_eval_batch_size`: 16
|
| 204 |
- `learning_rate`: 2e-05
|
| 205 |
-
- `num_train_epochs`:
|
| 206 |
- `warmup_ratio`: 0.1
|
| 207 |
- `fp16`: True
|
| 208 |
- `batch_sampler`: no_duplicates
|
|
@@ -227,7 +226,7 @@ You can finetune this model on your own dataset.
|
|
| 227 |
- `adam_beta2`: 0.999
|
| 228 |
- `adam_epsilon`: 1e-08
|
| 229 |
- `max_grad_norm`: 1.0
|
| 230 |
-
- `num_train_epochs`:
|
| 231 |
- `max_steps`: -1
|
| 232 |
- `lr_scheduler_type`: linear
|
| 233 |
- `lr_scheduler_kwargs`: {}
|
|
@@ -331,7 +330,20 @@ You can finetune this model on your own dataset.
|
|
| 331 |
### Training Logs
|
| 332 |
| Epoch | Step | Training Loss | Validation Loss |
|
| 333 |
|:------:|:----:|:-------------:|:---------------:|
|
| 334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
|
| 336 |
|
| 337 |
### Framework Versions
|
|
|
|
| 8 |
- loss:CosineSimilarityLoss
|
| 9 |
base_model: dangvantuan/sentence-camembert-large
|
| 10 |
widget:
|
| 11 |
+
- source_sentence: Le toucher rectal est normal.
|
|
|
|
| 12 |
sentences:
|
| 13 |
+
- Devant la réticence initiale, une symptomatologie délirante est suspectée, mais
|
| 14 |
+
elle ne sera jamais verbalisée par la patiente.
|
| 15 |
+
- Le toucher vaginal était normal.
|
| 16 |
+
- 'Sur le plan biologique , ce patient présente à l''admission :'
|
| 17 |
+
- source_sentence: Une résection endoscopique de la tumeur a été réalisée.
|
| 18 |
sentences:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
- Une mise à plat avec ligature de l’artère hypogastrique a été réalisée.
|
| 20 |
+
- La figure 1 présente la chronologie des événements et de la prise des médicaments.
|
| 21 |
+
- L'ECBU était stérile.
|
| 22 |
+
- source_sentence: La quadrithérapie est poursuivie douze jours sans qu’aucune amélioration
|
| 23 |
+
clinique ou biologique ne soit entrevue.
|
| 24 |
sentences:
|
| 25 |
+
- Un double abord abdominal et périnéal permit de réaliser une uréthro-cystectomie
|
| 26 |
+
avec colpohystérectomie suivie d’une poche iléocaecale continente périombilicale.
|
| 27 |
+
- Aucune récidive tumorale n’a été retrouvée par cytologie urinaire, urétéro-pyélographie
|
| 28 |
+
rétrograde et urétéroscopie souple.
|
| 29 |
- La patiente ne fume pas, ne prend que très rarement de l’alcool et n’a pas d’allergie
|
| 30 |
aux médicaments.
|
| 31 |
+
- source_sentence: La cystographie se révéla normale.
|
| 32 |
+
sentences:
|
| 33 |
+
- La cystographie rétrograde était normale.
|
| 34 |
+
- Le reste de l’urètre était normal.
|
| 35 |
+
- L’examen anatomo-pathologique conclut à un carcinome indifférencié, de stade pT
|
| 36 |
+
1 grade 3.
|
| 37 |
+
- source_sentence: Le patient a été mis sous antibiothérapie adaptée (pénicilline
|
| 38 |
+
A + aminoside).
|
| 39 |
sentences:
|
| 40 |
+
- Les prélèvements de sang et d'urine sont effectués 10 heures plus tard.
|
| 41 |
+
- En octobre 2003, la patiente était en excellent état général.
|
| 42 |
+
- L’étude anatomopathologique de la biopsie était en faveur d’un adénocarcinome
|
| 43 |
+
à cellules claires.
|
|
|
|
| 44 |
pipeline_tag: sentence-similarity
|
| 45 |
library_name: sentence-transformers
|
| 46 |
---
|
|
|
|
| 91 |
from sentence_transformers import SentenceTransformer
|
| 92 |
|
| 93 |
# Download from the 🤗 Hub
|
| 94 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
| 95 |
# Run inference
|
| 96 |
sentences = [
|
| 97 |
+
'Le patient a été mis sous antibiothérapie adaptée (pénicilline A + aminoside).',
|
| 98 |
+
'En octobre 2003, la patiente était en excellent état général.',
|
| 99 |
+
"Les prélèvements de sang et d'urine sont effectués 10 heures plus tard.",
|
| 100 |
]
|
| 101 |
embeddings = model.encode(sentences)
|
| 102 |
print(embeddings.shape)
|
|
|
|
| 174 |
|
| 175 |
#### Unnamed Dataset
|
| 176 |
|
| 177 |
+
* Size: 400 evaluation samples
|
| 178 |
* Columns: <code>id_1</code>, <code>id_2</code>, and <code>label</code>
|
| 179 |
+
* Approximate statistics based on the first 400 samples:
|
| 180 |
| | id_1 | id_2 | label |
|
| 181 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 182 |
| type | string | string | float |
|
| 183 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 23.05 tokens</li><li>max: 97 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 22.45 tokens</li><li>max: 88 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 2.25</li><li>max: 5.0</li></ul> |
|
| 184 |
* Samples:
|
| 185 |
+
| id_1 | id_2 | label |
|
| 186 |
+
|:---------------------------------------------------------|:-------------------------------------------------------------------|:-----------------|
|
| 187 |
+
| <code>L’examen clinique était sans particularité.</code> | <code>La formule sanguine était sans particularité.</code> | <code>2.0</code> |
|
| 188 |
+
| <code>Le bilan biologique était correct.</code> | <code>Le geste était complet.</code> | <code>0.0</code> |
|
| 189 |
+
| <code>La sérologie VIH était négative.</code> | <code>La cytologie urinaire pyélique droite était négative.</code> | <code>1.0</code> |
|
| 190 |
* Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
|
| 191 |
```json
|
| 192 |
{
|
|
|
|
| 201 |
- `per_device_train_batch_size`: 16
|
| 202 |
- `per_device_eval_batch_size`: 16
|
| 203 |
- `learning_rate`: 2e-05
|
| 204 |
+
- `num_train_epochs`: 10
|
| 205 |
- `warmup_ratio`: 0.1
|
| 206 |
- `fp16`: True
|
| 207 |
- `batch_sampler`: no_duplicates
|
|
|
|
| 226 |
- `adam_beta2`: 0.999
|
| 227 |
- `adam_epsilon`: 1e-08
|
| 228 |
- `max_grad_norm`: 1.0
|
| 229 |
+
- `num_train_epochs`: 10
|
| 230 |
- `max_steps`: -1
|
| 231 |
- `lr_scheduler_type`: linear
|
| 232 |
- `lr_scheduler_kwargs`: {}
|
|
|
|
| 330 |
### Training Logs
|
| 331 |
| Epoch | Step | Training Loss | Validation Loss |
|
| 332 |
|:------:|:----:|:-------------:|:---------------:|
|
| 333 |
+
| 0.7895 | 30 | - | 4.3935 |
|
| 334 |
+
| 1.5789 | 60 | - | 4.3560 |
|
| 335 |
+
| 2.3684 | 90 | - | 4.3697 |
|
| 336 |
+
| 2.6316 | 100 | 5.1713 | - |
|
| 337 |
+
| 3.1579 | 120 | - | 4.3491 |
|
| 338 |
+
| 3.9474 | 150 | - | 4.3335 |
|
| 339 |
+
| 4.7368 | 180 | - | 4.3450 |
|
| 340 |
+
| 5.2632 | 200 | 4.8927 | - |
|
| 341 |
+
| 5.5263 | 210 | - | 4.3487 |
|
| 342 |
+
| 6.3158 | 240 | - | 4.3535 |
|
| 343 |
+
| 7.1053 | 270 | - | 4.3496 |
|
| 344 |
+
| 7.8947 | 300 | 4.811 | 4.3402 |
|
| 345 |
+
| 8.6842 | 330 | - | 4.3467 |
|
| 346 |
+
| 9.4737 | 360 | - | 4.3389 |
|
| 347 |
|
| 348 |
|
| 349 |
### Framework Versions
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"CamembertModel"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "dangvantuan/sentence-camembert-large",
|
| 3 |
"architectures": [
|
| 4 |
"CamembertModel"
|
| 5 |
],
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1346690896
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69195b5de992592ebf6c5517c64e85a51c7e62b0988b96b4b9563b1e3f4dda75
|
| 3 |
size 1346690896
|
special_tokens_map.json
CHANGED
|
@@ -3,27 +3,9 @@
|
|
| 3 |
"<s>NOTUSED",
|
| 4 |
"</s>NOTUSED"
|
| 5 |
],
|
| 6 |
-
"bos_token":
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
"normalized": false,
|
| 10 |
-
"rstrip": false,
|
| 11 |
-
"single_word": false
|
| 12 |
-
},
|
| 13 |
-
"cls_token": {
|
| 14 |
-
"content": "<s>",
|
| 15 |
-
"lstrip": false,
|
| 16 |
-
"normalized": false,
|
| 17 |
-
"rstrip": false,
|
| 18 |
-
"single_word": false
|
| 19 |
-
},
|
| 20 |
-
"eos_token": {
|
| 21 |
-
"content": "</s>",
|
| 22 |
-
"lstrip": false,
|
| 23 |
-
"normalized": false,
|
| 24 |
-
"rstrip": false,
|
| 25 |
-
"single_word": false
|
| 26 |
-
},
|
| 27 |
"mask_token": {
|
| 28 |
"content": "<mask>",
|
| 29 |
"lstrip": true,
|
|
@@ -31,25 +13,7 @@
|
|
| 31 |
"rstrip": false,
|
| 32 |
"single_word": false
|
| 33 |
},
|
| 34 |
-
"pad_token":
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
"normalized": false,
|
| 38 |
-
"rstrip": false,
|
| 39 |
-
"single_word": false
|
| 40 |
-
},
|
| 41 |
-
"sep_token": {
|
| 42 |
-
"content": "</s>",
|
| 43 |
-
"lstrip": false,
|
| 44 |
-
"normalized": false,
|
| 45 |
-
"rstrip": false,
|
| 46 |
-
"single_word": false
|
| 47 |
-
},
|
| 48 |
-
"unk_token": {
|
| 49 |
-
"content": "<unk>",
|
| 50 |
-
"lstrip": false,
|
| 51 |
-
"normalized": false,
|
| 52 |
-
"rstrip": false,
|
| 53 |
-
"single_word": false
|
| 54 |
-
}
|
| 55 |
}
|
|
|
|
| 3 |
"<s>NOTUSED",
|
| 4 |
"</s>NOTUSED"
|
| 5 |
],
|
| 6 |
+
"bos_token": "<s>",
|
| 7 |
+
"cls_token": "<s>",
|
| 8 |
+
"eos_token": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"mask_token": {
|
| 10 |
"content": "<mask>",
|
| 11 |
"lstrip": true,
|
|
|
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
+
"pad_token": "<pad>",
|
| 17 |
+
"sep_token": "</s>",
|
| 18 |
+
"unk_token": "<unk>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -67,17 +67,10 @@
|
|
| 67 |
"eos_token": "</s>",
|
| 68 |
"extra_special_tokens": {},
|
| 69 |
"mask_token": "<mask>",
|
| 70 |
-
"
|
| 71 |
-
"model_max_length": 514,
|
| 72 |
-
"pad_to_multiple_of": null,
|
| 73 |
"pad_token": "<pad>",
|
| 74 |
-
"pad_token_type_id": 0,
|
| 75 |
-
"padding_side": "right",
|
| 76 |
"sep_token": "</s>",
|
| 77 |
"sp_model_kwargs": {},
|
| 78 |
-
"stride": 0,
|
| 79 |
"tokenizer_class": "CamembertTokenizer",
|
| 80 |
-
"truncation_side": "right",
|
| 81 |
-
"truncation_strategy": "longest_first",
|
| 82 |
"unk_token": "<unk>"
|
| 83 |
}
|
|
|
|
| 67 |
"eos_token": "</s>",
|
| 68 |
"extra_special_tokens": {},
|
| 69 |
"mask_token": "<mask>",
|
| 70 |
+
"model_max_length": 1000000000000000019884624838656,
|
|
|
|
|
|
|
| 71 |
"pad_token": "<pad>",
|
|
|
|
|
|
|
| 72 |
"sep_token": "</s>",
|
| 73 |
"sp_model_kwargs": {},
|
|
|
|
| 74 |
"tokenizer_class": "CamembertTokenizer",
|
|
|
|
|
|
|
| 75 |
"unk_token": "<unk>"
|
| 76 |
}
|