lrodrigues
commited on
Commit
路
2434d39
1
Parent(s):
93ae53b
upload
Browse files- .gitattributes +9 -8
- README.md +45 -0
- config.json +25 -0
- flax_model.msgpack +3 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +51 -0
- tokenizer_config.json +6 -0
- vocab.json +0 -0
.gitattributes
CHANGED
@@ -1,16 +1,17 @@
|
|
1 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
10 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
|
|
11 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
|
|
12 |
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
14 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
15 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
16 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
4 |
*.ftz filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
6 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
8 |
*.model filter=lfs diff=lfs merge=lfs -text
|
9 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
13 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
14 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
15 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
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 |
+
- roberta
|
9 |
+
- question-answering
|
10 |
+
---
|
11 |
+
# Roberta large model for QA (SQuAD 2.0)
|
12 |
+
|
13 |
+
This model uses [roberta-large](https://huggingface.co/roberta-large).
|
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 |
+
roberta_model = AutoModelForQuestionAnswering.from_pretrained('navteca/roberta-large-squad2')
|
27 |
+
roberta_tokenizer = AutoTokenizer.from_pretrained('navteca/roberta-large-squad2')
|
28 |
+
|
29 |
+
# Get predictions
|
30 |
+
nlp = pipeline('question-answering', model=roberta_model, tokenizer=roberta_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.96186668,
|
43 |
+
# "start": 27,
|
44 |
+
#}
|
45 |
+
```
|
config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"RobertaForQuestionAnswering"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"bos_token_id": 0,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 1024,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 4096,
|
14 |
+
"language": "english",
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 514,
|
17 |
+
"model_type": "roberta",
|
18 |
+
"name": "Roberta",
|
19 |
+
"num_attention_heads": 16,
|
20 |
+
"num_hidden_layers": 24,
|
21 |
+
"pad_token_id": 1,
|
22 |
+
"position_embedding_type": "absolute",
|
23 |
+
"type_vocab_size": 1,
|
24 |
+
"vocab_size": 50265
|
25 |
+
}
|
flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:17d19dd0f99103b4278204f0b76f680e8ae6be57586ead9c5e4291d1a553b0cd
|
3 |
+
size 1417262751
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f0a98cec67b9022abbcc667656745dd04a87e2c56d07d8f5175df22b09f90fc5
|
3 |
+
size 1417415991
|
special_tokens_map.json
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"single_word": false,
|
5 |
+
"lstrip": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"normalized": true
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"single_word": false,
|
12 |
+
"lstrip": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"normalized": true
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"single_word": false,
|
19 |
+
"lstrip": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"normalized": true
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "</s>",
|
25 |
+
"single_word": false,
|
26 |
+
"lstrip": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"normalized": true
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"single_word": false,
|
33 |
+
"lstrip": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"normalized": true
|
36 |
+
},
|
37 |
+
"cls_token": {
|
38 |
+
"content": "<s>",
|
39 |
+
"single_word": false,
|
40 |
+
"lstrip": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"normalized": true
|
43 |
+
},
|
44 |
+
"mask_token": {
|
45 |
+
"content": "<mask>",
|
46 |
+
"single_word": false,
|
47 |
+
"lstrip": true,
|
48 |
+
"rstrip": false,
|
49 |
+
"normalized": true
|
50 |
+
}
|
51 |
+
}
|
tokenizer_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_lower_case": false,
|
3 |
+
"full_tokenizer_file": null,
|
4 |
+
"model_max_length": 512,
|
5 |
+
"special_tokens_map_file": "special_tokens_map.json"
|
6 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|