Upload 15 files
Browse files- 1_Pooling/config.json +7 -0
- README.md +249 -0
- config.json +25 -0
- config_sentence_transformers.json +7 -0
- eval/mse_evaluation__results.csv +30 -0
- eval/similarity_evaluation_sts-dev_results.csv +30 -0
- model.onnx +3 -0
- model_quantized.onnx +3 -0
- modules.json +20 -0
- ort_config.json +38 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 384,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
5 |
+
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false
|
7 |
+
}
|
README.md
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: sentence-similarity
|
3 |
+
tags:
|
4 |
+
- sentence-transformers
|
5 |
+
- feature-extraction
|
6 |
+
- sentence-similarity
|
7 |
+
datasets:
|
8 |
+
- flax-sentence-embeddings/stackexchange_xml
|
9 |
+
- ms_marco
|
10 |
+
- gooaq
|
11 |
+
- yahoo_answers_topics
|
12 |
+
- search_qa
|
13 |
+
- eli5
|
14 |
+
- natural_questions
|
15 |
+
- trivia_qa
|
16 |
+
- embedding-data/QQP
|
17 |
+
- embedding-data/PAQ_pairs
|
18 |
+
- embedding-data/Amazon-QA
|
19 |
+
- embedding-data/WikiAnswers
|
20 |
+
---
|
21 |
+
|
22 |
+
# multi-qa-MiniLM-distill-onnx-L6-cos-v1
|
23 |
+
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and was designed for **semantic search**. It has been trained on 215M (question, answer) pairs from diverse sources. For an introduction to semantic search, have a look at: [SBERT.net - Semantic Search](https://www.sbert.net/examples/applications/semantic-search/README.html)
|
24 |
+
|
25 |
+
|
26 |
+
## Usage (Sentence-Transformers)
|
27 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
28 |
+
|
29 |
+
```
|
30 |
+
pip install -U sentence-transformers
|
31 |
+
```
|
32 |
+
|
33 |
+
Then you can use the model like this:
|
34 |
+
```python
|
35 |
+
from sentence_transformers import SentenceTransformer, util
|
36 |
+
|
37 |
+
query = "How many people live in London?"
|
38 |
+
docs = ["Around 9 Million people live in London", "London is known for its financial district"]
|
39 |
+
|
40 |
+
#Load the model
|
41 |
+
model = SentenceTransformer('sentence-transformers/multi-qa-MiniLM-L6-cos-v1')
|
42 |
+
|
43 |
+
#Encode query and documents
|
44 |
+
query_emb = model.encode(query)
|
45 |
+
doc_emb = model.encode(docs)
|
46 |
+
|
47 |
+
#Compute dot score between query and all document embeddings
|
48 |
+
scores = util.dot_score(query_emb, doc_emb)[0].cpu().tolist()
|
49 |
+
|
50 |
+
#Combine docs & scores
|
51 |
+
doc_score_pairs = list(zip(docs, scores))
|
52 |
+
|
53 |
+
#Sort by decreasing score
|
54 |
+
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)
|
55 |
+
|
56 |
+
#Output passages & scores
|
57 |
+
for doc, score in doc_score_pairs:
|
58 |
+
print(score, doc)
|
59 |
+
```
|
60 |
+
|
61 |
+
|
62 |
+
## PyTorch Usage (HuggingFace Transformers)
|
63 |
+
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 correct pooling-operation on-top of the contextualized word embeddings.
|
64 |
+
|
65 |
+
```python
|
66 |
+
from transformers import AutoTokenizer, AutoModel
|
67 |
+
import torch
|
68 |
+
import torch.nn.functional as F
|
69 |
+
|
70 |
+
#Mean Pooling - Take average of all tokens
|
71 |
+
def mean_pooling(model_output, attention_mask):
|
72 |
+
token_embeddings = model_output.last_hidden_state
|
73 |
+
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
|
74 |
+
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
|
75 |
+
|
76 |
+
|
77 |
+
#Encode text
|
78 |
+
def encode(texts):
|
79 |
+
# Tokenize sentences
|
80 |
+
encoded_input = tokenizer(texts, padding=True, truncation=True, return_tensors='pt')
|
81 |
+
|
82 |
+
# Compute token embeddings
|
83 |
+
with torch.no_grad():
|
84 |
+
model_output = model(**encoded_input, return_dict=True)
|
85 |
+
|
86 |
+
# Perform pooling
|
87 |
+
embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
|
88 |
+
|
89 |
+
# Normalize embeddings
|
90 |
+
embeddings = F.normalize(embeddings, p=2, dim=1)
|
91 |
+
|
92 |
+
return embeddings
|
93 |
+
|
94 |
+
|
95 |
+
# Sentences we want sentence embeddings for
|
96 |
+
query = "How many people live in London?"
|
97 |
+
docs = ["Around 9 Million people live in London", "London is known for its financial district"]
|
98 |
+
|
99 |
+
# Load model from HuggingFace Hub
|
100 |
+
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
|
101 |
+
model = AutoModel.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
|
102 |
+
|
103 |
+
#Encode query and docs
|
104 |
+
query_emb = encode(query)
|
105 |
+
doc_emb = encode(docs)
|
106 |
+
|
107 |
+
#Compute dot score between query and all document embeddings
|
108 |
+
scores = torch.mm(query_emb, doc_emb.transpose(0, 1))[0].cpu().tolist()
|
109 |
+
|
110 |
+
#Combine docs & scores
|
111 |
+
doc_score_pairs = list(zip(docs, scores))
|
112 |
+
|
113 |
+
#Sort by decreasing score
|
114 |
+
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)
|
115 |
+
|
116 |
+
#Output passages & scores
|
117 |
+
for doc, score in doc_score_pairs:
|
118 |
+
print(score, doc)
|
119 |
+
```
|
120 |
+
|
121 |
+
## TensorFlow Usage (HuggingFace Transformers)
|
122 |
+
Similarly to the PyTorch example above, to use the model with TensorFlow you pass your input through the transformer model, then you have to apply the correct pooling-operation on-top of the contextualized word embeddings.
|
123 |
+
|
124 |
+
```python
|
125 |
+
from transformers import AutoTokenizer, TFAutoModel
|
126 |
+
import tensorflow as tf
|
127 |
+
|
128 |
+
#Mean Pooling - Take attention mask into account for correct averaging
|
129 |
+
def mean_pooling(model_output, attention_mask):
|
130 |
+
token_embeddings = model_output.last_hidden_state
|
131 |
+
input_mask_expanded = tf.cast(tf.tile(tf.expand_dims(attention_mask, -1), [1, 1, token_embeddings.shape[-1]]), tf.float32)
|
132 |
+
return tf.math.reduce_sum(token_embeddings * input_mask_expanded, 1) / tf.math.maximum(tf.math.reduce_sum(input_mask_expanded, 1), 1e-9)
|
133 |
+
|
134 |
+
|
135 |
+
#Encode text
|
136 |
+
def encode(texts):
|
137 |
+
# Tokenize sentences
|
138 |
+
encoded_input = tokenizer(texts, padding=True, truncation=True, return_tensors='tf')
|
139 |
+
|
140 |
+
# Compute token embeddings
|
141 |
+
model_output = model(**encoded_input, return_dict=True)
|
142 |
+
|
143 |
+
# Perform pooling
|
144 |
+
embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
|
145 |
+
|
146 |
+
# Normalize embeddings
|
147 |
+
embeddings = tf.math.l2_normalize(embeddings, axis=1)
|
148 |
+
|
149 |
+
return embeddings
|
150 |
+
|
151 |
+
|
152 |
+
# Sentences we want sentence embeddings for
|
153 |
+
query = "How many people live in London?"
|
154 |
+
docs = ["Around 9 Million people live in London", "London is known for its financial district"]
|
155 |
+
|
156 |
+
# Load model from HuggingFace Hub
|
157 |
+
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
|
158 |
+
model = TFAutoModel.from_pretrained("sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
|
159 |
+
|
160 |
+
#Encode query and docs
|
161 |
+
query_emb = encode(query)
|
162 |
+
doc_emb = encode(docs)
|
163 |
+
|
164 |
+
#Compute dot score between query and all document embeddings
|
165 |
+
scores = (query_emb @ tf.transpose(doc_emb))[0].numpy().tolist()
|
166 |
+
|
167 |
+
#Combine docs & scores
|
168 |
+
doc_score_pairs = list(zip(docs, scores))
|
169 |
+
|
170 |
+
#Sort by decreasing score
|
171 |
+
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)
|
172 |
+
|
173 |
+
#Output passages & scores
|
174 |
+
for doc, score in doc_score_pairs:
|
175 |
+
print(score, doc)
|
176 |
+
```
|
177 |
+
|
178 |
+
## Technical Details
|
179 |
+
|
180 |
+
In the following some technical details how this model must be used:
|
181 |
+
|
182 |
+
| Setting | Value |
|
183 |
+
| --- | :---: |
|
184 |
+
| Dimensions | 384 |
|
185 |
+
| Produces normalized embeddings | Yes |
|
186 |
+
| Pooling-Method | Mean pooling |
|
187 |
+
| Suitable score functions | dot-product (`util.dot_score`), cosine-similarity (`util.cos_sim`), or euclidean distance |
|
188 |
+
|
189 |
+
Note: When loaded with `sentence-transformers`, this model produces normalized embeddings with length 1. In that case, dot-product and cosine-similarity are equivalent. dot-product is preferred as it is faster. Euclidean distance is proportional to dot-product and can also be used.
|
190 |
+
|
191 |
+
----
|
192 |
+
|
193 |
+
|
194 |
+
## Background
|
195 |
+
|
196 |
+
The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised
|
197 |
+
contrastive learning objective. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.
|
198 |
+
|
199 |
+
We developped this model during the
|
200 |
+
[Community week using JAX/Flax for NLP & CV](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104),
|
201 |
+
organized by Hugging Face. We developped this model as part of the project:
|
202 |
+
[Train the Best Sentence Embedding Model Ever with 1B Training Pairs](https://discuss.huggingface.co/t/train-the-best-sentence-embedding-model-ever-with-1b-training-pairs/7354). We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.
|
203 |
+
|
204 |
+
## Intended uses
|
205 |
+
|
206 |
+
Our model is intented to be used for semantic search: It encodes queries / questions and text paragraphs in a dense vector space. It finds relevant documents for the given passages.
|
207 |
+
|
208 |
+
Note that there is a limit of 512 word pieces: Text longer than that will be truncated. Further note that the model was just trained on input text up to 250 word pieces. It might not work well for longer text.
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
## Training procedure
|
213 |
+
|
214 |
+
The full training script is accessible in this current repository: `train_script.py`.
|
215 |
+
|
216 |
+
### Pre-training
|
217 |
+
|
218 |
+
We use the pretrained [`nreimers/MiniLM-L6-H384-uncased`](https://huggingface.co/nreimers/MiniLM-L6-H384-uncased) model. Please refer to the model card for more detailed information about the pre-training procedure.
|
219 |
+
|
220 |
+
#### Training
|
221 |
+
|
222 |
+
We use the concatenation from multiple datasets to fine-tune our model. In total we have about 215M (question, answer) pairs.
|
223 |
+
We sampled each dataset given a weighted probability which configuration is detailed in the `data_config.json` file.
|
224 |
+
|
225 |
+
The model was trained with [MultipleNegativesRankingLoss](https://www.sbert.net/docs/package_reference/losses.html#multiplenegativesrankingloss) using Mean-pooling, cosine-similarity as similarity function, and a scale of 20.
|
226 |
+
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
| Dataset | Number of training tuples |
|
231 |
+
|--------------------------------------------------------|:--------------------------:|
|
232 |
+
| [WikiAnswers](https://github.com/afader/oqa#wikianswers-corpus) Duplicate question pairs from WikiAnswers | 77,427,422 |
|
233 |
+
| [PAQ](https://github.com/facebookresearch/PAQ) Automatically generated (Question, Paragraph) pairs for each paragraph in Wikipedia | 64,371,441 |
|
234 |
+
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Body) pairs from all StackExchanges | 25,316,456 |
|
235 |
+
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Answer) pairs from all StackExchanges | 21,396,559 |
|
236 |
+
| [MS MARCO](https://microsoft.github.io/msmarco/) Triplets (query, answer, hard_negative) for 500k queries from Bing search engine | 17,579,773 |
|
237 |
+
| [GOOAQ: Open Question Answering with Diverse Answer Types](https://github.com/allenai/gooaq) (query, answer) pairs for 3M Google queries and Google featured snippet | 3,012,496 |
|
238 |
+
| [Amazon-QA](http://jmcauley.ucsd.edu/data/amazon/qa/) (Question, Answer) pairs from Amazon product pages | 2,448,839
|
239 |
+
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Answer) pairs from Yahoo Answers | 1,198,260 |
|
240 |
+
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Question, Answer) pairs from Yahoo Answers | 681,164 |
|
241 |
+
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Question) pairs from Yahoo Answers | 659,896 |
|
242 |
+
| [SearchQA](https://huggingface.co/datasets/search_qa) (Question, Answer) pairs for 140k questions, each with Top5 Google snippets on that question | 582,261 |
|
243 |
+
| [ELI5](https://huggingface.co/datasets/eli5) (Question, Answer) pairs from Reddit ELI5 (explainlikeimfive) | 325,475 |
|
244 |
+
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions pairs (titles) | 304,525 |
|
245 |
+
| [Quora Question Triplets](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs) (Question, Duplicate_Question, Hard_Negative) triplets for Quora Questions Pairs dataset | 103,663 |
|
246 |
+
| [Natural Questions (NQ)](https://ai.google.com/research/NaturalQuestions) (Question, Paragraph) pairs for 100k real Google queries with relevant Wikipedia paragraph | 100,231 |
|
247 |
+
| [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/) (Question, Paragraph) pairs from SQuAD2.0 dataset | 87,599 |
|
248 |
+
| [TriviaQA](https://huggingface.co/datasets/trivia_qa) (Question, Evidence) pairs | 73,346 |
|
249 |
+
| **Total** | **214,988,242** |
|
config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models/cos-v1-best",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 384,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 1536,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 4,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"transformers_version": "4.29.2",
|
22 |
+
"type_vocab_size": 2,
|
23 |
+
"use_cache": true,
|
24 |
+
"vocab_size": 30522
|
25 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "2.0.0",
|
4 |
+
"transformers": "4.6.1",
|
5 |
+
"pytorch": "1.8.1"
|
6 |
+
}
|
7 |
+
}
|
eval/mse_evaluation__results.csv
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,steps,MSE
|
2 |
+
0,5000,0.08164194878190756
|
3 |
+
0,10000,0.06260087830014527
|
4 |
+
0,15000,0.053438334725797176
|
5 |
+
0,20000,0.04801056638825685
|
6 |
+
0,25000,0.0445966434199363
|
7 |
+
0,30000,0.04211385385133326
|
8 |
+
0,35000,0.040131498826667666
|
9 |
+
0,40000,0.03866856568492949
|
10 |
+
0,45000,0.037445276393555105
|
11 |
+
0,50000,0.03652568848337978
|
12 |
+
0,55000,0.03562064084690064
|
13 |
+
0,60000,0.03487043140921742
|
14 |
+
0,65000,0.03426450421102345
|
15 |
+
0,70000,0.03378996916580945
|
16 |
+
0,75000,0.033300244831480086
|
17 |
+
0,80000,0.032820276101119816
|
18 |
+
0,85000,0.03252678434364498
|
19 |
+
0,90000,0.032118355738930404
|
20 |
+
0,95000,0.03190774004906416
|
21 |
+
0,100000,0.031571456929668784
|
22 |
+
0,105000,0.03135171136818826
|
23 |
+
0,110000,0.031201684032566845
|
24 |
+
0,115000,0.03108016971964389
|
25 |
+
0,120000,0.030856009107083082
|
26 |
+
0,125000,0.030771695310249925
|
27 |
+
0,130000,0.03066081553697586
|
28 |
+
0,135000,0.030605780193582177
|
29 |
+
0,140000,0.030567956855520606
|
30 |
+
0,-1,0.030567424255423248
|
eval/similarity_evaluation_sts-dev_results.csv
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,steps,cosine_pearson,cosine_spearman,euclidean_pearson,euclidean_spearman,manhattan_pearson,manhattan_spearman,dot_pearson,dot_spearman
|
2 |
+
0,5000,0.7451538219966819,0.7672554362824703,0.7663367711499433,0.7672554362824703,0.7656859380863119,0.7665947792435013,0.7451538231648414,0.7672554362824703
|
3 |
+
0,10000,0.7537744166831953,0.7727486754280707,0.7728111123629107,0.7727486754280707,0.772113563269406,0.7721335168433461,0.7537744171689775,0.7727495539481395
|
4 |
+
0,15000,0.7660933742804406,0.7837588700618559,0.7836123904512655,0.7837588700618559,0.7829209061843033,0.7830875130305814,0.7660933801320919,0.7837588693651809
|
5 |
+
0,20000,0.7684300833864042,0.7855982699077577,0.785532933626244,0.7855982692094479,0.7845338039609955,0.7845750033796356,0.7684300882853332,0.7855982699077577
|
6 |
+
0,25000,0.7707353950224363,0.7876847428779042,0.7876465143907596,0.7876847421777396,0.7867830462833947,0.7869706516377712,0.7707354006643212,0.7876847428779042
|
7 |
+
0,30000,0.77288987781661,0.7890679662524103,0.7890394555299924,0.7890679655510161,0.788137743070403,0.7882666447140309,0.7728898769077066,0.7890677146611634
|
8 |
+
0,35000,0.7714964043132171,0.7879360079865678,0.7881483073210547,0.7879371284726863,0.7872797682613883,0.7873248066864478,0.7714964114116738,0.7879371284726863
|
9 |
+
0,40000,0.7738038431607456,0.7900336982355982,0.7900015695492877,0.7900336975333457,0.789036404739011,0.7893954248514412,0.7738038443211506,0.7900336982355982
|
10 |
+
0,45000,0.7806805368603946,0.7953170748402448,0.7953952611135355,0.7953170748402448,0.794482786961417,0.7946208003390048,0.7806805365188378,0.795316296004493
|
11 |
+
0,50000,0.7758800035273927,0.7920287779042389,0.7917483214037102,0.792028777200213,0.7907080715200523,0.791222195497074,0.7758800064681861,0.7920287779042389
|
12 |
+
0,55000,0.7748974633837462,0.7907568393040405,0.7905916308754704,0.7907568386011451,0.7897169211995143,0.7899495391123526,0.7748974644641963,0.7907568393040405
|
13 |
+
0,60000,0.7784748672436804,0.7939635781718496,0.793964252540622,0.7939635774661037,0.7929685054517607,0.7930615590508188,0.7784748678309645,0.7939635774661037
|
14 |
+
0,65000,0.7796288427258389,0.7951236643816901,0.7950697460353463,0.7951236636749132,0.7942962171276358,0.7945430404989343,0.7796288448617663,0.7951236643816901
|
15 |
+
0,70000,0.7796424798426436,0.7952969563162274,0.7948492536277543,0.7952969556092964,0.7939768644705751,0.7944538553840851,0.7796424862799302,0.7952978166371057
|
16 |
+
0,75000,0.7769598727458167,0.7927814277048575,0.7922166093080583,0.7927823631288534,0.7915981847762255,0.7921869463483725,0.7769598789365952,0.7927814277048575
|
17 |
+
0,80000,0.7774742857996642,0.7934620778257588,0.7931720059341743,0.7934620771204588,0.792433728896597,0.7927788061869001,0.7774742937530655,0.7934620778257588
|
18 |
+
0,85000,0.7778284283777634,0.7933801275912681,0.7931055150588028,0.793380126886041,0.7923659661509699,0.7928011869852436,0.7778284197659264,0.7933805724314327
|
19 |
+
0,90000,0.7778190920123474,0.7932520598872288,0.7927980747236021,0.7932520591821155,0.7919765295341479,0.7923518432591761,0.7778190862553716,0.7932520591821155
|
20 |
+
0,95000,0.7795342361348376,0.7951428547863926,0.7947477485866722,0.7951428540795986,0.793933820785105,0.794293699396111,0.7795342378034608,0.7951415618979867
|
21 |
+
0,100000,0.7811558920026177,0.7964721083727638,0.7959974871261926,0.7964721083727638,0.7953036438517008,0.7956409736399953,0.7811558906487714,0.7964721083727638
|
22 |
+
0,105000,0.7789333814592223,0.7941989626759279,0.7937732318420716,0.7941989619699729,0.793105607100401,0.7936110345184971,0.7789333777991321,0.7941989626759279
|
23 |
+
0,110000,0.7790156686608669,0.7944607101875235,0.7939863009721635,0.7944607094813357,0.7932901632304183,0.7937474314096579,0.7790156623433281,0.7944607094813357
|
24 |
+
0,115000,0.7773604697868309,0.7928823123011013,0.7925392387219641,0.7928823123011013,0.7918524555529456,0.7924313931360675,0.7773604674828332,0.7928823115963166
|
25 |
+
0,120000,0.7797444066117021,0.7954454544567308,0.7948229695790241,0.7954453169215147,0.7941276931152423,0.7945565785810856,0.779744398705051,0.7954454537496678
|
26 |
+
0,125000,0.7794772857230747,0.7950229169812024,0.79449104446514,0.7950229169812024,0.7937674344847226,0.79436565603504,0.7794772873884481,0.7950229169812024
|
27 |
+
0,130000,0.7802911181903579,0.7956809903890825,0.7951756431049894,0.7956809903890825,0.794476798728313,0.7950676316078248,0.7802911189881387,0.7956809903890825
|
28 |
+
0,135000,0.7798078498424627,0.7951594686768616,0.7947034191959423,0.7951594679700529,0.7939996232677503,0.7945372807084875,0.7798078491935548,0.7951594686768616
|
29 |
+
0,140000,0.7795179285289633,0.7949521909537459,0.7944688530241,0.7949521902471214,0.7937473834870582,0.7943429424962535,0.7795179357332032,0.7949521902471214
|
30 |
+
0,-1,0.7795472646980206,0.7949874080599001,0.7944970293639978,0.7949874073532442,0.7937810593147978,0.7944118411202525,0.7795472601861694,0.7949874080599001
|
model.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:897920e276fe3222f214b4b4e2c57cd0165b0e999d0d0b67e086ac5eac58522f
|
3 |
+
size 76059578
|
model_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:46453e4d5c32d5b0691bc353a62c60186f1db5dca3e89ff36b6e007519b8334a
|
3 |
+
size 19161868
|
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 |
+
]
|
ort_config.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"one_external_file": true,
|
3 |
+
"opset": null,
|
4 |
+
"optimization": {
|
5 |
+
"disable_attention": null,
|
6 |
+
"disable_attention_fusion": false,
|
7 |
+
"disable_bias_gelu": null,
|
8 |
+
"disable_bias_gelu_fusion": false,
|
9 |
+
"disable_bias_skip_layer_norm": null,
|
10 |
+
"disable_bias_skip_layer_norm_fusion": false,
|
11 |
+
"disable_embed_layer_norm": true,
|
12 |
+
"disable_embed_layer_norm_fusion": true,
|
13 |
+
"disable_gelu": null,
|
14 |
+
"disable_gelu_fusion": false,
|
15 |
+
"disable_group_norm_fusion": true,
|
16 |
+
"disable_layer_norm": null,
|
17 |
+
"disable_layer_norm_fusion": false,
|
18 |
+
"disable_packed_kv": true,
|
19 |
+
"disable_shape_inference": false,
|
20 |
+
"disable_skip_layer_norm": null,
|
21 |
+
"disable_skip_layer_norm_fusion": false,
|
22 |
+
"enable_gelu_approximation": true,
|
23 |
+
"enable_gemm_fast_gelu_fusion": false,
|
24 |
+
"enable_transformers_specific_optimizations": true,
|
25 |
+
"fp16": false,
|
26 |
+
"no_attention_mask": false,
|
27 |
+
"optimization_level": 2,
|
28 |
+
"optimize_for_gpu": false,
|
29 |
+
"optimize_with_onnxruntime_only": null,
|
30 |
+
"use_mask_index": false,
|
31 |
+
"use_multi_head_attention": false,
|
32 |
+
"use_raw_attention_mask": false
|
33 |
+
},
|
34 |
+
"optimum_version": "1.8.7.dev0",
|
35 |
+
"quantization": {},
|
36 |
+
"transformers_version": "4.29.2",
|
37 |
+
"use_external_data_format": false
|
38 |
+
}
|
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,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"clean_up_tokenization_spaces": true,
|
3 |
+
"cls_token": "[CLS]",
|
4 |
+
"do_basic_tokenize": true,
|
5 |
+
"do_lower_case": true,
|
6 |
+
"mask_token": "[MASK]",
|
7 |
+
"model_max_length": 512,
|
8 |
+
"never_split": null,
|
9 |
+
"pad_token": "[PAD]",
|
10 |
+
"sep_token": "[SEP]",
|
11 |
+
"strip_accents": null,
|
12 |
+
"tokenize_chinese_chars": true,
|
13 |
+
"tokenizer_class": "BertTokenizer",
|
14 |
+
"unk_token": "[UNK]"
|
15 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|