Papers › Spelling Error Correction with Soft-Masked BERT

Spelling Error Correction with Soft-Masked BERT

15 May 2020ACL 2020 6arXiv:2005.07421archive 2025-07-28

Shaohua Zhang, Haoran Huang, Jicong Liu, Hang Li

Spelling error correction is an important yet challenging task because a satisfactory solution of it essentially needs human-level language understanding ability. Without loss of generality we consider Chinese spelling error correction (CSC) in this paper. A state-of-the-art method for the task selects a character from a list of candidates for correction (including non-correction) at each position of the sentence on the basis of BERT, the language representation model. The accuracy of the method can be sub-optimal, however, because BERT does not have sufficient capability to detect whether there is an error at each position, apparently due to the way of pre-training it using mask language modeling. In this work, we propose a novel neural architecture to address the aforementioned issue, which consists of a network for error detection and a network for error correction based on BERT, with the former being connected to the latter with what we call soft-masking technique. Our method of using `Soft-Masked BERT' is general, and it may be employed in other language detection-correction problems. Experimental results on two datasets demonstrate that the performance of our proposed method is significantly better than the baselines including the one solely based on BERT.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2005.07421")

Code

Syntology Ran 5 of 17 code samples harvested from 5 repositories linked to this paper; 12 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 4 ran with no contract checked.

By repository: community (archive-listed): 17 samples from 5 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

gitabtion/BertBasedCorrectionModels mentioned on GitHubpytorchApache-2.0 report
hiyoung123/SoftMaskedBert mentioned on GitHubpytorch report
lemon234071/TransformerBaselines mentioned on GitHubpytorch report
mszpc/SoftMaskedBert mindsporeApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 5 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
4ran
12unverified

Licence: 3 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BiGRU nocoolsandwich/pinyin_gen_error_sentence/model/soft_masked_bert.py community (archive-listed) ran fingerprinted no licence file found · pointer only · a728cf7fd8651ddf · report
BiGRU lemon234071/TransformerBaselines/agents/bert/soft_masked_bert/soft_masked_bert.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 3e404afd004bb929 · report
SoftMaskedBert nocoolsandwich/pinyin_gen_error_sentence/model/soft_masked_bert.py community (archive-listed) ran no licence file found · pointer only · b722732fc955e68c · report
SoftMaskedBert hiyoung123/SoftMaskedBert/model/soft_masked_bert.py community (archive-listed) ran no licence file found · pointer only · 3f71761e83e0177e · report
make_optimizer gitabtion/BertBasedCorrectionModels/bbcm/solver/build.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 3c707eafb83ce730 · report
SoftMaskedBert lemon234071/TransformerBaselines/agents/bert/soft_masked_bert/soft_masked_bert.py community (archive-listed) unverified Apache-2.0 (permissive) · 0d5cdc01abffb5cb · report
compute_correction_prf mszpc/SoftMaskedBert/softmaskedbert/src/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · c06aca58c0b60862 · report
compute_corrector_prf gitabtion/BertBasedCorrectionModels/bbcm/utils/evaluations.py community (archive-listed) unverified Apache-2.0 (permissive) · 98cd0539309793ca · report
compute_corrector_prf mszpc/SoftMaskedBert/softmaskedbert/src/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 8b028660c9e94b5c · report
compute_detection_prf mszpc/SoftMaskedBert/softmaskedbert/src/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · ac8790d05ecb703c · report
compute_sentence_level_prf gitabtion/BertBasedCorrectionModels/bbcm/utils/evaluations.py community (archive-listed) unverified Apache-2.0 (permissive) · b088e76916ad21f3 · report
dump_json gitabtion/BertBasedCorrectionModels/bbcm/utils/file_io.py community (archive-listed) unverified Apache-2.0 (permissive) · 712509715b4485d4 · report
dump_json mszpc/SoftMaskedBert/softmaskedbert/preprocess_dataset.py community (archive-listed) unverified Apache-2.0 (permissive) · 40e10fdbe38a163f · report
get_cache_dir gitabtion/BertBasedCorrectionModels/bbcm/utils/file_io.py community (archive-listed) unverified Apache-2.0 (permissive) · 9f0e70bc9b57f335 · report
load_json gitabtion/BertBasedCorrectionModels/bbcm/utils/file_io.py community (archive-listed) unverified Apache-2.0 (permissive) · fa2946b9355af8b5 · report
proc_test_set mszpc/SoftMaskedBert/softmaskedbert/preprocess_dataset.py community (archive-listed) unverified Apache-2.0 (permissive) · c3ba3217b15fd141 · report
report_prf gitabtion/BertBasedCorrectionModels/bbcm/utils/evaluations.py community (archive-listed) unverified Apache-2.0 (permissive) · 704deca2af268bca · report

Tasks

Chinese Spelling Error CorrectionLanguage ModelingLanguage ModellingSentence

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections