Auto Upload
Browse files- 1_Pooling/config.json +9 -0
- README.md +104 -0
- config.json +24 -0
- config_sentence_transformers.json +7 -0
- lightning_logs/version_0/events.out.tfevents.1677148612.ki-jupyternotebook-8bdd +3 -0
- lightning_logs/version_0/hparams.yaml +1 -0
- modules.json +14 -0
- pytorch_model.bin +3 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +15 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 768,
|
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 |
+
"pooling_mode_weightedmean_tokens": false,
|
8 |
+
"pooling_mode_lasttoken": false
|
9 |
+
}
|
README.md
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-4.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 |
+
---
|
19 |
+
|
20 |
+
# all-mpnet-base-v2-embedding-all
|
21 |
+
|
22 |
+
This model is a fine-tuned version of [all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-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).
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
## Usage (Sentence-Transformers)
|
27 |
+
|
28 |
+
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
29 |
+
|
30 |
+
```
|
31 |
+
pip install -U sentence-transformers
|
32 |
+
```
|
33 |
+
|
34 |
+
Then you can use the model like this:
|
35 |
+
|
36 |
+
```python
|
37 |
+
from sentence_transformers import SentenceTransformer
|
38 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
39 |
+
|
40 |
+
model = SentenceTransformer('LLukas22/all-mpnet-base-v2-embedding-all')
|
41 |
+
embeddings = model.encode(sentences)
|
42 |
+
print(embeddings)
|
43 |
+
```
|
44 |
+
|
45 |
+
## Training hyperparameters
|
46 |
+
The following hyperparameters were used during training:
|
47 |
+
|
48 |
+
- learning_rate: 1E+00
|
49 |
+
- per device batch size: 60
|
50 |
+
- effective batch size: 180
|
51 |
+
- seed: 42
|
52 |
+
- optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
|
53 |
+
- weight decay: 2E-02
|
54 |
+
- D-Adaptation: True
|
55 |
+
- Warmup: True
|
56 |
+
- number of epochs: 15
|
57 |
+
- mixed_precision_training: bf16
|
58 |
+
|
59 |
+
## Training results
|
60 |
+
| Epoch | Train Loss | Validation Loss |
|
61 |
+
| ----- | ---------- | --------------- |
|
62 |
+
| 0 | 0.0554 | 0.047 |
|
63 |
+
| 1 | 0.044 | 0.0472 |
|
64 |
+
| 2 | 0.0374 | 0.0425 |
|
65 |
+
| 3 | 0.0322 | 0.041 |
|
66 |
+
| 4 | 0.0278 | 0.0403 |
|
67 |
+
| 5 | 0.0246 | 0.0389 |
|
68 |
+
| 6 | 0.0215 | 0.0389 |
|
69 |
+
| 7 | 0.0192 | 0.0388 |
|
70 |
+
| 8 | 0.017 | 0.0379 |
|
71 |
+
| 9 | 0.0154 | 0.0375 |
|
72 |
+
| 10 | 0.0142 | 0.0381 |
|
73 |
+
| 11 | 0.0132 | 0.0372 |
|
74 |
+
| 12 | 0.0126 | 0.0377 |
|
75 |
+
| 13 | 0.012 | 0.0377 |
|
76 |
+
|
77 |
+
## Evaluation results
|
78 |
+
| Epoch | top_1 | top_3 | top_5 | top_10 | top_25 |
|
79 |
+
| ----- | ----- | ----- | ----- | ----- | ----- |
|
80 |
+
| 0 | 0.373 | 0.476 | 0.509 | 0.544 | 0.573 |
|
81 |
+
| 1 | 0.362 | 0.466 | 0.501 | 0.537 | 0.568 |
|
82 |
+
| 2 | 0.371 | 0.476 | 0.511 | 0.546 | 0.576 |
|
83 |
+
| 3 | 0.369 | 0.473 | 0.506 | 0.54 | 0.569 |
|
84 |
+
| 4 | 0.373 | 0.478 | 0.512 | 0.547 | 0.578 |
|
85 |
+
| 5 | 0.378 | 0.483 | 0.517 | 0.552 | 0.58 |
|
86 |
+
| 6 | 0.371 | 0.475 | 0.509 | 0.543 | 0.571 |
|
87 |
+
| 7 | 0.379 | 0.484 | 0.517 | 0.55 | 0.578 |
|
88 |
+
| 8 | 0.378 | 0.482 | 0.515 | 0.548 | 0.575 |
|
89 |
+
| 9 | 0.383 | 0.489 | 0.523 | 0.556 | 0.584 |
|
90 |
+
| 10 | 0.38 | 0.483 | 0.517 | 0.549 | 0.575 |
|
91 |
+
| 11 | 0.38 | 0.485 | 0.518 | 0.551 | 0.577 |
|
92 |
+
| 12 | 0.383 | 0.489 | 0.522 | 0.556 | 0.582 |
|
93 |
+
| 13 | 0.385 | 0.49 | 0.523 | 0.555 | 0.581 |
|
94 |
+
|
95 |
+
## Framework versions
|
96 |
+
- Transformers: 4.25.1
|
97 |
+
- PyTorch: 2.0.0.dev20230210+cu118
|
98 |
+
- PyTorch Lightning: 1.8.6
|
99 |
+
- Datasets: 2.7.1
|
100 |
+
- Tokenizers: 0.13.1
|
101 |
+
- Sentence Transformers: 2.2.2
|
102 |
+
|
103 |
+
## Additional Information
|
104 |
+
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/Master).
|
config.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/all-mpnet-base-v2",
|
3 |
+
"architectures": [
|
4 |
+
"MPNetModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-05,
|
15 |
+
"max_position_embeddings": 514,
|
16 |
+
"model_type": "mpnet",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 12,
|
19 |
+
"pad_token_id": 1,
|
20 |
+
"relative_attention_num_buckets": 32,
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.25.1",
|
23 |
+
"vocab_size": 30527
|
24 |
+
}
|
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 |
+
}
|
lightning_logs/version_0/events.out.tfevents.1677148612.ki-jupyternotebook-8bdd
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bae5a492a4bfb454cf9371f3e68e79ef678ad04d0a175e2ce3fadc20ee5cbfb1
|
3 |
+
size 196449
|
lightning_logs/version_0/hparams.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{}
|
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 |
+
]
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:36689697fe81a5cb626de7913433a4963683ea309b605f92a57f0e14de3b42cf
|
3 |
+
size 438013677
|
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,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
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"do_lower_case": true,
|
5 |
+
"eos_token": "</s>",
|
6 |
+
"mask_token": "<mask>",
|
7 |
+
"model_max_length": 512,
|
8 |
+
"name_or_path": "sentence-transformers/all-mpnet-base-v2",
|
9 |
+
"pad_token": "<pad>",
|
10 |
+
"sep_token": "</s>",
|
11 |
+
"special_tokens_map_file": null,
|
12 |
+
"strip_accents": null,
|
13 |
+
"tokenize_chinese_chars": true,
|
14 |
+
"tokenizer_class": "MPNetTokenizer",
|
15 |
+
"unk_token": "[UNK]"
|
16 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|