File size: 1,041 Bytes
e76900e 1c5edc9 e76900e 75c3b4e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
---
language: pt
tags:
- portuguese
- brazil
- pt_BR
widget:
- text: Marte está no [MASK] solar.
---
``` python
from transformers import pipeline, AlbertTokenizer, AlbertForMaskedLM
model = AlbertForMaskedLM.from_pretrained('josu/albert-pt-br')
tokenizer = AlbertTokenizer.from_pretrained('josu/albert-pt-br')
unmasker = pipeline('fill-mask', model=model, tokenizer=tokenizer ,device=0)
text = 'Marte está no [MASK] solar.'
unmasker(text)
[{'score': 0.7004144191741943,
'token': 244,
'token_str': 'sistema',
'sequence': 'marte esta no sistema solar.'},
{'score': 0.02539917267858982,
'token': 4077,
'token_str': 'solar',
'sequence': 'marte esta no solar solar.'},
{'score': 0.020301498472690582,
'token': 49,
'token_str': 'seu',
'sequence': 'marte esta no seu solar.'},
{'score': 0.01753508299589157,
'token': 482,
'token_str': 'centro',
'sequence': 'marte esta no centro solar.'},
{'score': 0.013344300910830498,
'token': 1401,
'token_str': 'plano',
'sequence': 'marte esta no plano solar.'}]
``` |