Commit
•
afe6ad5
1
Parent(s):
0d8f5f3
create readme.md
Browse files
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: pt
|
3 |
+
thumbnail: null
|
4 |
+
tags:
|
5 |
+
- question-answering
|
6 |
+
- bert
|
7 |
+
widget:
|
8 |
+
- text: Qual é a área de Portugal?
|
9 |
+
context: >-
|
10 |
+
Portugal, oficialmente República Portuguesa,[7][h] é um país soberano[i]
|
11 |
+
unitário localizado no sudoeste da Europa, cujo território se situa na zona
|
12 |
+
ocidental da Península Ibérica e em arquipélagos no Atlântico Norte. O
|
13 |
+
território português tem uma área total de 92 090 km²,[8] sendo delimitado a
|
14 |
+
norte e leste por Espanha e a sul e oeste pelo oceano Atlântico,
|
15 |
+
compreendendo uma parte continental e duas regiões autónomas: os
|
16 |
+
arquipélagos dos Açores e da Madeira. Portugal é a nação mais a ocidente do
|
17 |
+
continente europeu. O nome do país provém da sua segunda maior cidade,
|
18 |
+
Porto, cujo nome latino-celta era Portus Cale
|
19 |
+
---
|
20 |
+
|
21 |
+
## MODEL DESCRIPTION
|
22 |
+
|
23 |
+
Portugal BERT base model (cased) fine-tuned on SQuAD v1 Portugal version.
|
24 |
+
|
25 |
+
## Model in action
|
26 |
+
|
27 |
+
- Fast usage with pipelines:
|
28 |
+
|
29 |
+
```python
|
30 |
+
from transformers import pipeline
|
31 |
+
qa_pipeline = pipeline(
|
32 |
+
"question-answering",
|
33 |
+
model="isel-nlp-mp05/bert-base-portuguese-cased-finetuned-squadv1-pt",
|
34 |
+
tokenizer="isel-nlp-mp05/bert-base-portuguese-cased-finetuned-squadv1-pt"
|
35 |
+
)
|
36 |
+
predictions = qa_pipeline({
|
37 |
+
'context': "Chamo-me Mattheo e estou a estudar em Lisboa.",
|
38 |
+
'question': "Onde é que o Mattheo está a estudar?"
|
39 |
+
})
|
40 |
+
print(predictions)
|
41 |
+
# output:
|
42 |
+
# {'score': 0.967152, 'start': 38, 'end': 44, 'answer': 'Lisboa'}
|
43 |
+
```
|