SAVRN
Search Contact SAVRN

Open-weight model · Fill mask

bert-large-portuguese-cased

by NeuralMind Inteligência Artificial neuralmind/bert-large-portuguese-cased

BERTimbau Large is a pretrained BERT model for Brazilian Portuguese that achieves state-of-the-art performances on three downstream NLP tasks: Named Entity Recognition, Sentence Textual Similarity and Recognizing Textual Entailment.

Parameters
Context512
Weights2.7 GB
Licensemit
AccessOpen weights
Monthly Downloads1.5M

Model Card

By NeuralMind Inteligência Artificial, published under mit, revision aa302f6ea73b.

BERTimbau Large is a pretrained BERT model for Brazilian Portuguese that achieves state-of-the-art performances on three downstream NLP tasks: Named Entity Recognition, Sentence Textual Similarity and Recognizing Textual Entailment. It is available in two sizes: Base and Large. For further information or requests, please go to BERTimbau repository. If you use our work, please cite

Read NeuralMind Inteligência Artificial's full model card

BERTimbau Large (aka "bert-large-portuguese-cased")

Introduction

BERTimbau Large is a pretrained BERT model for Brazilian Portuguese that achieves state-of-the-art performances on three downstream NLP tasks: Named Entity Recognition, Sentence Textual Similarity and Recognizing Textual Entailment. It is available in two sizes: Base and Large.

For further information or requests, please go to BERTimbau repository.

Available models

Model Arch. #Layers #Params
neuralmind/bert-base-portuguese-cased BERT-Base 12 110M
neuralmind/bert-large-portuguese-cased BERT-Large 24 335M

Usage

from transformers import AutoTokenizer  # Or BertTokenizer
from transformers import AutoModelForPreTraining  # Or BertForPreTraining for loading pretraining heads
from transformers import AutoModel  # or BertModel, for BERT without pretraining heads

model = AutoModelForPreTraining.from_pretrained('neuralmind/bert-large-portuguese-cased')
tokenizer = AutoTokenizer.from_pretrained('neuralmind/bert-large-portuguese-cased', do_lower_case=False)

Masked language modeling prediction example

from transformers import pipeline

pipe = pipeline('fill-mask', model=model, tokenizer=tokenizer)

pipe('Tinha uma [MASK] no meio do caminho.')
# [{'score': 0.5054386258125305,
#   'sequence': '[CLS] Tinha uma pedra no meio do caminho. [SEP]',
#   'token': 5028,
#   'token_str': 'pedra'},
#  {'score': 0.05616172030568123,
#   'sequence': '[CLS] Tinha uma curva no meio do caminho. [SEP]',
#   'token': 9562,
#   'token_str': 'curva'},
#  {'score': 0.02348282001912594,
#   'sequence': '[CLS] Tinha uma parada no meio do caminho. [SEP]',
#   'token': 6655,
#   'token_str': 'parada'},
#  {'score': 0.01795753836631775,
#   'sequence': '[CLS] Tinha uma mulher no meio do caminho. [SEP]',
#   'token': 2606,
#   'token_str': 'mulher'},
#  {'score': 0.015246033668518066,
#   'sequence': '[CLS] Tinha uma luz no meio do caminho. [SEP]',
#   'token': 3377,
#   'token_str': 'luz'}]

For BERT embeddings


import torch

model = AutoModel.from_pretrained('neuralmind/bert-large-portuguese-cased')
input_ids = tokenizer.encode('Tinha uma pedra no meio do caminho.', return_tensors='pt')

with torch.no_grad():
    outs = model(input_ids)
    encoded = outs[0][0, 1:-1]  # Ignore [CLS] and [SEP] special tokens

# encoded.shape: (8, 1024)
# tensor([[ 1.1872,  0.5606, -0.2264,  ...,  0.0117, -0.1618, -0.2286],
#         [ 1.3562,  0.1026,  0.1732,  ..., -0.3855, -0.0832, -0.1052],
#         [ 0.2988,  0.2528,  0.4431,  ...,  0.2684, -0.5584,  0.6524],
#         ...,
#         [ 0.3405, -0.0140, -0.0748,  ...,  0.6649, -0.8983,  0.5802],
#         [ 0.1011,  0.8782,  0.1545,  ..., -0.1768, -0.8880, -0.1095],
#         [ 0.7912,  0.9637, -0.3859,  ...,  0.2050, -0.1350,  0.0432]])

Citation

If you use our work, please cite:

@inproceedings{souza2020bertimbau,
  author    = {F{\'a}bio Souza and
               Rodrigo Nogueira and
               Roberto Lotufo},
  title     = {{BERT}imbau: pretrained {BERT} models for {B}razilian {P}ortuguese},
  booktitle = {9th Brazilian Conference on Intelligent Systems, {BRACIS}, Rio Grande do Sul, Brazil, October 20-23 (to appear)},
  year      = {2020}
}

Configuration

Architecture
BertForMaskedLM
Context length (tokens)
512
Layers
24
Hidden size
1,024
Feed-forward size
4,096
Attention heads
16
Vocabulary size
29,794
Model type
bert

Identity and Version

Repository
neuralmind/bert-large-portuguese-cased
Publisher
NeuralMind Inteligência Artificial
Task
Fill mask
Modality
Text
Library
transformers
Parameters
Not stated by the source
Languages
pt
Revision
aa302f6ea73b759f7df9cad58bd272127b67ec28
First published
2022-03-02
Last updated
2021-05-20

Files and Weights

9 files, 2.7 GB in total. The weights are 2 files totalling 2.7 GB in bin, msgpack.

Weights2 files · 2.7 GB
Configuration3 files · 762 B
Tokenizer2 files · 209.7 KB
Documentation1 file · 3.6 KB
Repository1 file · 391 B
Every file
FileTypeSizeSHA-256
flax_model.msgpackWeights1.3 GB 9af4f60f0bdd
pytorch_model.binWeights1.3 GB 48f211712fda
added_tokens.jsonConfiguration2 B
config.jsonConfiguration648 B
special_tokens_map.jsonConfiguration112 B
README.mdDocumentation3.6 KB
.gitattributesRepository391 B
tokenizer_config.jsonTokenizer155 B
vocab.txtTokenizer209.5 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
2.7 GB
Download from NeuralMind Inteligência Artificial

Released by NeuralMind Inteligência Artificial through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) brWaC

Memory Requirements

PrecisionWeights in memory
As published2.7 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About bert-large-portuguese-cased

Can I use bert-large-portuguese-cased commercially?

Yes. bert-large-portuguese-cased is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is bert-large-portuguese-cased's context length?

512 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Fill mask

mdeberta-v3-base

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. mDeBERTa is multilingual version of DeBERTa which use the same structure as DeBERTa and was…

Open weights mit 512 tokens transformers

Model · Fill mask

deberta-v3-base

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. The DeBERTa V3 base model comes with 12 layers and a hidden size of 768. It has only 86M…

Open weights mit 512 tokens transformers

Model · Fill mask

Bio_ClinicalBERT

Emily Alsentzer

The Publicly Available Clinical BERT Embeddings paper contains four unique clinicalBERT models: initialized with BERT-Base (casedL-12H-768A-12) or BioBERT (BioBERT-Base v1.0 + PubMed 200K + PMC 270K) & trained on either all MIMIC notes or only discharge summaries. This model card describes the Bio+Clinical BERT model, which was initialized from BioBERT & trained on all MIMIC notes. The BioClinicalBERT model was trained on all notes from MIMIC III, a database containing electronic health records from ICU patients at the Beth Israel Hospital in Boston, MA. For more details on MIMIC, see here. All notes from the NOTEEVENTS table were included (~880M words). Each note in MIMIC was first split…

Open weights mit 512 tokens transformers

This model was previously named "PubMedBERT (abstracts)". You can either adopt the new model name "microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract" or update your transformers library to version 4.22+ if you need to refer to the old name. Pretraining large neural language models, such as BERT, has led to impressive gains on many natural language processing (NLP) tasks. However, most pretraining efforts focus on general domain corpora, such as newswire and Web. A prevailing assumption is that even domain-specific pretraining can benefit by starting from general-domain language models. Recent work shows that for domains with abundant unlabeled text, such as biomedicine, pretraining…

Open weights mit 512 tokens transformers

Model · Fill mask

deberta-v3-large

Microsoft

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. The DeBERTa V3 large model comes with 24 layers and a hidden size of 1024. It has 304M…

Open weights mit 512 tokens transformers

UmBERTo is a Roberta-based Language Model trained on large Italian Corpora and uses two innovative approaches: SentencePiece and Whole Word Masking. Now available at github.com/huggingface/transformers Marco Lodola, Monument to Umberto Eco, Alessandria 2019 UmBERTo-Commoncrawl-Cased utilizes the Italian subcorpus of OSCAR as training set of the language model. We used deduplicated version of the Italian corpus that consists in 70 GB of plain text data, 210M sentences with 11B words where the sentences have been filtered and shuffled at line level in order to be used for NLP research. This model was trained with SentencePiece and Whole Word Masking. These results refers to…

Open weights 514 tokens transformers