Initial commit
#1
by
skirres
- opened
- 1_Pooling/config.json +7 -0
- README.md +105 -0
- config.json +23 -0
- modules.json +20 -0
- pytorch_model.bin +3 -0
- reduction_layer.bin +3 -0
- tokenizer.json +0 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"word_embedding_dimension": 512,
|
| 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,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- de
|
| 4 |
+
- en
|
| 5 |
+
- es
|
| 6 |
+
- fr
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Model Card for `vectorizer-v1-S-multilingual`
|
| 10 |
+
|
| 11 |
+
This model is a vectorizer developed by Sinequa. It produces an embedding vector given a passage or a query. The
|
| 12 |
+
passage vectors are stored in our vector index and the query vector is used at query time to look up relevant passages
|
| 13 |
+
in the index.
|
| 14 |
+
|
| 15 |
+
Model name: `vectorizer-v1-S-multilingual`
|
| 16 |
+
|
| 17 |
+
## Supported Languages
|
| 18 |
+
|
| 19 |
+
The model was trained and tested in the following languages:
|
| 20 |
+
|
| 21 |
+
- English
|
| 22 |
+
- French
|
| 23 |
+
- German
|
| 24 |
+
- Spanish
|
| 25 |
+
|
| 26 |
+
## Scores
|
| 27 |
+
|
| 28 |
+
| Metric | Value |
|
| 29 |
+
|:-----------------------|------:|
|
| 30 |
+
| Relevance (Recall@100) | 0.448 |
|
| 31 |
+
|
| 32 |
+
Note that the relevance score is computed as an average over 14 retrieval datasets (see
|
| 33 |
+
[details below](#evaluation-metrics)).
|
| 34 |
+
|
| 35 |
+
## Inference Times
|
| 36 |
+
|
| 37 |
+
| GPU | Batch size 1 (at query time) | Batch size 32 (at indexing) |
|
| 38 |
+
|:-----------|-----------------------------:|----------------------------:|
|
| 39 |
+
| NVIDIA A10 | 2 ms | 14 ms |
|
| 40 |
+
| NVIDIA T4 | 4 ms | 51 ms |
|
| 41 |
+
|
| 42 |
+
The inference times only measure the time the model takes to process a single batch, it does not include pre- or
|
| 43 |
+
post-processing steps like the tokenization.
|
| 44 |
+
|
| 45 |
+
## Requirements
|
| 46 |
+
|
| 47 |
+
- Minimal Sinequa version: 11.10.0
|
| 48 |
+
- GPU memory usage: 580 MiB
|
| 49 |
+
|
| 50 |
+
Note that GPU memory usage only includes how much GPU memory the actual model consumes on an NVIDIA T4 GPU with a batch
|
| 51 |
+
size of 32. It does not include the fix amount of memory that is consumed by the ONNX Runtime upon initialization which
|
| 52 |
+
can be around 0.5 to 1 GiB depending on the used GPU.
|
| 53 |
+
|
| 54 |
+
## Model Details
|
| 55 |
+
|
| 56 |
+
### Overview
|
| 57 |
+
|
| 58 |
+
- Number of parameters: 39 million
|
| 59 |
+
- Base language model: Homegrown Sinequa BERT-Small ([Paper](https://arxiv.org/abs/1908.08962)) pretrained in the four
|
| 60 |
+
supported languages
|
| 61 |
+
- Insensitive to casing and accents
|
| 62 |
+
- Training procedure: Query-passage pairs using in-batch negatives
|
| 63 |
+
|
| 64 |
+
### Training Data
|
| 65 |
+
|
| 66 |
+
- Natural Questions
|
| 67 |
+
([Paper](https://research.google/pubs/pub47761/),
|
| 68 |
+
[Official Page](https://github.com/google-research-datasets/natural-questions))
|
| 69 |
+
- Original English dataset
|
| 70 |
+
- Translated datasets for the other three supported languages
|
| 71 |
+
|
| 72 |
+
### Evaluation Metrics
|
| 73 |
+
|
| 74 |
+
To determine the relevance score, we averaged the results that we obtained when evaluating on the datasets of the
|
| 75 |
+
[BEIR benchmark](https://github.com/beir-cellar/beir). Note that all these datasets are in English.
|
| 76 |
+
|
| 77 |
+
| Dataset | Recall@100 |
|
| 78 |
+
|:------------------|-----------:|
|
| 79 |
+
| Average | 0.448 |
|
| 80 |
+
| | |
|
| 81 |
+
| Arguana | 0.835 |
|
| 82 |
+
| CLIMATE-FEVER | 0.350 |
|
| 83 |
+
| DBPedia Entity | 0.287 |
|
| 84 |
+
| FEVER | 0.645 |
|
| 85 |
+
| FiQA-2018 | 0.305 |
|
| 86 |
+
| HotpotQA | 0.396 |
|
| 87 |
+
| MS MARCO | 0.533 |
|
| 88 |
+
| NFCorpus | 0.162 |
|
| 89 |
+
| NQ | 0.701 |
|
| 90 |
+
| Quora | 0.947 |
|
| 91 |
+
| SCIDOCS | 0.194 |
|
| 92 |
+
| SciFact | 0.580 |
|
| 93 |
+
| TREC-COVID | 0.051 |
|
| 94 |
+
| Webis-Touche-2020 | 0.289 |
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
We evaluated the model on the datasets of the [MIRACL benchmark](https://github.com/project-miracl/miracl) to test its
|
| 98 |
+
multilingual capacities. Note that not all training languages are part of the benchmark, so we only report the metrics
|
| 99 |
+
for the existing languages.
|
| 100 |
+
|
| 101 |
+
| Language | Recall@100 |
|
| 102 |
+
|:---------|-----------:|
|
| 103 |
+
| French | N/A |
|
| 104 |
+
| German | N/A |
|
| 105 |
+
| Spanish | N/A |
|
config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"hidden_act": "gelu",
|
| 8 |
+
"hidden_dropout_prob": 0.1,
|
| 9 |
+
"hidden_size": 512,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 2048,
|
| 12 |
+
"layer_norm_eps": 1e-12,
|
| 13 |
+
"max_position_embeddings": 512,
|
| 14 |
+
"model_type": "bert",
|
| 15 |
+
"num_attention_heads": 8,
|
| 16 |
+
"num_hidden_layers": 4,
|
| 17 |
+
"pad_token_id": 0,
|
| 18 |
+
"position_embedding_type": "absolute",
|
| 19 |
+
"transformers_version": "4.22.2",
|
| 20 |
+
"type_vocab_size": 2,
|
| 21 |
+
"use_cache": true,
|
| 22 |
+
"vocab_size": 50099
|
| 23 |
+
}
|
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 |
+
]
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1005c255896b3a1bcfcc0ac37a25e4c4b51df0c2b8e5cfaac72b08b72ca9e3c
|
| 3 |
+
size 155174221
|
reduction_layer.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84d3da79f783f981db2e2ff48de325475d6f30d96dc53fcef2ef11f438444d3e
|
| 3 |
+
size 526247
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|