AI SeedbankHelp preserve open and free AI for humanity's future

← All models

aubmindlab_bert-base-arabertv02

aubmindlab · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


language: ar datasets:

  • wikipedia
  • Osian
  • 1.5B-Arabic-Corpus
  • oscar-arabic-unshuffled
  • Assafir-private widget:
  • text: ' عاصمة لبنان هي [MASK] .' pipeline_tag: fill-mask

AraBERT v1 & v2 : Pre-training BERT for Arabic Language Understanding

AraBERT is an Arabic pretrained language model based on Google's BERT architechture. AraBERT uses the same BERT-Base config. More details are available in the AraBERT Paper and in the AraBERT Meetup

There are two versions of the model, AraBERTv0.1 and AraBERTv1, with the difference being that AraBERTv1 uses pre-segmented text where prefixes and suffixes were split using the Farasa Segmenter.

We evaluate AraBERT models on different downstream tasks and compare them to mBERT, and other state of the art models (To the extent of our knowledge). The Tasks were Sentiment Analysis on 6 different datasets (HARD, ASTD-Balanced, ArsenTD-Lev, LABR), Named Entity Recognition with the ANERcorp, and Arabic Question Answering on Arabic-SQuAD and ARCD

AraBERTv2

What's New!

AraBERT now comes in 4 new variants to replace the old v1 versions:

More Detail in the AraBERT folder and in the README and in the AraBERT Paper

Model HuggingFace Model Name Size (MB/Params) Pre-Segmentation DataSet (Sentences/Size/nWords)
AraBERTv0.2-base bert-base-arabertv02 543MB / 136M No 200M / 77GB / 8.6B
AraBERTv0.2-large bert-large-arabertv02 1.38G 371M No 200M / 77GB / 8.6B
AraBERTv2-base bert-base-arabertv2 543MB 136M Yes 200M / 77GB / 8.6B
AraBERTv2-large bert-large-arabertv2 1.38G 371M Yes 200M / 77GB / 8.6B
AraBERTv0.2-Twitter-base bert-base-arabertv02-twitter 543MB / 136M No Same as v02 + 60M Multi-Dialect Tweets
AraBERTv0.2-Twitter-large bert-large-arabertv02-twitter 1.38G / 371M No Same as v02 + 60M Multi-Dialect Tweets
AraBERTv0.1-base bert-base-arabertv01 543MB 136M No 77M / 23GB / 2.7B
AraBERTv1-base bert-base-arabert 543MB 136M Yes 77M / 23GB / 2.7B

All models are available in the HuggingFace model page under the aubmindlab name. Checkpoints are available in PyTorch, TF2 and TF1 formats.

Better Pre-Processing and New Vocab

We identified an issue with AraBERTv1's wordpiece vocabulary. The issue came from punctuations and numbers that were still attached to words when learned the wordpiece vocab. We now insert a space between numbers and characters and around punctuation characters.

The new vocabulary was learned using the BertWordpieceTokenizer from the tokenizers library, and should now support the Fast tokenizer implementation from the transformers library.

P.S.: All the old BERT codes should work with the new BERT, just change the model name and check the new preprocessing function Please read the section on how to use the preprocessing function

Bigger Dataset and More Compute

We used ~3.5 times more data, and trained for longer. For Dataset Sources see the Dataset Section

Model Hardware num of examples with seq len (128 / 512) 128 (Batch Size/ Num of Steps) 512 (Batch Size/ Num of Steps) Total Steps Total Time (in Days)
AraBERTv0.2-base TPUv3-8 420M / 207M 2560 / 1M 384/ 2M 3M -
AraBERTv0.2-large TPUv3-128 420M / 207M 13440 / 250K 2056 / 300K 550K 7
AraBERTv2-base TPUv3-8 420M / 207M 2560 / 1M 384/ 2M 3M -
AraBERTv2-large TPUv3-128 520M / 245M 13440 / 250K 2056 / 300K 550K 7
AraBERT-base (v1/v0.1) TPUv2-8 - 512 / 900K 128 / 300K 1.2M 4

Dataset

The pretraining data used for the new AraBERT model is also used for Arabic GPT2 and ELECTRA.

The dataset consists of 77GB or 200,095,961 lines or 8,655,948,860 words or 82,232,988,358 chars (before applying Farasa Segmentation)

For the new dataset we added the unshuffled OSCAR corpus, after we thoroughly filter it, to the previous dataset used in AraBERTv1 but with out the websites that we previously crawled:

  • OSCAR unshuffled and filtered.
  • Arabic Wikipedia dump from 2020/09/01
  • The 1.5B words Arabic Corpus
  • The OSIAN Corpus
  • Assafir news articles. Huge thank you for Assafir for providing us the data

Preprocessing

It is recommended to apply our preprocessing function before training/testing on any dataset.

Install the arabert python package to segment text for AraBERT v1 & v2 or to clean your data pip install arabert

from arabert.preprocess import ArabertPreprocessor

model_name="aubmindlab/bert-large-arabertv02"
arabert_prep = ArabertPreprocessor(model_name=model_name)

text = "ولن نبالغ إذا قلنا: إن هاتف أو كمبيوتر المكتب في زمننا هذا ضروري"
arabert_prep.preprocess(text)

>>> output: ولن نبالغ إذا قلنا : إن هاتف أو كمبيوتر المكتب في زمننا هذا ضروري

TensorFlow 1.x models

The TF1.x model are available in the HuggingFace models repo. You can download them as follows:

  • via git-lfs: clone all the models in a repo
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
git clone https://huggingface.co/aubmindlab/MODEL_NAME
tar -C ./MODEL_NAME -zxvf /content/MODEL_NAME/tf1_model.tar.gz

where MODEL_NAME is any model under the aubmindlab name

  • via wget:
    • Go to the tf1_model.tar.gz file on huggingface.co/models/aubmindlab/MODEL_NAME.
    • copy the oid sha256
    • then run wget https://cdn-lfs.huggingface.co/aubmindlab/aragpt2-base/INSERT_THE_SHA_HERE (ex: for aragpt2-base: wget https://cdn-lfs.huggingface.co/aubmindlab/aragpt2-base/3766fc03d7c2593ff2fb991d275e96b81b0ecb2098b71ff315611d052ce65248)

If you used this model please cite us as :

Google Scholar has our Bibtex wrong (missing name), use this instead

@inproceedings{antoun2020arabert,
  title={AraBERT: Transformer-based Model for Arabic Language Understanding},
  author={Antoun, Wissam and Baly, Fady and Hajj, Hazem},
  booktitle={LREC 2020 Workshop Language Resources and Evaluation Conference 11--16 May 2020},
  pages={9}
}

Acknowledgments

Thanks to TensorFlow Research Cloud (TFRC) for the free access to Cloud TPUs, couldn't have done it without this program, and to the AUB MIND Lab Members for the continuous support. Also thanks to Yakshof and Assafir for data and storage access. Another thanks for Habib Rahal (https://www.behance.net/rahalhabib), for putting a face to AraBERT.

Contacts

Wissam Antoun: Linkedin | Twitter | Github | [email protected] | [email protected]

Fady Baly: Linkedin | Twitter | Github | [email protected] | [email protected]

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:83bd1eaf655edbf5ca9b2514efec2c4b72152d00&dn=aubmindlab_bert-base-arabertv02

Open magnet in torrent client · infohash 83bd1eaf655edbf5ca9b2514efec2c4b72152d00

Files & hashes

PathSizesha1sha256
README.md8.4 KB (8,625 B)289dd5d9b819551621b9d769b633e986852c8c3b97fe58fd1ddd1d63387a8bdbe710ff53e49c388164f6e9dffeb1a48923aabcb4
config.json384 B (384 B)f1e3dc71228ed6bbb5f5f10a395f0999d7f7f8b6206bb822488c75ff9449359b7841d3cfd0021082bdc18a5465f0fd37076c0914
model.safetensors518.3 MB (543,432,324 B)a8a1080f76137246691545443df593761b762b4f48873a2bb50cd5a481e9fbdb75ebff4717cb04496474b5a7c26f5377648d3141
pytorch_model.bin518.3 MB (543,490,667 B)6ac1c48f711b4c15e3b1c47bd64cb6d0cff0d5b7eac91bc3c317f3624abb5d562f5a49180a8aa991fdb21c57ce6a5e1266968be1
runs/eval/events.out.tfevents.1607681029.tpu-mother2.5 MB (2,649,933 B)3515565a4fc8f671ed934b1845c02fb45f857a3b7cd567fbe978c1ac779ec365fb4ad8a0f7b4eacc999b60459acc04e8bece5f8d
runs/eval/events.out.tfevents.1607686495.tpu-mother2.5 MB (2,652,817 B)09ce631d307d6f7d806f9adf250c85e114cff593affcfcd40bb2e1bf20c90a24b44d23a1e5b72fdaac440cb097e4661f2b9f1716
runs/eval/events.out.tfevents.1607688156.tpu-mother2.5 MB (2,649,933 B)9f0a836c71f115fb0cb44981ddc221a36b54f4a0dc1dbb0c0f223635c9dbf560e16e2b7596e2e410362f1c48366b15dd35a0a979
runs/eval_results.txt159 B (159 B)0eb3cd6a9d9637855dc087663b3fbbf99874145c6b47a90f38083a0b9e0b6db5a5a224730b9e5bf273811527e348f3e00d71d071
runs/events.out.tfevents.1605489565.tpu-mother17.3 MB (18,129,291 B)8335b54f9c1ce4a2c1af2a854d4d1841b6e6f043d3d6144db24bbb21161e9d84fc1e17e59cae5792e8cf6e22bade7c80aa5cdf6d
runs/events.out.tfevents.1605730291.tpu-mother17.3 MB (18,144,564 B)47fc00a9edb8869da4e15d6aba4151b7936703ad06a04aa1aa662aa46ec60f6be7e5bc13dfeebbf194decfa4335f7672f52ca464
runs/events.out.tfevents.1606636322.tpu-mother17.3 MB (18,126,338 B)d16e801460e9d06929c412ddd8d334a74b297dab240e55f19cf8d222efaf6f890101a396512ab37627a2ae40acb08523951cafc2
runs/events.out.tfevents.1606738342.tpu-mother3.9 MB (4,087,835 B)b69125f7f91f8293d845d372fef7dc51ccb0c6c5481d7808a1258291517d6b8b3501a31b2f0e2b84427c0a8415c92eb7bbed667d
runs/events.out.tfevents.1606738557.tpu-mother17.3 MB (18,148,752 B)326d16dc54328e9a5fbd616c2eeade6af26ac47eb2398ca5cab8075b4b673e3da48d57dd45761d538a7156a1abff71b9cf6b3d7a
runs/events.out.tfevents.1607448114.tpu-mother17.5 MB (18,343,427 B)391079b4ec4fb8025a1477185f0a4031181a8b7b34a40cda6e3fc93dfe64f808bed5e3b1d8c0cd214cd19abf5594ce3821a95906
runs/events.out.tfevents.1607698247.tpu-mother17.5 MB (18,363,976 B)f2f0f75aff666685dedf7c10097813874947a4008b56e2f1af0231f441b50be323e172d082b362893d1c1921555eac0ef71d0e54
runs/events.out.tfevents.1608595021.tpu-mother17.5 MB (18,337,805 B)613b2e627c5f219cf233393649c6a979702e843a9b6cda4421423a6fe3afb8ec63522b8aae4fd902c37a9c93735f238e2cafa862
special_tokens_map.json112 B (112 B)e7b0375001f109a6b8873d756ad4f7bbb15fbaa5303df45a03609e4ead04bc3dc1536d0ab19b5358db685b6f3da123d05ec200e3
tf1_model.tar.gz481.6 MB (504,967,460 B)aa316cd29bf681b583ddc00bf45cd3ee59b060b338d3200f86bb1934c7d2ebc844f3743f573482eebfc952e1da6a7c29f54f2426
tokenizer.json2.5 MB (2,642,362 B)5f483372e660f6b5a61ea9b4e9d1a362f3b5edbad9797bf02285035bba059782638b8c0aa130b7c2ca2d5dc2c30327586b3c773d
tokenizer_config.json381 B (381 B)c45ce30ca88d3279fd3b934538c311b57fa57ce30af25630cd2cda4efcb35c03172ef4a8f6067908d83f4194505f0c411b6cd3e4
vocab.txt805.5 KB (824,793 B)58bf95d7100dbdbbbf9c5d77664fba9bbd1f46d8ccf94b477c9f7fbea1c975ef1d2c4c72940bf07fcd5b75938f0fb922568a1b12

Cite this release

Canonical URL
https://aiseedbank.org/models/aubmindlab_bert-base-arabertv02/
Slug
aubmindlab_bert-base-arabertv02
Infohash
83bd1eaf655edbf5ca9b2514efec2c4b72152d00
License
no license recorded
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: aubmindlab_bert-base-arabertv02.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryaubmindlab/bert-base-arabertv02
Revision (pinned)016fb9d6768f522a59c6e0d2d5d5d43a4e1bff60
Fetched at2026-09-03T20:57:47Z
License at fetchno license recorded
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T20:58:08Z

no license recorded1.62 GB (1,735,001,938 bytes)transformerspytorchjaxtensorboardsafetensorsbertfill-maskendpoints_compatible2 languages (tf, ar)paper: 2003.00104