microsoft / codebert-base-mlm

huggingface.co
Total runs: 57.4K
24-hour runs: 47.9K
7-day runs: 49.6K
30-day runs: 54.2K
Model's Last Updated: 1월 09 2023
fill-mask

Introduction of codebert-base-mlm

Model Details of codebert-base-mlm

CodeBERT-base-mlm

Pretrained weights for CodeBERT: A Pre-Trained Model for Programming and Natural Languages .

Training Data

The model is trained on the code corpus of CodeSearchNet

Training Objective

This model is initialized with Roberta-base and trained with a simple MLM (Masked Language Model) objective.

Usage
from transformers import RobertaTokenizer, RobertaForMaskedLM, pipeline

model = RobertaForMaskedLM.from_pretrained('microsoft/codebert-base-mlm')
tokenizer = RobertaTokenizer.from_pretrained('microsoft/codebert-base-mlm')

code_example = "if (x is not None) <mask> (x>1)"
fill_mask = pipeline('fill-mask', model=model, tokenizer=tokenizer)

outputs = fill_mask(code_example)
print(outputs)

Expected results:

{'sequence': '<s> if (x is not None) and (x>1)</s>', 'score': 0.6049249172210693, 'token': 8}
{'sequence': '<s> if (x is not None) or (x>1)</s>', 'score': 0.30680200457572937, 'token': 50}
{'sequence': '<s> if (x is not None) if (x>1)</s>', 'score': 0.02133703976869583, 'token': 114}
{'sequence': '<s> if (x is not None) then (x>1)</s>', 'score': 0.018607674166560173, 'token': 172}
{'sequence': '<s> if (x is not None) AND (x>1)</s>', 'score': 0.007619690150022507, 'token': 4248}
Reference
  1. Bimodal CodeBERT trained with MLM+RTD objective (suitable for code search and document generation)
  2. 🤗 Hugging Face's CodeBERTa (small size, 6 layers)
Citation
@misc{feng2020codebert,
    title={CodeBERT: A Pre-Trained Model for Programming and Natural Languages},
    author={Zhangyin Feng and Daya Guo and Duyu Tang and Nan Duan and Xiaocheng Feng and Ming Gong and Linjun Shou and Bing Qin and Ting Liu and Daxin Jiang and Ming Zhou},
    year={2020},
    eprint={2002.08155},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

Runs of microsoft codebert-base-mlm on huggingface.co

57.4K
Total runs
47.9K
24-hour runs
49.4K
3-day runs
49.6K
7-day runs
54.2K
30-day runs

More Information About codebert-base-mlm huggingface.co Model

codebert-base-mlm huggingface.co

codebert-base-mlm huggingface.co is an AI model on huggingface.co that provides codebert-base-mlm's model effect (), which can be used instantly with this microsoft codebert-base-mlm model. huggingface.co supports a free trial of the codebert-base-mlm model, and also provides paid use of the codebert-base-mlm. Support call codebert-base-mlm model through api, including Node.js, Python, http.

codebert-base-mlm huggingface.co Url

https://huggingface.co/microsoft/codebert-base-mlm

microsoft codebert-base-mlm online free

codebert-base-mlm huggingface.co is an online trial and call api platform, which integrates codebert-base-mlm's modeling effects, including api services, and provides a free online trial of codebert-base-mlm, you can try codebert-base-mlm online for free by clicking the link below.

microsoft codebert-base-mlm online free url in huggingface.co:

https://huggingface.co/microsoft/codebert-base-mlm

codebert-base-mlm install

codebert-base-mlm is an open source model from GitHub that offers a free installation service, and any user can find codebert-base-mlm on GitHub to install. At the same time, huggingface.co provides the effect of codebert-base-mlm install, users can directly use codebert-base-mlm installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

codebert-base-mlm install url in huggingface.co:

https://huggingface.co/microsoft/codebert-base-mlm

Url of codebert-base-mlm

codebert-base-mlm huggingface.co Url

Provider of codebert-base-mlm huggingface.co

microsoft
ORGANIZATIONS

Other API from microsoft

huggingface.co

Total runs: 681.1K
Run Growth: 208.0K
Growth Rate: 30.53%
Updated:2월 03 2022
huggingface.co

Total runs: 595.8K
Run Growth: -131.1K
Growth Rate: -22.00%
Updated:11월 25 2025
huggingface.co

Total runs: 535.6K
Run Growth: 307.0K
Growth Rate: 57.32%
Updated:4월 08 2024
huggingface.co

Total runs: 511.8K
Run Growth: -531.5K
Growth Rate: -103.84%
Updated:12월 08 2025
huggingface.co

Total runs: 390.1K
Run Growth: -119.3K
Growth Rate: -30.59%
Updated:9월 26 2022
huggingface.co

Total runs: 289.1K
Run Growth: -22.3K
Growth Rate: -7.70%
Updated:2월 14 2024
huggingface.co

Total runs: 131.8K
Run Growth: 11.4K
Growth Rate: 8.63%
Updated:5월 12 2026
huggingface.co

Total runs: 117.8K
Run Growth: -147.4K
Growth Rate: -125.12%
Updated:11월 08 2023
huggingface.co

Total runs: 117.6K
Run Growth: -1.2K
Growth Rate: -1.03%
Updated:2월 29 2024
huggingface.co

Total runs: 103.1K
Run Growth: -5.1K
Growth Rate: -4.98%
Updated:2월 03 2023
huggingface.co

Total runs: 100.0K
Run Growth: -425
Growth Rate: -0.42%
Updated:8월 28 2025
huggingface.co

Total runs: 69.7K
Run Growth: -13.1K
Growth Rate: -18.74%
Updated:11월 25 2025
huggingface.co

Total runs: 68.7K
Run Growth: -18.2K
Growth Rate: -26.47%
Updated:12월 03 2025
huggingface.co

Total runs: 52.0K
Run Growth: 26.0K
Growth Rate: 50.00%
Updated:12월 23 2021
huggingface.co

Total runs: 32.5K
Run Growth: 28.2K
Growth Rate: 86.85%
Updated:4월 23 2026
huggingface.co

Total runs: 32.4K
Run Growth: 13.8K
Growth Rate: 42.64%
Updated:4월 24 2023