class_docstr: Task for training Masked LM (BERT) model.
  Args:
      dictionary (Dictionary): the dictionary for the input of the task
class_docstr_tok: ["Task","for","training","Masked","LM","(","BERT",")","model",".","Args",":","dictionary","(","Dictionary",")",":","the","dictionary","for","the","input","of","the","task"]
code: def build_dictionary(
      cls,
      filenames,
      workers=1,
      threshold=-1,
      nwords=-1,
      padding_factor=8,
  ):
      d = BertDictionary()
      for filename in filenames:
          Dictionary.add_file_to_dictionary(
              filename, d, tokenizer.tokenize_line, workers
          )
      d.finalize(
          threshold=threshold,
          nwords=nwords,
          padding_factor=padding_factor,
      )
      return d
  
file_path: fairseq/fairseq/tasks/legacy_masked_lm.py
imports: import itertools
  import logging
  import os
  import numpy
  from fairseq import tokenizer, utils
  from fairseq.data import ConcatDataset, Dictionary, data_utils, indexed_dataset
  from fairseq.data.legacy.block_pair_dataset import BlockPairDataset
  from fairseq.data.legacy.masked_lm_dataset import MaskedLMDataset
  from fairseq.data.legacy.masked_lm_dictionary import BertDictionary
  from fairseq.tasks import LegacyFairseqTask, register_task
label_desc: Use image node_id 4 for calling the LegacyMaskedLMTask obj's underlying member method code with example usage: obj.build_dictionary(cls, filenames, workers, threshold, nwords, padding_factor) and returns: d