class_docstr: Task for used with Masked language modelling.
  
  .. todo::
      Describe MLM
  
  :param mask_ratio: Fraction of tokens to mask.
  :param smart_masking: Whether to apply smart masking (use tokens from the same group when choosing randoms).
class_docstr_tok: ["Task","for","used","with","Masked","language","modelling",".","..","todo",":",":","Describe","MLM",":","param","mask_ratio",":","Fraction","of","tokens","to","mask",".",":","param","smart_masking",":","Whether","to","apply","smart","masking","(","use","tokens","from","the","same","group","when","choosing","randoms",")","."]
code: def cls_task(self, document: PersonDocument):
      p = np.random.rand(1)
      if p < 0.05:
          document.sentences.reverse()
          targ_cls = 1
      elif p > 0.95:
          shuffle(document.sentences)
          targ_cls = 2
      else:
          targ_cls = 0
  
      return document, targ_cls
  
file_path: life2vec/src/tasks/mlm.py
imports: import logging
  from dataclasses import dataclass
  from functools import cached_property
  from itertools import chain
  from typing import List, Tuple, TypeVar, cast
  from xml.dom.minidom import Document
  import numpy
  import torch
  from random import shuffle
  from src.data_new.types import Background, PersonDocument, EncodedDocument
  from src.tasks.base import Task
label_desc: Use image node_id 3 for calling the MLM obj's underlying member method code with example usage: obj.cls_task(document) and returns: document,  targ_cls