Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
base_model: BEE-spoke-data/bert-plus-L8-
|
3 |
library_name: sentence-transformers
|
4 |
pipeline_tag: sentence-similarity
|
5 |
tags:
|
@@ -9,27 +9,31 @@ tags:
|
|
9 |
- transformers
|
10 |
license: apache-2.0
|
11 |
widget:
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
---
|
22 |
-
|
23 |
-
# BEE-spoke-data/bert-plus-L8-v1.0-allNLI_matryoshka
|
24 |
-
|
25 |
|
26 |
|
27 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
28 |
|
29 |
-
-
|
|
|
30 |
- Matryoshka dims: [768, 512, 256, 128, 64]
|
31 |
|
32 |
-
<!--- Describe your model here -->
|
33 |
|
34 |
## Usage (Sentence-Transformers)
|
35 |
|
@@ -45,7 +49,7 @@ Then you can use the model like this:
|
|
45 |
from sentence_transformers import SentenceTransformer
|
46 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
47 |
|
48 |
-
model = SentenceTransformer('BEE-spoke-data/bert-plus-L8-v1.0-
|
49 |
embeddings = model.encode(sentences)
|
50 |
print(embeddings)
|
51 |
```
|
@@ -71,8 +75,8 @@ def mean_pooling(model_output, attention_mask):
|
|
71 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
72 |
|
73 |
# Load model from HuggingFace Hub
|
74 |
-
tokenizer = AutoTokenizer.from_pretrained('BEE-spoke-data/bert-plus-L8-v1.0-
|
75 |
-
model = AutoModel.from_pretrained('BEE-spoke-data/bert-plus-L8-v1.0-
|
76 |
|
77 |
# Tokenize sentences
|
78 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
@@ -88,55 +92,13 @@ print("Sentence embeddings:")
|
|
88 |
print(sentence_embeddings)
|
89 |
```
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
## Evaluation Results
|
94 |
-
|
95 |
-
<!--- Describe how your model was evaluated -->
|
96 |
-
|
97 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=BEE-spoke-data/bert-plus-L8-v1.0-allNLI_matryoshka)
|
98 |
-
|
99 |
-
|
100 |
## Training
|
101 |
-
The model was trained with the parameters:
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
`sentence_transformers.datasets.NoDuplicatesDataLoader.NoDuplicatesDataLoader` of length 8663 with parameters:
|
106 |
-
```
|
107 |
-
{'batch_size': 32}
|
108 |
-
```
|
109 |
|
110 |
**Loss**:
|
111 |
|
112 |
`sentence_transformers.losses.MatryoshkaLoss.MatryoshkaLoss` with parameters:
|
113 |
```
|
114 |
-
{'loss': '
|
115 |
-
```
|
116 |
-
|
117 |
-
Parameters of the fit()-Method:
|
118 |
-
```
|
119 |
-
{
|
120 |
-
"epochs": 1,
|
121 |
-
"evaluation_steps": 216,
|
122 |
-
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
|
123 |
-
"max_grad_norm": 1,
|
124 |
-
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
125 |
-
"optimizer_params": {
|
126 |
-
"lr": 2e-05
|
127 |
-
},
|
128 |
-
"scheduler": "WarmupLinear",
|
129 |
-
"steps_per_epoch": null,
|
130 |
-
"warmup_steps": 867,
|
131 |
-
"weight_decay": 0.01
|
132 |
-
}
|
133 |
-
```
|
134 |
-
|
135 |
-
|
136 |
-
## Full Model Architecture
|
137 |
-
```
|
138 |
-
SentenceTransformer(
|
139 |
-
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
140 |
-
(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, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
141 |
-
)
|
142 |
-
```
|
|
|
1 |
---
|
2 |
+
base_model: BEE-spoke-data/bert-plus-L8-v1.0-allNLI_matryoshka
|
3 |
library_name: sentence-transformers
|
4 |
pipeline_tag: sentence-similarity
|
5 |
tags:
|
|
|
9 |
- transformers
|
10 |
license: apache-2.0
|
11 |
widget:
|
12 |
+
- source_sentence: How to discreetly optimize operating expenses?
|
13 |
+
sentences:
|
14 |
+
- Strategies for quietly reducing overhead costs
|
15 |
+
- Subtle ways to cut down on operating expenses
|
16 |
+
- >-
|
17 |
+
Implementing technology to save on operating costs without broad
|
18 |
+
announcements
|
19 |
+
- Lowering daily business expenses through unnoticed efficiencies
|
20 |
+
- >-
|
21 |
+
Minimizing operational expenditures in small businesses without drawing
|
22 |
+
attention
|
23 |
+
datasets:
|
24 |
+
- pszemraj/synthetic-text-similarity
|
25 |
+
language:
|
26 |
+
- en
|
27 |
---
|
28 |
+
# BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k
|
|
|
|
|
29 |
|
30 |
|
31 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
32 |
|
33 |
+
- This model has been further trained from [BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k](https://hf.co/BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k) on 'v3.0' of the `synthetic text similarity' dataset.
|
34 |
+
- Intended for use in comparing the cosine similarity of longer document embeddings and/or clustering them.
|
35 |
- Matryoshka dims: [768, 512, 256, 128, 64]
|
36 |
|
|
|
37 |
|
38 |
## Usage (Sentence-Transformers)
|
39 |
|
|
|
49 |
from sentence_transformers import SentenceTransformer
|
50 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
51 |
|
52 |
+
model = SentenceTransformer('BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k')
|
53 |
embeddings = model.encode(sentences)
|
54 |
print(embeddings)
|
55 |
```
|
|
|
75 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
76 |
|
77 |
# Load model from HuggingFace Hub
|
78 |
+
tokenizer = AutoTokenizer.from_pretrained('BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k')
|
79 |
+
model = AutoModel.from_pretrained('BEE-spoke-data/bert-plus-L8-v1.0-synthSTSv3-4k')
|
80 |
|
81 |
# Tokenize sentences
|
82 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
92 |
print(sentence_embeddings)
|
93 |
```
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
## Training
|
|
|
96 |
|
97 |
+
See training details below.
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
**Loss**:
|
100 |
|
101 |
`sentence_transformers.losses.MatryoshkaLoss.MatryoshkaLoss` with parameters:
|
102 |
```
|
103 |
+
{'loss': 'CosineSimilarityLoss', 'matryoshka_dims': [768, 512, 256, 128, 64], 'matryoshka_weights': [1, 1, 1, 1, 1], 'n_dims_per_step': -1}
|
104 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|