Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

BERTpt

from transformers import BertModel, BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained('joaomsimoes/bertpt-portuguese-portugal')
model = BertModel.from_pretrained("joaomsimoes/bertpt-portuguese-portugal")

text = "Tudo vale a pena quando a alma não é pequena."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

Pretrained model on Portuguese (Portugal) language using a masked language modeling (MLM) objective. Notebook

Training data

Scrapped data from diferent portugues websites, blogs and news channels. Around 2Gb of data.

Limitations and Bias

from transformers import pipeline
fill_mask= pipeline('fill-mask', model='joaomsimoes/bertpt-portuguese-portugal')

fill_mask("2020 foi um ano [MASK].")

[{'sequence': '[CLS] 2020 foi um ano dificil. [SEP]',
  'score': 0.146935	,
  'token': 7591,
  'token_str': 'dificil'},
 {'sequence': '[CLS] 2020 foi um ano historico. [SEP]',
  'score': 0.101181,
  'token': 9902,
  'token_str': 'historico'},
 {'sequence': '[CLS] 2020 foi um ano terrivel. [SEP]',
  'score': 0.080123,
  'token': 19675,
  'token_str': 'terrivel'},
 {'sequence': '[CLS] 2020 foi um ano especial. [SEP]',
  'score': 0.034216,
  'token': 6835,
  'token_str': 'especial'},
 {'sequence': '[CLS] 2020 foi um ano complicado. [SEP]',
  'score': 0.028791,
  'token': 12082,
  'token_str': 'complicado'}]

    
fill_mask("O FCPorto é melhor que o [MASK].")
  
[{'sequence': '[CLS] O FCPorto é melhor que o benfica. [SEP]',
  'score': 0.608609,
  'token': 7709,
  'token_str': 'benfica'},
 {'sequence': '[CLS] O FCPorto é melhor que o sporting. [SEP]',
  'score': 0.188474,
  'token': 7935,
  'token_str': 'sporting'},
 {'sequence': '[CLS] O FCPorto é melhor que o atletico. [SEP]',
  'score': 0.023601,
  'token': 16116,
  'token_str': 'atletico'},
 {'sequence': '[CLS] O FCPorto é melhor que o boavista. [SEP]',
  'score': 0.010015,
  'token': 16116,
  'token_str': 'boavista'},
 {'sequence': '[CLS] O FCPorto é melhor que o barcelona. [SEP]',
  'score': 0.009242,
  'token': 10609,
  'token_str': 'barcelona'}]

    
fill_mask("[MASK] é uma boa linguagem de programacao")
  
[{'sequence': '[CLS] python é uma boa linguagem de programacao [SEP]',
  'score': 0.155832,
  'token': 27384,
  'token_str': 'python'},
 {'sequence': '[CLS] java é uma boa linguagem de programacao [SEP]',
  'score': 0.152056,
  'token': 14348,
  'token_str': 'java'},
 {'sequence': '[CLS] programacao é uma boa linguagem de programacao [SEP]',
  'score': 0.106369,
  'token': 11304,
  'token_str': 'programacao'},
 {'sequence': '[CLS] isto é uma boa linguagem de programacao [SEP]',
  'score': 0.056731,
  'token': 6267,
  'token_str': 'isto'},
 {'sequence': '[CLS] linguagem é uma boa linguagem de programacao [SEP]',
  'score': 0.044161,
  'token': 13206,
  'token_str': 'linguagem'}]

    
fill_mask("Eu quero uma [MASK] melhor.")
  
[{'sequence': '[CLS] Eu quero uma vida melhor. [SEP]',
  'score': 0.138783,
  'token': 6503,
  'token_str': 'vida'},
 {'sequence': '[CLS] Eu quero uma experiencia melhor. [SEP]',
  'score': 0.083636,
  'token': 7479,
  'token_str': 'experiencia'},
 {'sequence': '[CLS] Eu quero uma internet melhor. [SEP]',
  'score': 0.059155,
  'token': 7051,
  'token_str': 'internet'},
 {'sequence': '[CLS] Eu quero uma coisa melhor. [SEP]',
  'score': 0.059155,
  'token': 6645,
  'token_str': 'coisa'},
 {'sequence': '[CLS] Eu quero uma plataforma melhor. [SEP]',
  'score': 0.044105,
  'token': 7834,
  'token_str': 'plataforma'}]
Downloads last month
3
Safetensors
Model size
66.6M params
Tensor type
I64
·
F32
·