Auto Upload
Browse files- 1_Pooling/config.json +7 -0
- README.md +82 -0
- config.json +26 -0
- config_sentence_transformers.json +7 -0
- lightning_logs/version_0/events.out.tfevents.1675760360.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 +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -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,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-MiniLM-L12-v2-embedding-all
|
21 |
+
|
22 |
+
This model is a fine-tuned version of [all-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L12-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-MiniLM-L12-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: 2E-05
|
49 |
+
- per device batch size: 60
|
50 |
+
- effective batch size: 120
|
51 |
+
- seed: 42
|
52 |
+
- optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
|
53 |
+
- weight decay: 1E-02
|
54 |
+
- number of epochs: 4
|
55 |
+
- mixed_precision_training: bf16
|
56 |
+
|
57 |
+
## Training results
|
58 |
+
| Epoch | Train Loss | Validation Loss |
|
59 |
+
| ----- | ---------- | --------------- |
|
60 |
+
| 0 | 0.0655 | 0.055 |
|
61 |
+
| 1 | 0.0549 | 0.051 |
|
62 |
+
| 2 | 0.049 | 0.0481 |
|
63 |
+
| 3 | 0.0451 | 0.0471 |
|
64 |
+
|
65 |
+
## Evaluation results
|
66 |
+
| Epoch | top_1 | top_3 | top_5 | top_10 | top_25 |
|
67 |
+
| ----- | ----- | ----- | ----- | ----- | ----- |
|
68 |
+
| 0 | 0.537 | 0.697 | 0.753 | 0.812 | 0.867 |
|
69 |
+
| 1 | 0.538 | 0.699 | 0.755 | 0.814 | 0.872 |
|
70 |
+
| 2 | 0.544 | 0.705 | 0.761 | 0.818 | 0.876 |
|
71 |
+
| 3 | 0.544 | 0.703 | 0.759 | 0.817 | 0.874 |
|
72 |
+
|
73 |
+
## Framework versions
|
74 |
+
- Transformers: 4.25.1
|
75 |
+
- PyTorch: 1.13.0+cu116
|
76 |
+
- PyTorch Lightning: 1.8.6
|
77 |
+
- Datasets: 2.7.1
|
78 |
+
- Tokenizers: 0.13.1
|
79 |
+
- Sentence Transformers: 2.2.2
|
80 |
+
|
81 |
+
## Additional Information
|
82 |
+
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,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/all-MiniLM-L12-v2",
|
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": 12,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.25.1",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
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": "1.13.0+cu116"
|
6 |
+
}
|
7 |
+
}
|
lightning_logs/version_0/events.out.tfevents.1675760360.ki-jupyternotebook-8bdd
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd739566f3ae781689313b4017f46e16bbe4bc2444849f041ffe6f142baf20c5
|
3 |
+
size 80502
|
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:1de12ff768dc3ddba42c82386efe6a53ac85658f890e5ff00ea64ac33462196c
|
3 |
+
size 133508397
|
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,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"do_basic_tokenize": true,
|
4 |
+
"do_lower_case": true,
|
5 |
+
"mask_token": "[MASK]",
|
6 |
+
"model_max_length": 512,
|
7 |
+
"name_or_path": "sentence-transformers/all-MiniLM-L12-v2",
|
8 |
+
"never_split": null,
|
9 |
+
"pad_token": "[PAD]",
|
10 |
+
"sep_token": "[SEP]",
|
11 |
+
"special_tokens_map_file": "/home/jovyan/_huggingface-shared/hub/models--sentence-transformers--all-MiniLM-L12-v2/snapshots/9e16800aed25dbd1a96dfa6949c68c4d81d5dded/special_tokens_map.json",
|
12 |
+
"strip_accents": null,
|
13 |
+
"tokenize_chinese_chars": true,
|
14 |
+
"tokenizer_class": "BertTokenizer",
|
15 |
+
"unk_token": "[UNK]"
|
16 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|