Add new SentenceTransformer model
Browse files- README.md +67 -94
- model.safetensors +1 -1
README.md
CHANGED
@@ -12,54 +12,50 @@ tags:
|
|
12 |
- retrieval
|
13 |
- reranking
|
14 |
- generated_from_trainer
|
15 |
-
- dataset_size:
|
16 |
-
- loss:
|
17 |
base_model: Alibaba-NLP/gte-modernbert-base
|
18 |
widget:
|
19 |
-
- source_sentence:
|
20 |
sentences:
|
21 |
-
-
|
22 |
-
|
23 |
-
-
|
24 |
-
|
25 |
-
-
|
26 |
-
- source_sentence:
|
27 |
-
, in which one or two players must win all 28 levels to complete .
|
28 |
sentences:
|
29 |
-
-
|
30 |
-
|
31 |
-
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
- source_sentence: It was formed in December 2014 from elements of the disbanded 51st
|
36 |
-
Mechanized Brigade and newly mobilized units .
|
37 |
sentences:
|
38 |
-
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
and drums were recorded in a day and a half .
|
47 |
sentences:
|
48 |
-
-
|
49 |
-
|
50 |
-
-
|
51 |
-
|
52 |
-
-
|
53 |
-
|
54 |
-
- source_sentence:
|
55 |
-
|
56 |
sentences:
|
57 |
-
-
|
58 |
-
|
59 |
-
-
|
60 |
-
|
61 |
-
-
|
62 |
-
|
63 |
datasets:
|
64 |
- redis/langcache-sentencepairs-v2
|
65 |
pipeline_tag: sentence-similarity
|
@@ -151,9 +147,9 @@ from sentence_transformers import SentenceTransformer
|
|
151 |
model = SentenceTransformer("redis/langcache-embed-v3")
|
152 |
# Run inference
|
153 |
sentences = [
|
154 |
-
'
|
155 |
-
'
|
156 |
-
'
|
157 |
]
|
158 |
embeddings = model.encode(sentences)
|
159 |
print(embeddings.shape)
|
@@ -162,9 +158,9 @@ print(embeddings.shape)
|
|
162 |
# Get the similarity scores for the embeddings
|
163 |
similarities = model.similarity(embeddings, embeddings)
|
164 |
print(similarities)
|
165 |
-
# tensor([[
|
166 |
-
# [0.
|
167 |
-
# [0.
|
168 |
```
|
169 |
|
170 |
<!--
|
@@ -228,52 +224,40 @@ You can finetune this model on your own dataset.
|
|
228 |
#### LangCache Sentence Pairs (all)
|
229 |
|
230 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
231 |
-
* Size:
|
232 |
-
* Columns: <code>
|
233 |
* Approximate statistics based on the first 1000 samples:
|
234 |
-
| |
|
235 |
-
|
236 |
-
| type | string | string |
|
237 |
-
| details | <ul><li>min: 8 tokens</li><li>mean: 27.
|
238 |
* Samples:
|
239 |
-
|
|
240 |
-
|
241 |
-
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code>
|
242 |
-
| <code>
|
243 |
-
| <code>
|
244 |
-
* Loss:
|
245 |
-
```json
|
246 |
-
{
|
247 |
-
"scale": 20.0,
|
248 |
-
"similarity_fct": "pairwise_cos_sim"
|
249 |
-
}
|
250 |
-
```
|
251 |
|
252 |
### Evaluation Dataset
|
253 |
|
254 |
#### LangCache Sentence Pairs (all)
|
255 |
|
256 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
257 |
-
* Size:
|
258 |
-
* Columns: <code>
|
259 |
* Approximate statistics based on the first 1000 samples:
|
260 |
-
| |
|
261 |
-
|
262 |
-
| type | string | string |
|
263 |
-
| details | <ul><li>min: 8 tokens</li><li>mean: 27.
|
264 |
* Samples:
|
265 |
-
|
|
266 |
-
|
267 |
-
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code>
|
268 |
-
| <code>
|
269 |
-
| <code>
|
270 |
-
* Loss:
|
271 |
-
```json
|
272 |
-
{
|
273 |
-
"scale": 20.0,
|
274 |
-
"similarity_fct": "pairwise_cos_sim"
|
275 |
-
}
|
276 |
-
```
|
277 |
|
278 |
### Training Logs
|
279 |
| Epoch | Step | test_cosine_ndcg@10 |
|
@@ -307,17 +291,6 @@ You can finetune this model on your own dataset.
|
|
307 |
}
|
308 |
```
|
309 |
|
310 |
-
#### CoSENTLoss
|
311 |
-
```bibtex
|
312 |
-
@online{kexuefm-8847,
|
313 |
-
title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
|
314 |
-
author={Su Jianlin},
|
315 |
-
year={2022},
|
316 |
-
month={Jan},
|
317 |
-
url={https://kexue.fm/archives/8847},
|
318 |
-
}
|
319 |
-
```
|
320 |
-
|
321 |
<!--
|
322 |
## Glossary
|
323 |
|
|
|
12 |
- retrieval
|
13 |
- reranking
|
14 |
- generated_from_trainer
|
15 |
+
- dataset_size:3587
|
16 |
+
- loss:ArcTripletLoss
|
17 |
base_model: Alibaba-NLP/gte-modernbert-base
|
18 |
widget:
|
19 |
+
- source_sentence: Hunter College was originally Lehman College 's uptown campus .
|
20 |
sentences:
|
21 |
+
- Acquired programming includes the Irish soap `` Fair City `` and Finnish drama
|
22 |
+
`` Black Widows `` .
|
23 |
+
- According to the United States Census Bureau , the town has a total area of ;
|
24 |
+
of the area is land and 0.66 % is water .
|
25 |
+
- Hunter College originally was Lehman College Uptown Campus .
|
26 |
+
- source_sentence: He hoped to defeat them and then marry Ravonna .
|
|
|
27 |
sentences:
|
28 |
+
- Stillwater Creek received its official name in 1884 when William L. Couch established
|
29 |
+
his `` boomer colony `` on its banks .
|
30 |
+
- Note that the invertible of a matrix is always an exponential matrix .
|
31 |
+
- He hoped to defeat them and marry Ravonna .
|
32 |
+
- source_sentence: Born on February 2 , 1984 , Abrar Khan is a professional Pakistani
|
33 |
+
international Kabaddi player .
|
|
|
|
|
34 |
sentences:
|
35 |
+
- Born on February 2 , 1984 , Abrar Khan is a professional Pakistani international
|
36 |
+
Kabaddi player .
|
37 |
+
- Together , the paired mylohyoid muscles form a muscular floor for the oral cavity
|
38 |
+
of the mouth .
|
39 |
+
- Abrar Khan born 2 February 1984 is a Pakistani professional international Kabaddi
|
40 |
+
player .
|
41 |
+
- source_sentence: Certainly , `` Lucy was nothing like flat `` in physical form ,
|
42 |
+
social condition , and personality .
|
|
|
43 |
sentences:
|
44 |
+
- The real number is called the `` imaginary part `` of the real number ; the real
|
45 |
+
number is called the `` complex part `` of .
|
46 |
+
- From the Celebes lake , the captain Bullock observed the appearance of the corona
|
47 |
+
, while Gustav Fritsch accompanied an expedition to Aden .
|
48 |
+
- Certainly `` Lucy was , in physical form , social condition and personality ,
|
49 |
+
nothing like Shallow `` .
|
50 |
+
- source_sentence: The trio has performed besides Gesaffelstein , Justice , Bob Moses
|
51 |
+
and Lee Foss .
|
52 |
sentences:
|
53 |
+
- The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss
|
54 |
+
.
|
55 |
+
- The suttas generally contain educational content , while other early Buddhist
|
56 |
+
texts deal with monastic discipline or vinaya .
|
57 |
+
- The trio has performed alongside Bob Moses , Justice , Gesaffelstein and Lee Foss
|
58 |
+
.
|
59 |
datasets:
|
60 |
- redis/langcache-sentencepairs-v2
|
61 |
pipeline_tag: sentence-similarity
|
|
|
147 |
model = SentenceTransformer("redis/langcache-embed-v3")
|
148 |
# Run inference
|
149 |
sentences = [
|
150 |
+
'The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss .',
|
151 |
+
'The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss .',
|
152 |
+
'The trio has performed alongside Bob Moses , Justice , Gesaffelstein and Lee Foss .',
|
153 |
]
|
154 |
embeddings = model.encode(sentences)
|
155 |
print(embeddings.shape)
|
|
|
158 |
# Get the similarity scores for the embeddings
|
159 |
similarities = model.similarity(embeddings, embeddings)
|
160 |
print(similarities)
|
161 |
+
# tensor([[0.9961, 0.9961, 0.9844],
|
162 |
+
# [0.9961, 0.9961, 0.9844],
|
163 |
+
# [0.9844, 0.9844, 0.9961]], dtype=torch.bfloat16)
|
164 |
```
|
165 |
|
166 |
<!--
|
|
|
224 |
#### LangCache Sentence Pairs (all)
|
225 |
|
226 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
227 |
+
* Size: 1,922 training samples
|
228 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
229 |
* Approximate statistics based on the first 1000 samples:
|
230 |
+
| | anchor | positive | negative |
|
231 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
232 |
+
| type | string | string | string |
|
233 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 27.26 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 27.24 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 27.09 tokens</li><li>max: 49 tokens</li></ul> |
|
234 |
* Samples:
|
235 |
+
| anchor | positive | negative |
|
236 |
+
|:--------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
237 |
+
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>At that time , on June 22 , 1754 , Edward Bentham married Bentham Elizabeth Bates ( d . 1790 ) from Hampshire in the nearby county of Alton .</code> |
|
238 |
+
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>In 2012 , Cornell 5th and Lehigh 8th , Cornell was also 4th in 2013 and 7th in 2014 .</code> |
|
239 |
+
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley Bar N Ranch Airport , , was located at Turner Valley Bar N Ranch , southwest of Turner Valley , Alberta , Canada .</code> |
|
240 |
+
* Loss: <code>losses.ArcTripletLoss</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
### Evaluation Dataset
|
243 |
|
244 |
#### LangCache Sentence Pairs (all)
|
245 |
|
246 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
247 |
+
* Size: 1,922 evaluation samples
|
248 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
249 |
* Approximate statistics based on the first 1000 samples:
|
250 |
+
| | anchor | positive | negative |
|
251 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
252 |
+
| type | string | string | string |
|
253 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 27.26 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 27.24 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 27.09 tokens</li><li>max: 49 tokens</li></ul> |
|
254 |
* Samples:
|
255 |
+
| anchor | positive | negative |
|
256 |
+
|:--------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
257 |
+
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>At that time , on June 22 , 1754 , Edward Bentham married Bentham Elizabeth Bates ( d . 1790 ) from Hampshire in the nearby county of Alton .</code> |
|
258 |
+
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>In 2012 , Cornell 5th and Lehigh 8th , Cornell was also 4th in 2013 and 7th in 2014 .</code> |
|
259 |
+
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley Bar N Ranch Airport , , was located at Turner Valley Bar N Ranch , southwest of Turner Valley , Alberta , Canada .</code> |
|
260 |
+
* Loss: <code>losses.ArcTripletLoss</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
### Training Logs
|
263 |
| Epoch | Step | test_cosine_ndcg@10 |
|
|
|
291 |
}
|
292 |
```
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
<!--
|
295 |
## Glossary
|
296 |
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 298041696
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95d02211c4cca89113f9f3e93ed91f5176bf50170faa2cb835f7bfea15bb9dd2
|
3 |
size 298041696
|