LLukas22 commited on
Commit
4a39e47
1 Parent(s): c0c7eee

Auto Upload

Browse files
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ pipeline_tag: question-answering
4
+ tags:
5
+ - question-answering
6
+ - transformers
7
+ - generated_from_trainer
8
+ datasets:
9
+ - squad_v2
10
+ - LLukas22/nq-simplified
11
+ - LLukas22/NLQuAD
12
+ - deepset/germanquad
13
+ ---
14
+
15
+ # all-MiniLM-L12-v2-qa-all
16
+ This model is an extractive qa model.
17
+ It's a fine-tuned version of [all-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L12-v2) on the following datasets: [squad_v2](https://huggingface.co/datasets/squad_v2), [LLukas22/nq-simplified](https://huggingface.co/datasets/LLukas22/nq-simplified), [LLukas22/NLQuAD](https://huggingface.co/datasets/LLukas22/NLQuAD), [deepset/germanquad](https://huggingface.co/datasets/deepset/germanquad).
18
+
19
+
20
+
21
+ ## Usage
22
+
23
+ You can use the model like this:
24
+
25
+ ```python
26
+ from transformers import pipeline
27
+
28
+ #Make predictions
29
+ model_name = "LLukas22/all-MiniLM-L12-v2-qa-all"
30
+ nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
31
+
32
+ QA_input = {
33
+ "question": "What's my name?",
34
+ "context": "My name is Clara and I live in Berkeley."
35
+ }
36
+
37
+ result = nlp(QA_input)
38
+ print(result)
39
+ ```
40
+ Alternatively you can load the model and tokenizer on their own:
41
+ ```python
42
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer
43
+
44
+ #Make predictions
45
+ model_name = "LLukas22/all-MiniLM-L12-v2-qa-all"
46
+ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
47
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
48
+ ```
49
+
50
+ ## Training hyperparameters
51
+ The following hyperparameters were used during training:
52
+
53
+ - learning_rate: 2E-05
54
+ - per device batch size: 60
55
+ - effective batch size: 180
56
+ - seed: 42
57
+ - optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
58
+ - weight decay: 1E-02
59
+ - D-Adaptation: False
60
+ - Warmup: True
61
+ - number of epochs: 15
62
+ - mixed_precision_training: bf16
63
+
64
+ ## Training results
65
+ | Epoch | Train Loss | Validation Loss |
66
+ | ----- | ---------- | --------------- |
67
+ | 0 | 3.58 | 2.91 |
68
+
69
+ ## Evaluation results
70
+ | Epoch | f1 | exact_match |
71
+ | ----- | ----- | ----- |
72
+ | 0 | 0.309 | 0.255 |
73
+
74
+ ## Framework versions
75
+ - Transformers: 4.25.1
76
+ - PyTorch: 2.0.0.dev20230210+cu118
77
+ - PyTorch Lightning: 1.8.6
78
+ - Datasets: 2.7.1
79
+ - Tokenizers: 0.13.1
80
+ - Sentence Transformers: 2.2.2
81
+
82
+ ## Additional Information
83
+ 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
+ "BertForQuestionAnswering"
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
+ }
lightning_logs/version_0/events.out.tfevents.1678982684.ki-jupyternotebook-8bdd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c6f09fdca5357682372064d6a90c1021e64037f1f5b68b1b41e8338faa3e8a3
3
+ size 5074
lightning_logs/version_0/hparams.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b040037df83aece6875a8258215ee9c06ef16969c4031d17b0d49f01a69bbfd
3
+ size 132923885
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