Downloads · 30 days
18
2% of all-time downloads
castorini/azbert-base
azbert-base is a fill-mask model from castorini. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
Here we share a pretrained BERT model that is aware of math tokens. The math tokens are treated specially and tokenized using pya0, which adds very limited new tokens for latex markup (total vocabulary is just 31,061).
Downloads · 30 days
18
2% of all-time downloads
All-time downloads
780
Public
Repo size
938 MB
Likes
0
Public
Click a slice to open those files.
.bin442 MB · 89%
From the Hugging Face model README
Here we share a pretrained BERT model that is aware of math tokens. The math tokens are treated specially and tokenized using pya0, which adds very limited new tokens for latex markup (total vocabulary is just 31,061).
This model is trained on 4 x 2 Tesla V100 with a total batch size of 64, using Math StackExchange data with 2.7 million sentence pairs trained for 7 epochs.
Download and try it out
pip install pya0==0.3.2
wget https://vault.cs.uwaterloo.ca/s/gqstFZmWHCLGXe3/download -O ckpt.tar.gz
mkdir -p ckpt
tar xzf ckpt.tar.gz -C ckpt --strip-components=1
python test.py --test_file test.txt
Modify the test examples in test.txt to play with it.
The test file is tab-separated, the first column is additional positions you want to mask for the right-side sentence (useful for masking tokens in math markups). A zero means no additional mask positions.

This repo is hosted on Github, and only mirrored at huggingface.
To upload to huggingface, use the upload2hgf.sh script.
Before runnig this script, be sure to check:
./ckpt folderconfig.json and pytorch_model.binadded_tokens.json, special_tokens_map.json, tokenizer_config.json, vocab.txt and tokenizer.jsontokenizer_file field in tokenizer_config.json (sometimes it is located locally at ~/.cache)git-lfs is installedhgf reference to https://huggingface.co/castorini/azbert-base