Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +10 -0
- README.md +583 -0
- config.json +25 -0
- config_sentence_transformers.json +12 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +63 -0
- vocab.txt +0 -0
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,583 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- sentence-transformers
|
4 |
+
- sentence-similarity
|
5 |
+
- feature-extraction
|
6 |
+
- generated_from_trainer
|
7 |
+
- dataset_size:400
|
8 |
+
- loss:MatryoshkaLoss
|
9 |
+
- loss:MultipleNegativesRankingLoss
|
10 |
+
base_model: Snowflake/snowflake-arctic-embed-l
|
11 |
+
widget:
|
12 |
+
- source_sentence: Why should manipulative and exploitative uses of AI be prohibited
|
13 |
+
according to the context provided?
|
14 |
+
sentences:
|
15 |
+
- to operate without human intervention. The adaptiveness that an AI system could
|
16 |
+
exhibit after deployment, refers to self-learning capabilities, allowing the system
|
17 |
+
to change while in use. AI systems can be used on a stand-alone basis or as a component
|
18 |
+
of a product, irrespective of whether the system is physically integrated into
|
19 |
+
the product (embedded) or serves the functionality of the product without being
|
20 |
+
integrated therein (non-embedded).
|
21 |
+
- '(28)
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
Aside from the many beneficial uses of AI, it can also be misused and provide
|
26 |
+
novel and powerful tools for manipulative, exploitative and social control practices.
|
27 |
+
Such practices are particularly harmful and abusive and should be prohibited because
|
28 |
+
they contradict Union values of respect for human dignity, freedom, equality,
|
29 |
+
democracy and the rule of law and fundamental rights enshrined in the Charter,
|
30 |
+
including the right to non-discrimination, to data protection and to privacy and
|
31 |
+
the rights of the child.
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
(29)'
|
46 |
+
- A Union legal framework laying down harmonised rules on AI is therefore needed
|
47 |
+
to foster the development, use and uptake of AI in the internal market that at
|
48 |
+
the same time meets a high level of protection of public interests, such as health
|
49 |
+
and safety and the protection of fundamental rights, including democracy, the
|
50 |
+
rule of law and environmental protection as recognised and protected by Union
|
51 |
+
law. To achieve that objective, rules regulating the placing on the market, the
|
52 |
+
putting into service and the use of certain AI systems should be laid down, thus
|
53 |
+
ensuring the smooth functioning of the internal market and allowing those systems
|
54 |
+
to benefit from the principle of free movement of goods and services. Those rules
|
55 |
+
should be clear and robust
|
56 |
+
- source_sentence: What are the ethical principles mentioned in the context for developing
|
57 |
+
voluntary best practices and standards?
|
58 |
+
sentences:
|
59 |
+
- encouraged to take into account, as appropriate, the ethical principles for the
|
60 |
+
development of voluntary best practices and standards.
|
61 |
+
- completed human activity that may be relevant for the purposes of the high-risk
|
62 |
+
uses listed in an annex to this Regulation. Considering those characteristics,
|
63 |
+
the AI system provides only an additional layer to a human activity with consequently
|
64 |
+
lowered risk. That condition would, for example, apply to AI systems that are
|
65 |
+
intended to improve the language used in previously drafted documents, for example
|
66 |
+
in relation to professional tone, academic style of language or by aligning text
|
67 |
+
to a certain brand messaging. The third condition should be that the AI system
|
68 |
+
is intended to detect decision-making patterns or deviations from prior decision-making
|
69 |
+
patterns. The risk would be lowered because the use of the AI system follows a previously
|
70 |
+
- (17)
|
71 |
+
- source_sentence: How do climate change mitigation and adaptation relate to the conservation
|
72 |
+
of biodiversity?
|
73 |
+
sentences:
|
74 |
+
- of the conditions referred to above should draw up documentation of the assessment
|
75 |
+
before that system is placed on the market or put into service and should provide
|
76 |
+
that documentation to national competent authorities upon request. Such a provider
|
77 |
+
should be obliged to register the AI system in the EU database established under
|
78 |
+
this Regulation. With a view to providing further guidance for the practical implementation
|
79 |
+
of the conditions under which the AI systems listed in an annex to this Regulation
|
80 |
+
are, on an exceptional basis, non-high-risk, the Commission should, after consulting
|
81 |
+
the Board, provide guidelines specifying that practical implementation, completed
|
82 |
+
by a comprehensive list of practical examples of use cases of AI systems that
|
83 |
+
- the conservation and restoration of biodiversity and ecosystems and climate change
|
84 |
+
mitigation and adaptation.
|
85 |
+
- logistical point of view.
|
86 |
+
- source_sentence: How often should the risk-management system be reviewed and updated
|
87 |
+
to maintain its effectiveness?
|
88 |
+
sentences:
|
89 |
+
- The risk-management system should consist of a continuous, iterative process that
|
90 |
+
is planned and run throughout the entire lifecycle of a high-risk AI system. That
|
91 |
+
process should be aimed at identifying and mitigating the relevant risks of AI
|
92 |
+
systems on health, safety and fundamental rights. The risk-management system should
|
93 |
+
be regularly reviewed and updated to ensure its continuing effectiveness, as well
|
94 |
+
as justification and documentation of any significant decisions and actions taken
|
95 |
+
subject to this Regulation. This process should ensure that the provider identifies
|
96 |
+
risks or adverse impacts and implements mitigation measures for the known and
|
97 |
+
reasonably foreseeable risks of AI systems to the health, safety and fundamental
|
98 |
+
rights in light
|
99 |
+
- solely on profiling them or on assessing their personality traits and characteristics
|
100 |
+
should be prohibited. In any case, that prohibition does not refer to or touch
|
101 |
+
upon risk analytics that are not based on the profiling of individuals or on the
|
102 |
+
personality traits and characteristics of individuals, such as AI systems using
|
103 |
+
risk analytics to assess the likelihood of financial fraud by undertakings on
|
104 |
+
the basis of suspicious transactions or risk analytic tools to predict the likelihood
|
105 |
+
of the localisation of narcotics or illicit goods by customs authorities, for
|
106 |
+
example on the basis of known trafficking routes.
|
107 |
+
- be clear and robust in protecting fundamental rights, supportive of new innovative
|
108 |
+
solutions, enabling a European ecosystem of public and private actors creating
|
109 |
+
AI systems in line with Union values and unlocking the potential of the digital
|
110 |
+
transformation across all regions of the Union. By laying down those rules as
|
111 |
+
well as measures in support of innovation with a particular focus on small and
|
112 |
+
medium enterprises (SMEs), including startups, this Regulation supports the objective
|
113 |
+
of promoting the European human-centric approach to AI and being a global leader
|
114 |
+
in the development of secure, trustworthy and ethical AI as stated by the European
|
115 |
+
Council (5), and it ensures the protection of ethical principles, as specifically
|
116 |
+
requested by the
|
117 |
+
- source_sentence: How is the number 42 used in mathematical contexts?
|
118 |
+
sentences:
|
119 |
+
- (65)
|
120 |
+
- (42)
|
121 |
+
- to obtain prior authorisation. This could be, for example, a person involved in
|
122 |
+
a crime, being unwilling, or unable due to an accident or a medical condition,
|
123 |
+
to disclose their identity to law enforcement authorities.
|
124 |
+
pipeline_tag: sentence-similarity
|
125 |
+
library_name: sentence-transformers
|
126 |
+
metrics:
|
127 |
+
- cosine_accuracy@1
|
128 |
+
- cosine_accuracy@3
|
129 |
+
- cosine_accuracy@5
|
130 |
+
- cosine_accuracy@10
|
131 |
+
- cosine_precision@1
|
132 |
+
- cosine_precision@3
|
133 |
+
- cosine_precision@5
|
134 |
+
- cosine_precision@10
|
135 |
+
- cosine_recall@1
|
136 |
+
- cosine_recall@3
|
137 |
+
- cosine_recall@5
|
138 |
+
- cosine_recall@10
|
139 |
+
- cosine_ndcg@10
|
140 |
+
- cosine_mrr@10
|
141 |
+
- cosine_map@100
|
142 |
+
model-index:
|
143 |
+
- name: SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
|
144 |
+
results:
|
145 |
+
- task:
|
146 |
+
type: information-retrieval
|
147 |
+
name: Information Retrieval
|
148 |
+
dataset:
|
149 |
+
name: Unknown
|
150 |
+
type: unknown
|
151 |
+
metrics:
|
152 |
+
- type: cosine_accuracy@1
|
153 |
+
value: 0.875
|
154 |
+
name: Cosine Accuracy@1
|
155 |
+
- type: cosine_accuracy@3
|
156 |
+
value: 1.0
|
157 |
+
name: Cosine Accuracy@3
|
158 |
+
- type: cosine_accuracy@5
|
159 |
+
value: 1.0
|
160 |
+
name: Cosine Accuracy@5
|
161 |
+
- type: cosine_accuracy@10
|
162 |
+
value: 1.0
|
163 |
+
name: Cosine Accuracy@10
|
164 |
+
- type: cosine_precision@1
|
165 |
+
value: 0.875
|
166 |
+
name: Cosine Precision@1
|
167 |
+
- type: cosine_precision@3
|
168 |
+
value: 0.3333333333333333
|
169 |
+
name: Cosine Precision@3
|
170 |
+
- type: cosine_precision@5
|
171 |
+
value: 0.19999999999999998
|
172 |
+
name: Cosine Precision@5
|
173 |
+
- type: cosine_precision@10
|
174 |
+
value: 0.09999999999999999
|
175 |
+
name: Cosine Precision@10
|
176 |
+
- type: cosine_recall@1
|
177 |
+
value: 0.875
|
178 |
+
name: Cosine Recall@1
|
179 |
+
- type: cosine_recall@3
|
180 |
+
value: 1.0
|
181 |
+
name: Cosine Recall@3
|
182 |
+
- type: cosine_recall@5
|
183 |
+
value: 1.0
|
184 |
+
name: Cosine Recall@5
|
185 |
+
- type: cosine_recall@10
|
186 |
+
value: 1.0
|
187 |
+
name: Cosine Recall@10
|
188 |
+
- type: cosine_ndcg@10
|
189 |
+
value: 0.9484108127976215
|
190 |
+
name: Cosine Ndcg@10
|
191 |
+
- type: cosine_mrr@10
|
192 |
+
value: 0.9305555555555555
|
193 |
+
name: Cosine Mrr@10
|
194 |
+
- type: cosine_map@100
|
195 |
+
value: 0.9305555555555557
|
196 |
+
name: Cosine Map@100
|
197 |
+
---
|
198 |
+
|
199 |
+
# SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
|
200 |
+
|
201 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l). 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.
|
202 |
+
|
203 |
+
## Model Details
|
204 |
+
|
205 |
+
### Model Description
|
206 |
+
- **Model Type:** Sentence Transformer
|
207 |
+
- **Base model:** [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l) <!-- at revision d8fb21ca8d905d2832ee8b96c894d3298964346b -->
|
208 |
+
- **Maximum Sequence Length:** 512 tokens
|
209 |
+
- **Output Dimensionality:** 1024 dimensions
|
210 |
+
- **Similarity Function:** Cosine Similarity
|
211 |
+
<!-- - **Training Dataset:** Unknown -->
|
212 |
+
<!-- - **Language:** Unknown -->
|
213 |
+
<!-- - **License:** Unknown -->
|
214 |
+
|
215 |
+
### Model Sources
|
216 |
+
|
217 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
218 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
219 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
220 |
+
|
221 |
+
### Full Model Architecture
|
222 |
+
|
223 |
+
```
|
224 |
+
SentenceTransformer(
|
225 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
226 |
+
(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})
|
227 |
+
(2): Normalize()
|
228 |
+
)
|
229 |
+
```
|
230 |
+
|
231 |
+
## Usage
|
232 |
+
|
233 |
+
### Direct Usage (Sentence Transformers)
|
234 |
+
|
235 |
+
First install the Sentence Transformers library:
|
236 |
+
|
237 |
+
```bash
|
238 |
+
pip install -U sentence-transformers
|
239 |
+
```
|
240 |
+
|
241 |
+
Then you can load this model and run inference.
|
242 |
+
```python
|
243 |
+
from sentence_transformers import SentenceTransformer
|
244 |
+
|
245 |
+
# Download from the 🤗 Hub
|
246 |
+
model = SentenceTransformer("arthikrangan/legal-ft-1")
|
247 |
+
# Run inference
|
248 |
+
sentences = [
|
249 |
+
'How is the number 42 used in mathematical contexts?',
|
250 |
+
'(42)',
|
251 |
+
'(65)',
|
252 |
+
]
|
253 |
+
embeddings = model.encode(sentences)
|
254 |
+
print(embeddings.shape)
|
255 |
+
# [3, 1024]
|
256 |
+
|
257 |
+
# Get the similarity scores for the embeddings
|
258 |
+
similarities = model.similarity(embeddings, embeddings)
|
259 |
+
print(similarities.shape)
|
260 |
+
# [3, 3]
|
261 |
+
```
|
262 |
+
|
263 |
+
<!--
|
264 |
+
### Direct Usage (Transformers)
|
265 |
+
|
266 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
267 |
+
|
268 |
+
</details>
|
269 |
+
-->
|
270 |
+
|
271 |
+
<!--
|
272 |
+
### Downstream Usage (Sentence Transformers)
|
273 |
+
|
274 |
+
You can finetune this model on your own dataset.
|
275 |
+
|
276 |
+
<details><summary>Click to expand</summary>
|
277 |
+
|
278 |
+
</details>
|
279 |
+
-->
|
280 |
+
|
281 |
+
<!--
|
282 |
+
### Out-of-Scope Use
|
283 |
+
|
284 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
285 |
+
-->
|
286 |
+
|
287 |
+
## Evaluation
|
288 |
+
|
289 |
+
### Metrics
|
290 |
+
|
291 |
+
#### Information Retrieval
|
292 |
+
|
293 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
294 |
+
|
295 |
+
| Metric | Value |
|
296 |
+
|:--------------------|:-----------|
|
297 |
+
| cosine_accuracy@1 | 0.875 |
|
298 |
+
| cosine_accuracy@3 | 1.0 |
|
299 |
+
| cosine_accuracy@5 | 1.0 |
|
300 |
+
| cosine_accuracy@10 | 1.0 |
|
301 |
+
| cosine_precision@1 | 0.875 |
|
302 |
+
| cosine_precision@3 | 0.3333 |
|
303 |
+
| cosine_precision@5 | 0.2 |
|
304 |
+
| cosine_precision@10 | 0.1 |
|
305 |
+
| cosine_recall@1 | 0.875 |
|
306 |
+
| cosine_recall@3 | 1.0 |
|
307 |
+
| cosine_recall@5 | 1.0 |
|
308 |
+
| cosine_recall@10 | 1.0 |
|
309 |
+
| **cosine_ndcg@10** | **0.9484** |
|
310 |
+
| cosine_mrr@10 | 0.9306 |
|
311 |
+
| cosine_map@100 | 0.9306 |
|
312 |
+
|
313 |
+
<!--
|
314 |
+
## Bias, Risks and Limitations
|
315 |
+
|
316 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
317 |
+
-->
|
318 |
+
|
319 |
+
<!--
|
320 |
+
### Recommendations
|
321 |
+
|
322 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
323 |
+
-->
|
324 |
+
|
325 |
+
## Training Details
|
326 |
+
|
327 |
+
### Training Dataset
|
328 |
+
|
329 |
+
#### Unnamed Dataset
|
330 |
+
|
331 |
+
* Size: 400 training samples
|
332 |
+
* Columns: <code>sentence_0</code> and <code>sentence_1</code>
|
333 |
+
* Approximate statistics based on the first 400 samples:
|
334 |
+
| | sentence_0 | sentence_1 |
|
335 |
+
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
336 |
+
| type | string | string |
|
337 |
+
| details | <ul><li>min: 10 tokens</li><li>mean: 20.49 tokens</li><li>max: 35 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 93.01 tokens</li><li>max: 186 tokens</li></ul> |
|
338 |
+
* Samples:
|
339 |
+
| sentence_0 | sentence_1 |
|
340 |
+
|:-----------------------------------------------------------------------------|:-------------------------------------------------------|
|
341 |
+
| <code>What was requested by the European Parliament?</code> | <code>requested by the European Parliament (6).</code> |
|
342 |
+
| <code>Who made the request to the European Parliament?</code> | <code>requested by the European Parliament (6).</code> |
|
343 |
+
| <code>What is the significance of the number 60 in the given context?</code> | <code>(60)</code> |
|
344 |
+
* Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
|
345 |
+
```json
|
346 |
+
{
|
347 |
+
"loss": "MultipleNegativesRankingLoss",
|
348 |
+
"matryoshka_dims": [
|
349 |
+
768,
|
350 |
+
512,
|
351 |
+
256,
|
352 |
+
128,
|
353 |
+
64
|
354 |
+
],
|
355 |
+
"matryoshka_weights": [
|
356 |
+
1,
|
357 |
+
1,
|
358 |
+
1,
|
359 |
+
1,
|
360 |
+
1
|
361 |
+
],
|
362 |
+
"n_dims_per_step": -1
|
363 |
+
}
|
364 |
+
```
|
365 |
+
|
366 |
+
### Training Hyperparameters
|
367 |
+
#### Non-Default Hyperparameters
|
368 |
+
|
369 |
+
- `eval_strategy`: steps
|
370 |
+
- `per_device_train_batch_size`: 10
|
371 |
+
- `per_device_eval_batch_size`: 10
|
372 |
+
- `num_train_epochs`: 10
|
373 |
+
- `multi_dataset_batch_sampler`: round_robin
|
374 |
+
|
375 |
+
#### All Hyperparameters
|
376 |
+
<details><summary>Click to expand</summary>
|
377 |
+
|
378 |
+
- `overwrite_output_dir`: False
|
379 |
+
- `do_predict`: False
|
380 |
+
- `eval_strategy`: steps
|
381 |
+
- `prediction_loss_only`: True
|
382 |
+
- `per_device_train_batch_size`: 10
|
383 |
+
- `per_device_eval_batch_size`: 10
|
384 |
+
- `per_gpu_train_batch_size`: None
|
385 |
+
- `per_gpu_eval_batch_size`: None
|
386 |
+
- `gradient_accumulation_steps`: 1
|
387 |
+
- `eval_accumulation_steps`: None
|
388 |
+
- `torch_empty_cache_steps`: None
|
389 |
+
- `learning_rate`: 5e-05
|
390 |
+
- `weight_decay`: 0.0
|
391 |
+
- `adam_beta1`: 0.9
|
392 |
+
- `adam_beta2`: 0.999
|
393 |
+
- `adam_epsilon`: 1e-08
|
394 |
+
- `max_grad_norm`: 1
|
395 |
+
- `num_train_epochs`: 10
|
396 |
+
- `max_steps`: -1
|
397 |
+
- `lr_scheduler_type`: linear
|
398 |
+
- `lr_scheduler_kwargs`: {}
|
399 |
+
- `warmup_ratio`: 0.0
|
400 |
+
- `warmup_steps`: 0
|
401 |
+
- `log_level`: passive
|
402 |
+
- `log_level_replica`: warning
|
403 |
+
- `log_on_each_node`: True
|
404 |
+
- `logging_nan_inf_filter`: True
|
405 |
+
- `save_safetensors`: True
|
406 |
+
- `save_on_each_node`: False
|
407 |
+
- `save_only_model`: False
|
408 |
+
- `restore_callback_states_from_checkpoint`: False
|
409 |
+
- `no_cuda`: False
|
410 |
+
- `use_cpu`: False
|
411 |
+
- `use_mps_device`: False
|
412 |
+
- `seed`: 42
|
413 |
+
- `data_seed`: None
|
414 |
+
- `jit_mode_eval`: False
|
415 |
+
- `use_ipex`: False
|
416 |
+
- `bf16`: False
|
417 |
+
- `fp16`: False
|
418 |
+
- `fp16_opt_level`: O1
|
419 |
+
- `half_precision_backend`: auto
|
420 |
+
- `bf16_full_eval`: False
|
421 |
+
- `fp16_full_eval`: False
|
422 |
+
- `tf32`: None
|
423 |
+
- `local_rank`: 0
|
424 |
+
- `ddp_backend`: None
|
425 |
+
- `tpu_num_cores`: None
|
426 |
+
- `tpu_metrics_debug`: False
|
427 |
+
- `debug`: []
|
428 |
+
- `dataloader_drop_last`: False
|
429 |
+
- `dataloader_num_workers`: 0
|
430 |
+
- `dataloader_prefetch_factor`: None
|
431 |
+
- `past_index`: -1
|
432 |
+
- `disable_tqdm`: False
|
433 |
+
- `remove_unused_columns`: True
|
434 |
+
- `label_names`: None
|
435 |
+
- `load_best_model_at_end`: False
|
436 |
+
- `ignore_data_skip`: False
|
437 |
+
- `fsdp`: []
|
438 |
+
- `fsdp_min_num_params`: 0
|
439 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
440 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
441 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
442 |
+
- `deepspeed`: None
|
443 |
+
- `label_smoothing_factor`: 0.0
|
444 |
+
- `optim`: adamw_torch
|
445 |
+
- `optim_args`: None
|
446 |
+
- `adafactor`: False
|
447 |
+
- `group_by_length`: False
|
448 |
+
- `length_column_name`: length
|
449 |
+
- `ddp_find_unused_parameters`: None
|
450 |
+
- `ddp_bucket_cap_mb`: None
|
451 |
+
- `ddp_broadcast_buffers`: False
|
452 |
+
- `dataloader_pin_memory`: True
|
453 |
+
- `dataloader_persistent_workers`: False
|
454 |
+
- `skip_memory_metrics`: True
|
455 |
+
- `use_legacy_prediction_loop`: False
|
456 |
+
- `push_to_hub`: False
|
457 |
+
- `resume_from_checkpoint`: None
|
458 |
+
- `hub_model_id`: None
|
459 |
+
- `hub_strategy`: every_save
|
460 |
+
- `hub_private_repo`: None
|
461 |
+
- `hub_always_push`: False
|
462 |
+
- `gradient_checkpointing`: False
|
463 |
+
- `gradient_checkpointing_kwargs`: None
|
464 |
+
- `include_inputs_for_metrics`: False
|
465 |
+
- `include_for_metrics`: []
|
466 |
+
- `eval_do_concat_batches`: True
|
467 |
+
- `fp16_backend`: auto
|
468 |
+
- `push_to_hub_model_id`: None
|
469 |
+
- `push_to_hub_organization`: None
|
470 |
+
- `mp_parameters`:
|
471 |
+
- `auto_find_batch_size`: False
|
472 |
+
- `full_determinism`: False
|
473 |
+
- `torchdynamo`: None
|
474 |
+
- `ray_scope`: last
|
475 |
+
- `ddp_timeout`: 1800
|
476 |
+
- `torch_compile`: False
|
477 |
+
- `torch_compile_backend`: None
|
478 |
+
- `torch_compile_mode`: None
|
479 |
+
- `dispatch_batches`: None
|
480 |
+
- `split_batches`: None
|
481 |
+
- `include_tokens_per_second`: False
|
482 |
+
- `include_num_input_tokens_seen`: False
|
483 |
+
- `neftune_noise_alpha`: None
|
484 |
+
- `optim_target_modules`: None
|
485 |
+
- `batch_eval_metrics`: False
|
486 |
+
- `eval_on_start`: False
|
487 |
+
- `use_liger_kernel`: False
|
488 |
+
- `eval_use_gather_object`: False
|
489 |
+
- `average_tokens_across_devices`: False
|
490 |
+
- `prompts`: None
|
491 |
+
- `batch_sampler`: batch_sampler
|
492 |
+
- `multi_dataset_batch_sampler`: round_robin
|
493 |
+
|
494 |
+
</details>
|
495 |
+
|
496 |
+
### Training Logs
|
497 |
+
| Epoch | Step | cosine_ndcg@10 |
|
498 |
+
|:-----:|:----:|:--------------:|
|
499 |
+
| 1.0 | 40 | 0.9846 |
|
500 |
+
| 1.25 | 50 | 0.9923 |
|
501 |
+
| 2.0 | 80 | 0.9588 |
|
502 |
+
| 2.5 | 100 | 0.9692 |
|
503 |
+
| 3.0 | 120 | 0.9692 |
|
504 |
+
| 3.75 | 150 | 0.9539 |
|
505 |
+
| 4.0 | 160 | 0.9539 |
|
506 |
+
| 5.0 | 200 | 0.9588 |
|
507 |
+
| 6.0 | 240 | 0.9665 |
|
508 |
+
| 6.25 | 250 | 0.9588 |
|
509 |
+
| 7.0 | 280 | 0.9511 |
|
510 |
+
| 7.5 | 300 | 0.9511 |
|
511 |
+
| 8.0 | 320 | 0.9407 |
|
512 |
+
| 8.75 | 350 | 0.9484 |
|
513 |
+
| 9.0 | 360 | 0.9484 |
|
514 |
+
| 10.0 | 400 | 0.9484 |
|
515 |
+
|
516 |
+
|
517 |
+
### Framework Versions
|
518 |
+
- Python: 3.11.11
|
519 |
+
- Sentence Transformers: 3.4.1
|
520 |
+
- Transformers: 4.48.2
|
521 |
+
- PyTorch: 2.5.1+cu124
|
522 |
+
- Accelerate: 1.3.0
|
523 |
+
- Datasets: 3.2.0
|
524 |
+
- Tokenizers: 0.21.0
|
525 |
+
|
526 |
+
## Citation
|
527 |
+
|
528 |
+
### BibTeX
|
529 |
+
|
530 |
+
#### Sentence Transformers
|
531 |
+
```bibtex
|
532 |
+
@inproceedings{reimers-2019-sentence-bert,
|
533 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
534 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
535 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
536 |
+
month = "11",
|
537 |
+
year = "2019",
|
538 |
+
publisher = "Association for Computational Linguistics",
|
539 |
+
url = "https://arxiv.org/abs/1908.10084",
|
540 |
+
}
|
541 |
+
```
|
542 |
+
|
543 |
+
#### MatryoshkaLoss
|
544 |
+
```bibtex
|
545 |
+
@misc{kusupati2024matryoshka,
|
546 |
+
title={Matryoshka Representation Learning},
|
547 |
+
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
|
548 |
+
year={2024},
|
549 |
+
eprint={2205.13147},
|
550 |
+
archivePrefix={arXiv},
|
551 |
+
primaryClass={cs.LG}
|
552 |
+
}
|
553 |
+
```
|
554 |
+
|
555 |
+
#### MultipleNegativesRankingLoss
|
556 |
+
```bibtex
|
557 |
+
@misc{henderson2017efficient,
|
558 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
559 |
+
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
|
560 |
+
year={2017},
|
561 |
+
eprint={1705.00652},
|
562 |
+
archivePrefix={arXiv},
|
563 |
+
primaryClass={cs.CL}
|
564 |
+
}
|
565 |
+
```
|
566 |
+
|
567 |
+
<!--
|
568 |
+
## Glossary
|
569 |
+
|
570 |
+
*Clearly define terms in order to be accessible across audiences.*
|
571 |
+
-->
|
572 |
+
|
573 |
+
<!--
|
574 |
+
## Model Card Authors
|
575 |
+
|
576 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
577 |
+
-->
|
578 |
+
|
579 |
+
<!--
|
580 |
+
## Model Card Contact
|
581 |
+
|
582 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
583 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Snowflake/snowflake-arctic-embed-l",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 1024,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 4096,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 16,
|
17 |
+
"num_hidden_layers": 24,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"torch_dtype": "float32",
|
21 |
+
"transformers_version": "4.48.2",
|
22 |
+
"type_vocab_size": 2,
|
23 |
+
"use_cache": true,
|
24 |
+
"vocab_size": 30522
|
25 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.4.1",
|
4 |
+
"transformers": "4.48.2",
|
5 |
+
"pytorch": "2.5.1+cu124"
|
6 |
+
},
|
7 |
+
"prompts": {
|
8 |
+
"query": "Represent this sentence for searching relevant passages: "
|
9 |
+
},
|
10 |
+
"default_prompt_name": null,
|
11 |
+
"similarity_fn_name": "cosine"
|
12 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:68ff753ebe00af3707c2671172a9d4bbc5f66f2cf235744728df9ecd90244890
|
3 |
+
size 1336413848
|
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_Normalize",
|
18 |
+
"type": "sentence_transformers.models.Normalize"
|
19 |
+
}
|
20 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 512,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_lower_case": true,
|
47 |
+
"extra_special_tokens": {},
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"max_length": 512,
|
50 |
+
"model_max_length": 512,
|
51 |
+
"pad_to_multiple_of": null,
|
52 |
+
"pad_token": "[PAD]",
|
53 |
+
"pad_token_type_id": 0,
|
54 |
+
"padding_side": "right",
|
55 |
+
"sep_token": "[SEP]",
|
56 |
+
"stride": 0,
|
57 |
+
"strip_accents": null,
|
58 |
+
"tokenize_chinese_chars": true,
|
59 |
+
"tokenizer_class": "BertTokenizer",
|
60 |
+
"truncation_side": "right",
|
61 |
+
"truncation_strategy": "longest_first",
|
62 |
+
"unk_token": "[UNK]"
|
63 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|