{"url":"/method/macbert","slug":"macbert","name":"MacBERT","full_name":"MacBERT","full_name_withheld":false,"description_markdown":"**MacBERT** is a [Transformer](https://paperswithcode.com/methods/category/transformers)-based model for Chinese NLP that alters [RoBERTa](https://paperswithcode.com/method/roberta) in several ways, including a modified masking strategy. Instead of masking with [MASK] token, which never appears in the fine-tuning stage, MacBERT masks the word with its similar word. Specifically MacBERT shares the same pre-training tasks as [BERT](https://paperswithcode.com/method/bert) with several modifications. For the MLM task, the following modifications are performed:\r\n\r\n- Whole word masking is used as well as Ngram masking strategies for selecting candidate tokens for masking, with a percentage of\r\n40%, 30%, 20%, 10% for word-level unigram to 4-gram.\r\n- Instead of masking with [MASK] token, which never appears in the fine-tuning stage, similar words are used for the masking purpose. A similar word is obtained by using Synonyms toolkit which is based on word2vec similarity calculations. If an N-gram is selected to mask, we will find similar words individually. In rare cases, when there is no similar word, we will degrade to use random word replacement.\r\n- A percentage of 15% input words is used for masking, where 80% will replace with similar words, 10% replace with a random word, and keep with original words for the rest of 10%.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Revisiting Pre-Trained Models for Chinese Natural Language Processing","paper":"/paper/revisiting-pre-trained-models-for-chinese","first_author":"Yiming Cui","n_authors":6,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/revisiting-pre-trained-models-for-chinese"},"source":{"url":"https://arxiv.org/abs/2004.13922v2","title":"Revisiting Pre-Trained Models for Chinese Natural Language Processing","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"Natural Language Processing","area_id":"natural-language-processing","collection":"Autoencoding Transformers","url":"/methods/category/autoencoding-transformers","pwc_aliases":[]},{"area":"Natural Language Processing","area_id":"natural-language-processing","collection":"Transformers","url":"/methods/category/transformers","pwc_aliases":[]}],"n_papers_tagged":2,"archive_num_papers":2,"papers_newest_first":[{"paper":null,"title":"A Depression Detection Method Based on Multi-Modal Feature Fusion Using Cross-Attention","date":"2024-07-02","arxiv_id":"2407.12825","n_code_links":0,"syntology":null},{"paper":"/paper/revisiting-pre-trained-models-for-chinese","title":"Revisiting Pre-Trained Models for Chinese Natural Language Processing","date":"2020-04-29","arxiv_id":"2004.13922","n_code_links":6,"syntology":{"ran":9,"of":35,"unverified":26,"pointer_only":0}}],"papers_shown":2,"tasks":[{"task":"/task/depression-detection","name":"Depression Detection","papers":1},{"task":"/task/language-modeling","name":"Language Modeling","papers":1},{"task":"/task/language-modelling","name":"Language Modelling","papers":1},{"task":"/task/stock-market-prediction","name":"Stock Market Prediction","papers":1}],"tasks_shown":4,"n_tasks":4,"usage_by_year":[{"year":"2020","papers":1},{"year":"2024","papers":1}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/macbert"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}