Update README.md
Browse files
README.md
CHANGED
|
@@ -1,21 +1,213 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
library_name: sentence-transformers
|
| 3 |
pipeline_tag: sentence-similarity
|
| 4 |
tags:
|
| 5 |
- sentence-transformers
|
| 6 |
- feature-extraction
|
| 7 |
- sentence-similarity
|
| 8 |
-
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
## Usage (Sentence-Transformers)
|
| 19 |
|
| 20 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
| 21 |
|
|
@@ -29,14 +221,14 @@ Then you can use the model like this:
|
|
| 29 |
from sentence_transformers import SentenceTransformer
|
| 30 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 31 |
|
| 32 |
-
model = SentenceTransformer('
|
| 33 |
embeddings = model.encode(sentences)
|
| 34 |
print(embeddings)
|
| 35 |
```
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
-
## Usage (HuggingFace Transformers)
|
| 40 |
Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
|
| 41 |
|
| 42 |
```python
|
|
@@ -55,8 +247,8 @@ def mean_pooling(model_output, attention_mask):
|
|
| 55 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 56 |
|
| 57 |
# Load model from HuggingFace Hub
|
| 58 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 59 |
-
model = AutoModel.from_pretrained('
|
| 60 |
|
| 61 |
# Tokenize sentences
|
| 62 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
@@ -72,57 +264,5 @@ print("Sentence embeddings:")
|
|
| 72 |
print(sentence_embeddings)
|
| 73 |
```
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
## Evaluation Results
|
| 78 |
-
|
| 79 |
-
<!--- Describe how your model was evaluated -->
|
| 80 |
-
|
| 81 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
## Training
|
| 85 |
-
The model was trained with the parameters:
|
| 86 |
-
|
| 87 |
-
**DataLoader**:
|
| 88 |
-
|
| 89 |
-
`torch.utils.data.dataloader.DataLoader` of length 34389 with parameters:
|
| 90 |
-
```
|
| 91 |
-
{'batch_size': 256, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
| 92 |
-
```
|
| 93 |
-
|
| 94 |
-
**Loss**:
|
| 95 |
-
|
| 96 |
-
`sentence_transformers.losses.MSELoss.MSELoss`
|
| 97 |
-
|
| 98 |
-
Parameters of the fit()-Method:
|
| 99 |
-
```
|
| 100 |
-
{
|
| 101 |
-
"epochs": 1,
|
| 102 |
-
"evaluation_steps": 5000,
|
| 103 |
-
"evaluator": "sentence_transformers.evaluation.SequentialEvaluator.SequentialEvaluator",
|
| 104 |
-
"max_grad_norm": 1,
|
| 105 |
-
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
| 106 |
-
"optimizer_params": {
|
| 107 |
-
"eps": 1e-06,
|
| 108 |
-
"lr": 0.0001
|
| 109 |
-
},
|
| 110 |
-
"scheduler": "WarmupLinear",
|
| 111 |
-
"steps_per_epoch": null,
|
| 112 |
-
"warmup_steps": 1000,
|
| 113 |
-
"weight_decay": 0.01
|
| 114 |
-
}
|
| 115 |
-
```
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
## Full Model Architecture
|
| 119 |
-
```
|
| 120 |
-
SentenceTransformer(
|
| 121 |
-
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
| 122 |
-
(1): Pooling({'word_embedding_dimension': 384, '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})
|
| 123 |
-
)
|
| 124 |
-
```
|
| 125 |
-
|
| 126 |
-
## Citing & Authors
|
| 127 |
-
|
| 128 |
-
<!--- Describe where people can find more information -->
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
library_name: sentence-transformers
|
| 4 |
pipeline_tag: sentence-similarity
|
| 5 |
tags:
|
| 6 |
- sentence-transformers
|
| 7 |
- feature-extraction
|
| 8 |
- sentence-similarity
|
| 9 |
+
- gte
|
| 10 |
+
- mteb
|
| 11 |
+
model-index:
|
| 12 |
+
- name: gte-micro-test
|
| 13 |
+
results:
|
| 14 |
+
- task:
|
| 15 |
+
type: Classification
|
| 16 |
+
dataset:
|
| 17 |
+
type: mteb/amazon_counterfactual
|
| 18 |
+
name: MTEB AmazonCounterfactualClassification (en)
|
| 19 |
+
config: en
|
| 20 |
+
split: test
|
| 21 |
+
revision: e8379541af4e31359cca9fbcf4b00f2671dba205
|
| 22 |
+
metrics:
|
| 23 |
+
- type: accuracy
|
| 24 |
+
value: 71.43283582089552
|
| 25 |
+
- type: ap
|
| 26 |
+
value: 33.56235301308992
|
| 27 |
+
- type: f1
|
| 28 |
+
value: 65.18510976313922
|
| 29 |
+
- task:
|
| 30 |
+
type: Classification
|
| 31 |
+
dataset:
|
| 32 |
+
type: mteb/amazon_polarity
|
| 33 |
+
name: MTEB AmazonPolarityClassification
|
| 34 |
+
config: default
|
| 35 |
+
split: test
|
| 36 |
+
revision: e2d317d38cd51312af73b3d32a06d1a08b442046
|
| 37 |
+
metrics:
|
| 38 |
+
- type: accuracy
|
| 39 |
+
value: 77.72055
|
| 40 |
+
- type: ap
|
| 41 |
+
value: 72.30281215701287
|
| 42 |
+
- type: f1
|
| 43 |
+
value: 77.62429097469116
|
| 44 |
+
- task:
|
| 45 |
+
type: Classification
|
| 46 |
+
dataset:
|
| 47 |
+
type: mteb/amazon_reviews_multi
|
| 48 |
+
name: MTEB AmazonReviewsClassification (en)
|
| 49 |
+
config: en
|
| 50 |
+
split: test
|
| 51 |
+
revision: 1399c76144fd37290681b995c656ef9b2e06e26d
|
| 52 |
+
metrics:
|
| 53 |
+
- type: accuracy
|
| 54 |
+
value: 38.956
|
| 55 |
+
- type: f1
|
| 56 |
+
value: 38.59075995638611
|
| 57 |
+
- task:
|
| 58 |
+
type: Clustering
|
| 59 |
+
dataset:
|
| 60 |
+
type: mteb/arxiv-clustering-p2p
|
| 61 |
+
name: MTEB ArxivClusteringP2P
|
| 62 |
+
config: default
|
| 63 |
+
split: test
|
| 64 |
+
revision: a122ad7f3f0291bf49cc6f4d32aa80929df69d5d
|
| 65 |
+
metrics:
|
| 66 |
+
- type: v_measure
|
| 67 |
+
value: 41.14317775707504
|
| 68 |
+
- task:
|
| 69 |
+
type: Clustering
|
| 70 |
+
dataset:
|
| 71 |
+
type: mteb/arxiv-clustering-s2s
|
| 72 |
+
name: MTEB ArxivClusteringS2S
|
| 73 |
+
config: default
|
| 74 |
+
split: test
|
| 75 |
+
revision: f910caf1a6075f7329cdf8c1a6135696f37dbd53
|
| 76 |
+
metrics:
|
| 77 |
+
- type: v_measure
|
| 78 |
+
value: 31.79440862639374
|
| 79 |
+
- task:
|
| 80 |
+
type: Classification
|
| 81 |
+
dataset:
|
| 82 |
+
type: mteb/banking77
|
| 83 |
+
name: MTEB Banking77Classification
|
| 84 |
+
config: default
|
| 85 |
+
split: test
|
| 86 |
+
revision: 0fd18e25b25c072e09e0d92ab615fda904d66300
|
| 87 |
+
metrics:
|
| 88 |
+
- type: accuracy
|
| 89 |
+
value: 80.40259740259741
|
| 90 |
+
- type: f1
|
| 91 |
+
value: 80.33885811790022
|
| 92 |
+
- task:
|
| 93 |
+
type: Classification
|
| 94 |
+
dataset:
|
| 95 |
+
type: mteb/emotion
|
| 96 |
+
name: MTEB EmotionClassification
|
| 97 |
+
config: default
|
| 98 |
+
split: test
|
| 99 |
+
revision: 4f58c6b202a23cf9a4da393831edf4f9183cad37
|
| 100 |
+
metrics:
|
| 101 |
+
- type: accuracy
|
| 102 |
+
value: 44.54
|
| 103 |
+
- type: f1
|
| 104 |
+
value: 39.40201192446353
|
| 105 |
+
- task:
|
| 106 |
+
type: Classification
|
| 107 |
+
dataset:
|
| 108 |
+
type: mteb/imdb
|
| 109 |
+
name: MTEB ImdbClassification
|
| 110 |
+
config: default
|
| 111 |
+
split: test
|
| 112 |
+
revision: 3d86128a09e091d6018b6d26cad27f2739fc2db7
|
| 113 |
+
metrics:
|
| 114 |
+
- type: accuracy
|
| 115 |
+
value: 70.5904
|
| 116 |
+
- type: ap
|
| 117 |
+
value: 64.61751544665012
|
| 118 |
+
- type: f1
|
| 119 |
+
value: 70.47776028292148
|
| 120 |
+
- task:
|
| 121 |
+
type: Classification
|
| 122 |
+
dataset:
|
| 123 |
+
type: mteb/mtop_domain
|
| 124 |
+
name: MTEB MTOPDomainClassification (en)
|
| 125 |
+
config: en
|
| 126 |
+
split: test
|
| 127 |
+
revision: d80d48c1eb48d3562165c59d59d0034df9fff0bf
|
| 128 |
+
metrics:
|
| 129 |
+
- type: accuracy
|
| 130 |
+
value: 90.49703602371181
|
| 131 |
+
- type: f1
|
| 132 |
+
value: 90.05253119123799
|
| 133 |
+
- task:
|
| 134 |
+
type: Classification
|
| 135 |
+
dataset:
|
| 136 |
+
type: mteb/mtop_intent
|
| 137 |
+
name: MTEB MTOPIntentClassification (en)
|
| 138 |
+
config: en
|
| 139 |
+
split: test
|
| 140 |
+
revision: ae001d0e6b1228650b7bd1c2c65fb50ad11a8aba
|
| 141 |
+
metrics:
|
| 142 |
+
- type: accuracy
|
| 143 |
+
value: 67.52393980848153
|
| 144 |
+
- type: f1
|
| 145 |
+
value: 49.95609666042009
|
| 146 |
+
- task:
|
| 147 |
+
type: Classification
|
| 148 |
+
dataset:
|
| 149 |
+
type: mteb/amazon_massive_intent
|
| 150 |
+
name: MTEB MassiveIntentClassification (en)
|
| 151 |
+
config: en
|
| 152 |
+
split: test
|
| 153 |
+
revision: 31efe3c427b0bae9c22cbb560b8f15491cc6bed7
|
| 154 |
+
metrics:
|
| 155 |
+
- type: accuracy
|
| 156 |
+
value: 68.4969737726967
|
| 157 |
+
- type: f1
|
| 158 |
+
value: 66.32116772424203
|
| 159 |
+
- task:
|
| 160 |
+
type: Classification
|
| 161 |
+
dataset:
|
| 162 |
+
type: mteb/amazon_massive_scenario
|
| 163 |
+
name: MTEB MassiveScenarioClassification (en)
|
| 164 |
+
config: en
|
| 165 |
+
split: test
|
| 166 |
+
revision: 7d571f92784cd94a019292a1f45445077d0ef634
|
| 167 |
+
metrics:
|
| 168 |
+
- type: accuracy
|
| 169 |
+
value: 73.54741089441829
|
| 170 |
+
- type: f1
|
| 171 |
+
value: 73.47537036064044
|
| 172 |
+
- task:
|
| 173 |
+
type: Classification
|
| 174 |
+
dataset:
|
| 175 |
+
type: mteb/toxic_conversations_50k
|
| 176 |
+
name: MTEB ToxicConversationsClassification
|
| 177 |
+
config: default
|
| 178 |
+
split: test
|
| 179 |
+
revision: edfaf9da55d3dd50d43143d90c1ac476895ae6de
|
| 180 |
+
metrics:
|
| 181 |
+
- type: accuracy
|
| 182 |
+
value: 66.6912
|
| 183 |
+
- type: ap
|
| 184 |
+
value: 12.157396278930436
|
| 185 |
+
- type: f1
|
| 186 |
+
value: 51.00574525406295
|
| 187 |
+
- task:
|
| 188 |
+
type: Classification
|
| 189 |
+
dataset:
|
| 190 |
+
type: mteb/tweet_sentiment_extraction
|
| 191 |
+
name: MTEB TweetSentimentExtractionClassification
|
| 192 |
+
config: default
|
| 193 |
+
split: test
|
| 194 |
+
revision: d604517c81ca91fe16a244d1248fc021f9ecee7a
|
| 195 |
+
metrics:
|
| 196 |
+
- type: accuracy
|
| 197 |
+
value: 59.29258630447085
|
| 198 |
+
- type: f1
|
| 199 |
+
value: 59.6485358241374
|
| 200 |
+
---
|
| 201 |
---
|
| 202 |
+
# gte-micro
|
| 203 |
|
| 204 |
+
This is a distill of [gte-tiny](https://huggingface.co/TaylorAI/gte-tiny).
|
| 205 |
|
| 206 |
+
## Intended purpose
|
| 207 |
|
| 208 |
+
<span style="color:blue">This model is designed for use in semantic-autocomplete ([click here for demo](https://mihaiii.github.io/semantic-autocomplete/)).</span>
|
| 209 |
|
| 210 |
+
## Usage (Sentence-Transformers) (same as [gte-tiny](https://huggingface.co/TaylorAI/gte-tiny))
|
| 211 |
|
| 212 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
| 213 |
|
|
|
|
| 221 |
from sentence_transformers import SentenceTransformer
|
| 222 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 223 |
|
| 224 |
+
model = SentenceTransformer('Mihaiii/gte-micro-v3')
|
| 225 |
embeddings = model.encode(sentences)
|
| 226 |
print(embeddings)
|
| 227 |
```
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
+
## Usage (HuggingFace Transformers) (same as [gte-tiny](https://huggingface.co/TaylorAI/gte-tiny))
|
| 232 |
Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
|
| 233 |
|
| 234 |
```python
|
|
|
|
| 247 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
| 248 |
|
| 249 |
# Load model from HuggingFace Hub
|
| 250 |
+
tokenizer = AutoTokenizer.from_pretrained('Mihaiii/gte-micro-v3')
|
| 251 |
+
model = AutoModel.from_pretrained('Mihaiii/gte-micro-v3')
|
| 252 |
|
| 253 |
# Tokenize sentences
|
| 254 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
|
| 264 |
print(sentence_embeddings)
|
| 265 |
```
|
| 266 |
|
| 267 |
+
### Limitation (same as [gte-small](https://huggingface.co/thenlper/gte-small))
|
| 268 |
+
This model exclusively caters to English texts, and any lengthy texts will be truncated to a maximum of 512 tokens.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|