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: Get the values used for masking, random injection or no-op.
  
  Args:
    masked_lm_ids: a `RaggedTensor` of n dimensions and dtype int32 or int64
      whose values are the ids of items that have been selected for masking.
  Returns:
    a `RaggedTensor` of the same dtype and shape with `masked_lm_ids` whose
    values contain either the mask token, randomly injected token or original
    value.
docstr_tok: ["Get","the","values","used","for","masking",",","random","injection","or","no-op",".","Args",":","masked_lm_ids",":","a","`","RaggedTensor","`","of","n","dimensions","and","dtype","int32","or","int64","whose","values","are","the","ids","of","items","that","have","been","selected","for","masking",".","Returns",":","a","`","RaggedTensor","`","of","the","same","dtype","and","shape","with","`","masked_lm_ids","`","whose","values","contain","either","the","mask","token",",","randomly","injected","token","or","original","value","."]
code: def get_mask_values(self, masked_lm_ids):
      """Get the values used for masking, random injection or no-op.
  
      Args:
        masked_lm_ids: a `RaggedTensor` of n dimensions and dtype int32 or int64
          whose values are the ids of items that have been selected for masking.
      Returns:
        a `RaggedTensor` of the same dtype and shape with `masked_lm_ids` whose
        values contain either the mask token, randomly injected token or original
        value.
      """
      validate_rates = control_flow_assert.Assert(
          self._mask_token_rate + self._random_token_rate <= 1,
          ["mask_token_rate + random_token_rate must be <= 1"],
      )
      with ops.control_dependencies([validate_rates]):
          # Generate a random number for all mask-able items. Items that should be
          # treated atomically (e.g. all wordpieces in a token, span, etc) will have
          # the same random number.
          random_uniform = _get_random(masked_lm_ids)
  
          # Merge down to rank 2.
          random_uniform = (
              random_uniform
              if random_uniform.ragged_rank == 1
              else random_uniform.merge_dims(1, -1)
          )
          mask_values = masked_lm_ids
  
          all_mask_flat = array_ops.tile(
              [self._mask_token],
              array_ops.shape(mask_values.flat_values),
          )
  
          # Maybe add mask token `mask_token_rate`% of the time
          should_mask_flat = random_uniform.flat_values < math_ops.cast(
              self._mask_token_rate, dtypes.float32
          )
          mask_values = mask_values.with_flat_values(
              ragged_where_op.where(
                  should_mask_flat,
                  x=math_ops.cast(
                      all_mask_flat, mask_values.flat_values.dtype
                  ),
                  y=mask_values.flat_values,
              )
          )
  
          # Maybe inject random token `random_token_rate`% of the time.
          all_random_flat = random_ops.random_uniform(
              array_ops.shape(mask_values.flat_values),
              maxval=math_ops.cast(self._vocab_size, dtypes.float32),
          )
          should_inject_random_flat = math_ops.logical_and(
              random_uniform.flat_values > self._mask_token_rate,
              random_uniform.flat_values
              < self._mask_token_rate + self._random_token_rate,
          )
          mask_values = mask_values.with_flat_values(
              ragged_where_op.where(
                  should_inject_random_flat,
                  x=math_ops.cast(
                      all_random_flat, mask_values.flat_values.dtype
                  ),
                  y=mask_values.flat_values,
              )
          )
          return mask_values
  
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 5 for calling the MaskValuesChooser obj's underlying member method code with example usage: obj.get_mask_values(masked_lm_ids) and returns: mask_values