Upload 12 files
Browse files- .gitattributes +1 -1
- .gitignore +3 -0
- README.md +105 -1
- config.json +29 -0
- config_sentence_transformers.json +7 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +15 -0
- tokenizer.json +3 -0
- tokenizer_config.json +20 -0
.gitattributes
CHANGED
@@ -25,7 +25,6 @@
|
|
25 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
@@ -33,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
25 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
|
|
28 |
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
*.wasm filter=lfs diff=lfs merge=lfs -text
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
checkpoints/
|
2 |
+
checkpoint-*/
|
3 |
+
runs/
|
README.md
CHANGED
@@ -1 +1,105 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
pipeline_tag: sentence-similarity
|
4 |
+
tags:
|
5 |
+
- sentence-transformers
|
6 |
+
- feature-extraction
|
7 |
+
- sentence-similarity
|
8 |
+
- transformers
|
9 |
+
- generated_from_trainer
|
10 |
+
datasets:
|
11 |
+
- squad
|
12 |
+
- newsqa
|
13 |
+
- LLukas22/cqadupstack
|
14 |
+
- LLukas22/fiqa
|
15 |
+
- LLukas22/scidocs
|
16 |
+
- deepset/germanquad
|
17 |
+
- LLukas22/nq
|
18 |
+
language:
|
19 |
+
- en
|
20 |
+
- de
|
21 |
+
---
|
22 |
+
|
23 |
+
# paraphrase-multilingual-mpnet-base-v2-embedding-all
|
24 |
+
|
25 |
+
This model is a fine-tuned version of [paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2) on the following datasets: [squad](https://huggingface.co/datasets/squad), [newsqa](https://huggingface.co/datasets/newsqa), [LLukas22/cqadupstack](https://huggingface.co/datasets/LLukas22/cqadupstack), [LLukas22/fiqa](https://huggingface.co/datasets/LLukas22/fiqa), [LLukas22/scidocs](https://huggingface.co/datasets/LLukas22/scidocs), [deepset/germanquad](https://huggingface.co/datasets/deepset/germanquad), [LLukas22/nq](https://huggingface.co/datasets/LLukas22/nq).
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
## Usage (Sentence-Transformers)
|
30 |
+
|
31 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
32 |
+
|
33 |
+
```
|
34 |
+
pip install -U sentence-transformers
|
35 |
+
```
|
36 |
+
|
37 |
+
Then you can use the model like this:
|
38 |
+
|
39 |
+
```python
|
40 |
+
from sentence_transformers import SentenceTransformer
|
41 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
42 |
+
|
43 |
+
model = SentenceTransformer('LLukas22/paraphrase-multilingual-mpnet-base-v2-embedding-all')
|
44 |
+
embeddings = model.encode(sentences)
|
45 |
+
print(embeddings)
|
46 |
+
```
|
47 |
+
|
48 |
+
## Training hyperparameters
|
49 |
+
The following hyperparameters were used during training:
|
50 |
+
|
51 |
+
- learning_rate: 1E+00
|
52 |
+
- per device batch size: 40
|
53 |
+
- effective batch size: 120
|
54 |
+
- seed: 42
|
55 |
+
- optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
|
56 |
+
- weight decay: 2E-02
|
57 |
+
- D-Adaptation: True
|
58 |
+
- Warmup: True
|
59 |
+
- number of epochs: 15
|
60 |
+
- mixed_precision_training: bf16
|
61 |
+
|
62 |
+
## Training results
|
63 |
+
| Epoch | Train Loss | Validation Loss |
|
64 |
+
| ----- | ---------- | --------------- |
|
65 |
+
| 0 | 0.085 | 0.0625 |
|
66 |
+
| 1 | 0.0598 | 0.0554 |
|
67 |
+
| 2 | 0.0484 | 0.0518 |
|
68 |
+
| 3 | 0.0405 | 0.0485 |
|
69 |
+
| 4 | 0.0341 | 0.0463 |
|
70 |
+
| 5 | 0.0287 | 0.0454 |
|
71 |
+
| 6 | 0.0243 | 0.0445 |
|
72 |
+
| 7 | 0.0207 | 0.0426 |
|
73 |
+
| 8 | 0.0177 | 0.0424 |
|
74 |
+
| 9 | 0.0153 | 0.0421 |
|
75 |
+
| 10 | 0.0134 | 0.0417 |
|
76 |
+
| 11 | 0.012 | 0.0411 |
|
77 |
+
| 12 | 0.011 | 0.0414 |
|
78 |
+
|
79 |
+
## Evaluation results
|
80 |
+
| Epoch | top_1 | top_3 | top_5 | top_10 | top_25 |
|
81 |
+
| ----- | ----- | ----- | ----- | ----- | ----- |
|
82 |
+
| 0 | 0.261 | 0.351 | 0.384 | 0.422 | 0.459 |
|
83 |
+
| 1 | 0.272 | 0.365 | 0.4 | 0.439 | 0.477 |
|
84 |
+
| 2 | 0.276 | 0.37 | 0.404 | 0.443 | 0.481 |
|
85 |
+
| 3 | 0.292 | 0.391 | 0.426 | 0.465 | 0.503 |
|
86 |
+
| 4 | 0.295 | 0.395 | 0.431 | 0.47 | 0.51 |
|
87 |
+
| 5 | 0.299 | 0.4 | 0.437 | 0.476 | 0.514 |
|
88 |
+
| 6 | 0.306 | 0.404 | 0.44 | 0.478 | 0.515 |
|
89 |
+
| 7 | 0.309 | 0.41 | 0.445 | 0.485 | 0.521 |
|
90 |
+
| 8 | 0.31 | 0.411 | 0.448 | 0.487 | 0.524 |
|
91 |
+
| 9 | 0.315 | 0.417 | 0.454 | 0.493 | 0.529 |
|
92 |
+
| 10 | 0.319 | 0.42 | 0.457 | 0.495 | 0.53 |
|
93 |
+
| 11 | 0.323 | 0.424 | 0.46 | 0.497 | 0.531 |
|
94 |
+
| 12 | 0.324 | 0.427 | 0.464 | 0.501 | 0.536 |
|
95 |
+
|
96 |
+
## Framework versions
|
97 |
+
- Transformers: 4.25.1
|
98 |
+
- PyTorch: 2.0.0.dev20230210+cu118
|
99 |
+
- PyTorch Lightning: 1.8.6
|
100 |
+
- Datasets: 2.7.1
|
101 |
+
- Tokenizers: 0.13.1
|
102 |
+
- Sentence Transformers: 2.2.2
|
103 |
+
|
104 |
+
## Additional Information
|
105 |
+
This model was trained as part of my Master's Thesis **'Evaluation of transformer based language models for use in service information systems'**. The source code is available on [Github](https://github.com/LLukas22/Retrieval-Augmented-QA).
|
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
3 |
+
"architectures": [
|
4 |
+
"XLMRobertaModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"gradient_checkpointing": false,
|
11 |
+
"hidden_act": "gelu",
|
12 |
+
"hidden_dropout_prob": 0.1,
|
13 |
+
"hidden_size": 768,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 3072,
|
16 |
+
"layer_norm_eps": 1e-05,
|
17 |
+
"max_position_embeddings": 514,
|
18 |
+
"model_type": "xlm-roberta",
|
19 |
+
"num_attention_heads": 12,
|
20 |
+
"num_hidden_layers": 12,
|
21 |
+
"output_past": true,
|
22 |
+
"pad_token_id": 1,
|
23 |
+
"position_embedding_type": "absolute",
|
24 |
+
"torch_dtype": "float32",
|
25 |
+
"transformers_version": "4.25.1",
|
26 |
+
"type_vocab_size": 1,
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 250002
|
29 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "2.2.2",
|
4 |
+
"transformers": "4.25.1",
|
5 |
+
"pytorch": "2.0.0.dev20230210+cu118"
|
6 |
+
}
|
7 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:969ed0dc7232598c6317c19adb43b2487629965c75c94cdfb5200d141b67083d
|
3 |
+
size 556110788
|
modules.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 512,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
sentencepiece.bpe.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
3 |
+
size 5069051
|
special_tokens_map.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": {
|
6 |
+
"content": "<mask>",
|
7 |
+
"lstrip": true,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"pad_token": "<pad>",
|
13 |
+
"sep_token": "</s>",
|
14 |
+
"unk_token": "<unk>"
|
15 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b60b6b43406a48bf3638526314f3d232d97058bc93472ff2de930d43686fa441
|
3 |
+
size 17082913
|
tokenizer_config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": {
|
6 |
+
"__type": "AddedToken",
|
7 |
+
"content": "<mask>",
|
8 |
+
"lstrip": true,
|
9 |
+
"normalized": true,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false
|
12 |
+
},
|
13 |
+
"model_max_length": 512,
|
14 |
+
"name_or_path": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
15 |
+
"pad_token": "<pad>",
|
16 |
+
"sep_token": "</s>",
|
17 |
+
"special_tokens_map_file": null,
|
18 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
19 |
+
"unk_token": "<unk>"
|
20 |
+
}
|