LLukas22 commited on
Commit
4cb8b14
1 Parent(s): 30b37f0

Auto Upload

Browse files
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ---
12
+
13
+ # all-MiniLM-L12-v2-qa-en
14
+ This model is an extractive qa model.
15
+ 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).
16
+
17
+
18
+
19
+ ## Usage
20
+
21
+ You can use the model like this:
22
+
23
+ ```python
24
+ from transformers import pipeline
25
+
26
+ #Make predictions
27
+ model_name = "LLukas22/all-MiniLM-L12-v2-qa-en"
28
+ nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
29
+
30
+ QA_input = {
31
+ "question": "What's my name?",
32
+ "context": "My name is Clara and I live in Berkeley."
33
+ }
34
+
35
+ result = nlp(QA_input)
36
+ print(result)
37
+ ```
38
+ Alternatively you can load the model and tokenizer on their own:
39
+ ```python
40
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer
41
+
42
+ #Make predictions
43
+ model_name = "LLukas22/all-MiniLM-L12-v2-qa-en"
44
+ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
45
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
46
+ ```
47
+
48
+ ## Training hyperparameters
49
+ The following hyperparameters were used during training:
50
+
51
+ - learning_rate: 2E-05
52
+ - per device batch size: 60
53
+ - effective batch size: 180
54
+ - seed: 42
55
+ - optimizer: AdamW with betas (0.9,0.999) and eps 1E-08
56
+ - weight decay: 1E-02
57
+ - D-Adaptation: False
58
+ - Warmup: False
59
+ - number of epochs: 10
60
+ - mixed_precision_training: bf16
61
+
62
+ ## Training results
63
+ | Epoch | Train Loss | Validation Loss |
64
+ | ----- | ---------- | --------------- |
65
+ | 0 | 2.65 | 1.88 |
66
+
67
+ ## Evaluation results
68
+ | Epoch | f1 | exact_match |
69
+ | ----- | ----- | ----- |
70
+ | 0 | 0.507 | 0.378 |
71
+
72
+ ## Framework versions
73
+ - Transformers: 4.25.1
74
+ - PyTorch: 2.0.0+cu118
75
+ - PyTorch Lightning: 1.8.6
76
+ - Datasets: 2.7.1
77
+ - Tokenizers: 0.13.1
78
+ - Sentence Transformers: 2.2.2
79
+
80
+ ## Additional Information
81
+ 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.1679160176.ki-jupyternotebook-8bdd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81d23d9dcb6c8bd8618714221bbda5463b8b98ff401439641ba47f8dd84a791c
3
+ size 4514
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:d7e3896965203f1ca5372a264efb4970f86ff7e4d3254c15136c5455c1652fd8
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