lrodrigues commited on
Commit
1983e4c
1 Parent(s): ee59871
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - squad_v2
4
+ language: en
5
+ license: mit
6
+ pipeline_tag: question-answering
7
+ tags:
8
+ - electra
9
+ - question-answering
10
+ ---
11
+ # Electra base model for QA (SQuAD 2.0)
12
+
13
+ This model uses [electra-base](https://huggingface.co/google/electra-base-discriminator).
14
+
15
+ ## Training Data
16
+ The models have been trained on the [SQuAD 2.0](https://rajpurkar.github.io/SQuAD-explorer/) dataset.
17
+
18
+ It can be used for question answering task.
19
+
20
+ ## Usage and Performance
21
+ The trained model can be used like this:
22
+ ```python
23
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
24
+
25
+ # Load model & tokenizer
26
+ electra_model = AutoModelForQuestionAnswering.from_pretrained('navteca/electra-base-squad2')
27
+ electra_tokenizer = AutoTokenizer.from_pretrained('navteca/electra-base-squad2')
28
+
29
+ # Get predictions
30
+ nlp = pipeline('question-answering', model=electra_model, tokenizer=electra_tokenizer)
31
+
32
+ result = nlp({
33
+ 'question': 'How many people live in Berlin?',
34
+ 'context': 'Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.'
35
+ })
36
+
37
+ print(result)
38
+
39
+ #{
40
+ # "answer": "3,520,031"
41
+ # "end": 36,
42
+ # "score": 0.99983448,
43
+ # "start": 27,
44
+ #}
45
+ ```
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ElectraForQuestionAnswering"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "embedding_size": 768,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 768,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 3072,
12
+ "language": "english",
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "electra",
16
+ "name": "Electra",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "summary_activation": "gelu",
21
+ "summary_last_dropout": 0,
22
+ "summary_type": "first",
23
+ "summary_use_proj": true,
24
+ "type_vocab_size": 2,
25
+ "vocab_size": 30522
26
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33abdbab680c8bae8707320df17c5d4fba5969adb465e81029905fa0284d3d3e
3
+ size 435618605
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_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_basic_tokenize": true,
3
+ "do_lower_case": true,
4
+ "model_max_length": 512,
5
+ "never_split": null,
6
+ "special_tokens_map_file": "special_tokens_map.json",
7
+ "strip_accents": null,
8
+ "tokenize_chinese_chars": true
9
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff