class_docstr: Assigns values to the items chosen for masking.
  
  `MaskValuesChooser` encapsulates the logic for deciding the value to assign
  items that where chosen for masking. The following are the behavior in the
  default implementation:
  
  For `mask_token_rate` of the time, replace the item with the `[MASK]` token:
  
  ```
  my dog is hairy -> my dog is [MASK]
  ```
  
  For `random_token_rate` of the time, replace the item with a random word:
  
  ```
  my dog is hairy -> my dog is apple
  ```
  
  For `1 - mask_token_rate - random_token_rate` of the time, keep the item
  unchanged:
  
  ```
  my dog is hairy -> my dog is hairy.
  ```
  
  The default behavior is consistent with the methodology specified in
  `Masked LM and Masking Procedure` described in `BERT: Pre-training of Deep
  Bidirectional Transformers for Language Understanding`
  (https://arxiv.org/pdf/1810.04805.pdf).
  
  Users may further customize this with behavior through subclassing and
  overriding `get_mask_values()`.
docstr: Creates an instance of `MaskValueChooser`.
  
  Args:
    vocab_size: size of vocabulary.
    mask_token: The id of the mask token.
    mask_token_rate: (optional) A float between 0 and 1 which indicates how
      often the `mask_token` is substituted for tokens selected for masking.
      Default is 0.8, NOTE: `mask_token_rate` + `random_token_rate` <= 1.
    random_token_rate: A float between 0 and 1 which indicates how often a
      random token is substituted for tokens selected for masking. Default is
      0.1. NOTE: `mask_token_rate` + `random_token_rate` <= 1.
docstr_tok: ["Creates","an","instance","of","`","MaskValueChooser","`",".","Args",":","vocab_size",":","size","of","vocabulary",".","mask_token",":","The","id","of","the","mask","token",".","mask_token_rate",":","(","optional",")","A","float","between","0","and","1","which","indicates","how","often","the","`","mask_token","`","is","substituted","for","tokens","selected","for","masking",".","Default","is","0.8",",","NOTE",":","`","mask_token_rate","`","+","`","random_token_rate","`","<","=","1.","random_token_rate",":","A","float","between","0","and","1","which","indicates","how","often","a","random","token","is","substituted","for","tokens","selected","for","masking",".","Default","is","0.1",".","NOTE",":","`","mask_token_rate","`","+","`","random_token_rate","`","<","=","1","."]
code: def __init__(
      self,
      vocab_size,
      mask_token,
      mask_token_rate=0.8,
      random_token_rate=0.1,
  ):
      """Creates an instance of `MaskValueChooser`.
  
      Args:
        vocab_size: size of vocabulary.
        mask_token: The id of the mask token.
        mask_token_rate: (optional) A float between 0 and 1 which indicates how
          often the `mask_token` is substituted for tokens selected for masking.
          Default is 0.8, NOTE: `mask_token_rate` + `random_token_rate` <= 1.
        random_token_rate: A float between 0 and 1 which indicates how often a
          random token is substituted for tokens selected for masking. Default is
          0.1. NOTE: `mask_token_rate` + `random_token_rate` <= 1.
      """
      if mask_token_rate is None:
          raise ValueError("`mask_token_rate` cannot be None")
      if random_token_rate is None:
          raise ValueError("`random_token_rate` cannot be None")
      self._mask_token_rate = mask_token_rate
      self._random_token_rate = random_token_rate
      self._mask_token = mask_token
      self._vocab_size = vocab_size
  
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import ragged_array_ops
  from tensorflow.python.ops.ragged import ragged_math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged import ragged_where_op
  from tensorflow_text.python.ops import item_selector_ops
label_desc: Use image node_id 1 to create a new MaskValuesChooser object from inherited base classes: object with example: obj = MaskValuesChooser(vocab_size, mask_token, mask_token_rate, random_token_rate)