driante commited on
Commit
714dfaa
·
verified ·
1 Parent(s): 71dcdfd

Add new SentenceTransformer model

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ pipeline_tag: sentence-similarity
7
+ library_name: sentence-transformers
8
+ metrics:
9
+ - cosine_accuracy@1
10
+ - cosine_accuracy@3
11
+ - cosine_accuracy@5
12
+ - cosine_accuracy@10
13
+ - cosine_precision@1
14
+ - cosine_precision@3
15
+ - cosine_precision@5
16
+ - cosine_precision@10
17
+ - cosine_recall@1
18
+ - cosine_recall@3
19
+ - cosine_recall@5
20
+ - cosine_recall@10
21
+ - cosine_ndcg@10
22
+ - cosine_mrr@10
23
+ - cosine_map@100
24
+ model-index:
25
+ - name: SentenceTransformer
26
+ results:
27
+ - task:
28
+ type: information-retrieval
29
+ name: Information Retrieval
30
+ dataset:
31
+ name: ir eval
32
+ type: ir-eval
33
+ metrics:
34
+ - type: cosine_accuracy@1
35
+ value: 0.3645408163265306
36
+ name: Cosine Accuracy@1
37
+ - type: cosine_accuracy@3
38
+ value: 0.5668367346938775
39
+ name: Cosine Accuracy@3
40
+ - type: cosine_accuracy@5
41
+ value: 0.6420918367346938
42
+ name: Cosine Accuracy@5
43
+ - type: cosine_accuracy@10
44
+ value: 0.7364795918367347
45
+ name: Cosine Accuracy@10
46
+ - type: cosine_precision@1
47
+ value: 0.3645408163265306
48
+ name: Cosine Precision@1
49
+ - type: cosine_precision@3
50
+ value: 0.18894557823129254
51
+ name: Cosine Precision@3
52
+ - type: cosine_precision@5
53
+ value: 0.12841836734693876
54
+ name: Cosine Precision@5
55
+ - type: cosine_precision@10
56
+ value: 0.07364795918367346
57
+ name: Cosine Precision@10
58
+ - type: cosine_recall@1
59
+ value: 0.3645408163265306
60
+ name: Cosine Recall@1
61
+ - type: cosine_recall@3
62
+ value: 0.5668367346938775
63
+ name: Cosine Recall@3
64
+ - type: cosine_recall@5
65
+ value: 0.6420918367346938
66
+ name: Cosine Recall@5
67
+ - type: cosine_recall@10
68
+ value: 0.7364795918367347
69
+ name: Cosine Recall@10
70
+ - type: cosine_ndcg@10
71
+ value: 0.5441213794159998
72
+ name: Cosine Ndcg@10
73
+ - type: cosine_mrr@10
74
+ value: 0.48326930474570995
75
+ name: Cosine Mrr@10
76
+ - type: cosine_map@100
77
+ value: 0.49246040099416405
78
+ name: Cosine Map@100
79
+ ---
80
+
81
+ # SentenceTransformer
82
+
83
+ This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
84
+
85
+ ## Model Details
86
+
87
+ ### Model Description
88
+ - **Model Type:** Sentence Transformer
89
+ <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
90
+ - **Maximum Sequence Length:** 512 tokens
91
+ - **Output Dimensionality:** 1024 dimensions
92
+ - **Similarity Function:** Cosine Similarity
93
+ <!-- - **Training Dataset:** Unknown -->
94
+ <!-- - **Language:** Unknown -->
95
+ <!-- - **License:** Unknown -->
96
+
97
+ ### Model Sources
98
+
99
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
100
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
101
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
102
+
103
+ ### Full Model Architecture
104
+
105
+ ```
106
+ SentenceTransformer(
107
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
108
+ (1): Pooling({'word_embedding_dimension': 1024, '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})
109
+ )
110
+ ```
111
+
112
+ ## Usage
113
+
114
+ ### Direct Usage (Sentence Transformers)
115
+
116
+ First install the Sentence Transformers library:
117
+
118
+ ```bash
119
+ pip install -U sentence-transformers
120
+ ```
121
+
122
+ Then you can load this model and run inference.
123
+ ```python
124
+ from sentence_transformers import SentenceTransformer
125
+
126
+ # Download from the 🤗 Hub
127
+ model = SentenceTransformer("collaborativeearth/bge-m3_wri_wflagtraining")
128
+ # Run inference
129
+ sentences = [
130
+ 'The weather is lovely today.',
131
+ "It's so sunny outside!",
132
+ 'He drove to the stadium.',
133
+ ]
134
+ embeddings = model.encode(sentences)
135
+ print(embeddings.shape)
136
+ # [3, 1024]
137
+
138
+ # Get the similarity scores for the embeddings
139
+ similarities = model.similarity(embeddings, embeddings)
140
+ print(similarities.shape)
141
+ # [3, 3]
142
+ ```
143
+
144
+ <!--
145
+ ### Direct Usage (Transformers)
146
+
147
+ <details><summary>Click to see the direct usage in Transformers</summary>
148
+
149
+ </details>
150
+ -->
151
+
152
+ <!--
153
+ ### Downstream Usage (Sentence Transformers)
154
+
155
+ You can finetune this model on your own dataset.
156
+
157
+ <details><summary>Click to expand</summary>
158
+
159
+ </details>
160
+ -->
161
+
162
+ <!--
163
+ ### Out-of-Scope Use
164
+
165
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
166
+ -->
167
+
168
+ ## Evaluation
169
+
170
+ ### Metrics
171
+
172
+ #### Information Retrieval
173
+
174
+ * Dataset: `ir-eval`
175
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
176
+
177
+ | Metric | Value |
178
+ |:--------------------|:-----------|
179
+ | cosine_accuracy@1 | 0.3645 |
180
+ | cosine_accuracy@3 | 0.5668 |
181
+ | cosine_accuracy@5 | 0.6421 |
182
+ | cosine_accuracy@10 | 0.7365 |
183
+ | cosine_precision@1 | 0.3645 |
184
+ | cosine_precision@3 | 0.1889 |
185
+ | cosine_precision@5 | 0.1284 |
186
+ | cosine_precision@10 | 0.0736 |
187
+ | cosine_recall@1 | 0.3645 |
188
+ | cosine_recall@3 | 0.5668 |
189
+ | cosine_recall@5 | 0.6421 |
190
+ | cosine_recall@10 | 0.7365 |
191
+ | **cosine_ndcg@10** | **0.5441** |
192
+ | cosine_mrr@10 | 0.4833 |
193
+ | cosine_map@100 | 0.4925 |
194
+
195
+ <!--
196
+ ## Bias, Risks and Limitations
197
+
198
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
199
+ -->
200
+
201
+ <!--
202
+ ### Recommendations
203
+
204
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
205
+ -->
206
+
207
+ ## Training Details
208
+
209
+ ### Training Logs
210
+ | Epoch | Step | ir-eval_cosine_ndcg@10 |
211
+ |:-----:|:----:|:----------------------:|
212
+ | -1 | -1 | 0.5441 |
213
+
214
+
215
+ ### Framework Versions
216
+ - Python: 3.11.12
217
+ - Sentence Transformers: 4.1.0
218
+ - Transformers: 4.52.3
219
+ - PyTorch: 2.6.0+cu124
220
+ - Accelerate: 1.7.0
221
+ - Datasets: 3.6.0
222
+ - Tokenizers: 0.21.1
223
+
224
+ ## Citation
225
+
226
+ ### BibTeX
227
+
228
+ <!--
229
+ ## Glossary
230
+
231
+ *Clearly define terms in order to be accessible across audiences.*
232
+ -->
233
+
234
+ <!--
235
+ ## Model Card Authors
236
+
237
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
238
+ -->
239
+
240
+ <!--
241
+ ## Model Card Contact
242
+
243
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
244
+ -->
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 1024,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 4096,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 8194,
16
+ "model_type": "xlm-roberta",
17
+ "num_attention_heads": 16,
18
+ "num_hidden_layers": 24,
19
+ "output_past": true,
20
+ "pad_token_id": 1,
21
+ "position_embedding_type": "absolute",
22
+ "torch_dtype": "float32",
23
+ "transformers_version": "4.52.3",
24
+ "type_vocab_size": 1,
25
+ "use_cache": true,
26
+ "vocab_size": 250002
27
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.52.3",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:464467cd0331b5d98f501cb11b850eef1fe47dabc963d3db786b0885aa1271c4
3
+ size 2271064456
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9a6af42442a3e3e9f05f618eae0bb2d98ca4f6a6406cb80ef7a4fa865204d61
3
+ size 17083052
tokenizer_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "max_length": 512,
51
+ "model_max_length": 512,
52
+ "pad_token": "<pad>",
53
+ "sep_token": "</s>",
54
+ "sp_model_kwargs": {},
55
+ "stride": 0,
56
+ "tokenizer_class": "XLMRobertaTokenizer",
57
+ "truncation_side": "right",
58
+ "truncation_strategy": "longest_first",
59
+ "unk_token": "<unk>"
60
+ }