mmazuecos
commited on
Commit
•
9066f0f
1
Parent(s):
7b773e9
Pushing model.
Browse files- 1_Pooling/config.json +7 -0
- 2_Dense/config.json +1 -0
- 2_Dense/pytorch_model.bin +3 -0
- README.md +90 -0
- config.json +28 -0
- config_sentence_transformers.json +7 -0
- eval/similarity_evaluation_sts-test_results.csv +21 -0
- loss_digest.json +0 -0
- merges.txt +0 -0
- modules.json +20 -0
- pytorch_model.bin +3 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 768,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
5 |
+
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false
|
7 |
+
}
|
2_Dense/config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"in_features": 768, "out_features": 512, "bias": true, "activation_function": "torch.nn.modules.activation.Tanh"}
|
2_Dense/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cb8b726320c19db73fe1b10f1e8fd9476783234dc72483d7aa971bc328069ff4
|
3 |
+
size 1575975
|
README.md
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: sentence-similarity
|
3 |
+
tags:
|
4 |
+
- sentence-transformers
|
5 |
+
- feature-extraction
|
6 |
+
- sentence-similarity
|
7 |
+
---
|
8 |
+
|
9 |
+
# {MODEL_NAME}
|
10 |
+
|
11 |
+
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 512 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
12 |
+
|
13 |
+
<!--- Describe your model here -->
|
14 |
+
|
15 |
+
## Usage (Sentence-Transformers)
|
16 |
+
|
17 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
18 |
+
|
19 |
+
```
|
20 |
+
pip install -U sentence-transformers
|
21 |
+
```
|
22 |
+
|
23 |
+
Then you can use the model like this:
|
24 |
+
|
25 |
+
```python
|
26 |
+
from sentence_transformers import SentenceTransformer
|
27 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
28 |
+
|
29 |
+
model = SentenceTransformer('{MODEL_NAME}')
|
30 |
+
embeddings = model.encode(sentences)
|
31 |
+
print(embeddings)
|
32 |
+
```
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
## Evaluation Results
|
37 |
+
|
38 |
+
<!--- Describe how your model was evaluated -->
|
39 |
+
|
40 |
+
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
41 |
+
|
42 |
+
|
43 |
+
## Training
|
44 |
+
The model was trained with the parameters:
|
45 |
+
|
46 |
+
**DataLoader**:
|
47 |
+
|
48 |
+
`sentence_transformers.datasets.NoDuplicatesDataLoader.NoDuplicatesDataLoader` of length 1127 with parameters:
|
49 |
+
```
|
50 |
+
{'batch_size': 64}
|
51 |
+
```
|
52 |
+
|
53 |
+
**Loss**:
|
54 |
+
|
55 |
+
`sentence_transformers.losses.MultipleNegativesRankingLoss.MultipleNegativesRankingLoss` with parameters:
|
56 |
+
```
|
57 |
+
{'scale': 20.0, 'similarity_fct': 'cos_sim'}
|
58 |
+
```
|
59 |
+
|
60 |
+
Parameters of the fit()-Method:
|
61 |
+
```
|
62 |
+
{
|
63 |
+
"epochs": 20,
|
64 |
+
"evaluation_steps": 0,
|
65 |
+
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
|
66 |
+
"max_grad_norm": 1,
|
67 |
+
"optimizer_class": "<class 'transformers.optimization.AdamW'>",
|
68 |
+
"optimizer_params": {
|
69 |
+
"lr": 2e-05
|
70 |
+
},
|
71 |
+
"scheduler": "WarmupLinear",
|
72 |
+
"steps_per_epoch": null,
|
73 |
+
"warmup_steps": 1127,
|
74 |
+
"weight_decay": 0.01
|
75 |
+
}
|
76 |
+
```
|
77 |
+
|
78 |
+
|
79 |
+
## Full Model Architecture
|
80 |
+
```
|
81 |
+
SentenceTransformer(
|
82 |
+
(0): Transformer({'max_seq_length': 514, 'do_lower_case': False}) with Transformer model: RobertaModel
|
83 |
+
(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})
|
84 |
+
(2): Dense({'in_features': 768, 'out_features': 512, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
|
85 |
+
)
|
86 |
+
```
|
87 |
+
|
88 |
+
## Citing & Authors
|
89 |
+
|
90 |
+
<!--- Describe where people can find more information -->
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "bertin-project/bertin-roberta-base-spanish",
|
3 |
+
"architectures": [
|
4 |
+
"RobertaModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"gradient_checkpointing": false,
|
11 |
+
"hidden_act": "gelu",
|
12 |
+
"hidden_dropout_prob": 0.1,
|
13 |
+
"hidden_size": 768,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 3072,
|
16 |
+
"layer_norm_eps": 1e-05,
|
17 |
+
"max_position_embeddings": 514,
|
18 |
+
"model_type": "roberta",
|
19 |
+
"num_attention_heads": 12,
|
20 |
+
"num_hidden_layers": 12,
|
21 |
+
"pad_token_id": 1,
|
22 |
+
"position_embedding_type": "absolute",
|
23 |
+
"torch_dtype": "float32",
|
24 |
+
"transformers_version": "4.17.0",
|
25 |
+
"type_vocab_size": 1,
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 50265
|
28 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "2.2.0",
|
4 |
+
"transformers": "4.17.0",
|
5 |
+
"pytorch": "1.10.2"
|
6 |
+
}
|
7 |
+
}
|
eval/similarity_evaluation_sts-test_results.csv
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,steps,cosine_pearson,cosine_spearman,euclidean_pearson,euclidean_spearman,manhattan_pearson,manhattan_spearman,dot_pearson,dot_spearman
|
2 |
+
0,-1,0.6581493026240269,0.5802356493272345,0.6634103225436967,0.5887142267642859,0.6633780369919056,0.5889272703378547,0.571143299245293,0.4732063731208094
|
3 |
+
1,-1,0.6708623071971952,0.5985927642452136,0.675257124555732,0.6046557636211276,0.6767056382416057,0.6064614282847686,0.5864286716770518,0.495613872629927
|
4 |
+
2,-1,0.6702651671065515,0.5922353474286076,0.6672984469521261,0.594962259717964,0.6673488770673561,0.5945960133985778,0.6020281121442566,0.5095236479097289
|
5 |
+
3,-1,0.6605032101558846,0.5890776181094547,0.6641603284425521,0.5993232115293229,0.6645610706259933,0.5984927833321959,0.5913711078698719,0.5082729703485656
|
6 |
+
4,-1,0.6530779759890578,0.5781118041787935,0.6547349577996249,0.5874599982401654,0.6543895215674207,0.5869029941907284,0.581310838565905,0.497299912453472
|
7 |
+
5,-1,0.6543208566097818,0.58194344945178,0.6491366001755403,0.5864144953186581,0.6498888685831916,0.5868199442690898,0.5910026676646215,0.5151166986440603
|
8 |
+
6,-1,0.6472013765440673,0.5732578792820385,0.6433653543280587,0.5798672298185186,0.6435570196620376,0.5787832344585572,0.5864683897395871,0.5061222515124659
|
9 |
+
7,-1,0.6400980616286338,0.5667287521006833,0.63656772778559,0.5743034106112495,0.6370456545413393,0.5730667948633957,0.5747946450752401,0.4979748652884891
|
10 |
+
8,-1,0.6452381886531463,0.5729618568060901,0.6424560387096414,0.5811990823928792,0.6429919873656215,0.5808723511892786,0.58104040571895,0.5054740303265891
|
11 |
+
9,-1,0.6384071016780053,0.5625492118848722,0.635541246663347,0.572271947315098,0.6356269918508849,0.5711684216588732,0.5787246865749316,0.5019918424201281
|
12 |
+
10,-1,0.6419031233362158,0.569618113843397,0.6353794935936075,0.5752729939447357,0.6357950326588047,0.5748007016676012,0.5828757686864627,0.5121824811372735
|
13 |
+
11,-1,0.6423540880042571,0.568767118468823,0.6349101892245405,0.5744865976882757,0.6356595326561394,0.5750529478722156,0.5862014516783208,0.5123514217509163
|
14 |
+
12,-1,0.6402987765788005,0.563953589326667,0.6355130494886717,0.5722567776013456,0.6357087618283007,0.572723715026341,0.581950349472401,0.5068270750478774
|
15 |
+
13,-1,0.6349740259317077,0.5605840947806097,0.6310765115255937,0.5677235330673125,0.6313588325370229,0.5675908264796831,0.5761493116509655,0.5012367514530972
|
16 |
+
14,-1,0.6358190709395628,0.5624146872042087,0.6327586555267605,0.5708724133867766,0.6331569512601531,0.5702529265931481,0.5781642308453095,0.504501876095922
|
17 |
+
15,-1,0.6311127603260229,0.5584118997205461,0.6288133015450812,0.5664748582492568,0.628861427115307,0.5660526913652236,0.5729793164702304,0.5013857356549215
|
18 |
+
16,-1,0.6333152268675507,0.5610230364136519,0.6305527453515162,0.5691509491567724,0.6304938356795253,0.567996417468633,0.5755055543932878,0.5033426713405311
|
19 |
+
17,-1,0.6353869036678222,0.5630840974232757,0.6323343041403464,0.5707859119291437,0.6322656960665566,0.5696195382630574,0.5764210881100128,0.5045764889295747
|
20 |
+
18,-1,0.6352029170986021,0.5627512048617189,0.6315279989234651,0.5694638031971371,0.6315471951413272,0.5690261399107593,0.5761747454613159,0.5035466102450782
|
21 |
+
19,-1,0.6355421845320552,0.5627031532309846,0.631491538163409,0.569449769791531,0.631682972028249,0.5686912699000612,0.5771564421958566,0.5049254207535826
|
loss_digest.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
modules.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "",
|
6 |
+
"type": "sentence_transformers.models.Transformer"
|
7 |
+
},
|
8 |
+
{
|
9 |
+
"idx": 1,
|
10 |
+
"name": "1",
|
11 |
+
"path": "1_Pooling",
|
12 |
+
"type": "sentence_transformers.models.Pooling"
|
13 |
+
},
|
14 |
+
{
|
15 |
+
"idx": 2,
|
16 |
+
"name": "2",
|
17 |
+
"path": "2_Dense",
|
18 |
+
"type": "sentence_transformers.models.Dense"
|
19 |
+
}
|
20 |
+
]
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:94bf68a63b5b838390ca25847d46db5693bd6ba6aa72f218f6fda267787eed75
|
3 |
+
size 498664817
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 514,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"errors": "replace", "bos_token": "<s>", "eos_token": "</s>", "sep_token": "</s>", "cls_token": "<s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": "<mask>", "add_prefix_space": false, "trim_offsets": true, "special_tokens_map_file": null, "name_or_path": "bertin-project/bertin-roberta-base-spanish", "tokenizer_class": "RobertaTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|