Downloads · 30 days
11
6% of all-time downloads
zeromodels/bert_large_uncased
bert_large_uncased is a fill-mask model from zeromodels. Use it when you need the model to fill a missing word. It is set up for zeromodels. The card lists the license as apache-2.0.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/bert/) [](https://huggingface.co/collections/zeromodels/bert-6a8eae4f9ce86ca44e03bcc5)
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
199
Public
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.h51.5 GB · 100%
From the Hugging Face model README
Paper: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (arXiv:1810.04805) · HF Papers
BERT is Google's bidirectional transformer text encoder, pretrained with masked LM and next-sentence prediction. WordPiece tokenizer; mask token [MASK]. Uncased variants lower-case the input; cased variants preserve case.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of google-bert/bert-large-uncased for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a fill-mask / encoder checkpoint (BertMaskedLM, large uncased). Task heads (sequence/token classify, QA, NSP, …) load via hf: fine-tunes.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.bert import BertMaskedLM, BertTokenizer
mlm = BertMaskedLM.from_weights("zeromodels/bert_large_uncased")
tokenizer = BertTokenizer.from_weights("zeromodels/bert_large_uncased")
inputs = tokenizer("the capital of france is [MASK].")
logits = mlm(inputs) # (1, L, vocab_size)
mask = int((inputs["input_ids"][0] == tokenizer.mask_token_id).argmax())
print(tokenizer.ids_to_tokens[int(logits[0, mask].argmax())])
Load any BERT variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub | Casing |
|---|---|---|
bert_base_uncased | zeromodels/bert_base_uncased | uncased |
bert_large_uncased | zeromodels/bert_large_uncased | uncased |
bert_base_cased | zeromodels/bert_base_cased | cased |
bert_large_cased | zeromodels/bert_large_cased | cased |
Load any of these from this repo with from_weights("zeromodels/bert_large_uncased") (or on the fly via the hf: prefix). The pretrained backbone is shared; task heads not stored in this checkpoint start randomly initialized, ready for fine-tuning (or load a hf: fine-tune).
| Class | Task |
|---|---|
BertModel | Encoder backbone |
BertMaskedLM | Masked language modeling (fill-mask) |
BertSequenceClassify | Sequence classification |
BertTokenClassify | Token classification (NER / POS) |
BertNextSentencePredict | Next-sentence prediction |
BertQnA | Extractive question answering |
BertMultipleChoice | Multiple choice |
from zeromodels.models.bert import BertSequenceClassify
model = BertSequenceClassify.from_weights("zeromodels/bert_large_uncased")
KERAS_BACKEND before importing Keras / zeromodels.BertTokenizer.from_weights(...) so WordPiece casing matches.[MASK] (not <mask>).hf: prefix, e.g. BertMaskedLM.from_weights("hf:google-bert/bert-large-uncased").A huge thank you to the Google BERT authors for creating and releasing these models.
License: Apache 2.0.