class_docstr: Tokenizes a tensor of UTF-8 string tokens into phrases.
docstr: Detokenizes a tensor of int64 or int32 phrase ids into sentences.
  
  Detokenize and tokenize an input string returns itself when the input string
  is normalized and the tokenized phrases don't contain `<unk>`.
  
  ### Example:
  >>> vocab = ["I", "have", "a", "dream", "a dream", "I have a", "<UNK>"]
  >>> tokenizer = PhraseTokenizer(vocab, support_detokenization=True)
  >>> ids = tf.ragged.constant([[0, 1, 2], [5, 3]])
  >>> tokenizer.detokenize(ids)
  <tf.Tensor: shape=(2,), dtype=string,
  ...       numpy=array([b'I have a', b'I have a dream'], dtype=object)>
  
  Args:
    input_t: An N-dimensional `Tensor` or `RaggedTensor` of int64 or int32.
  
  Returns:
    A `RaggedTensor` of sentences that has N - 1 dimension when N > 1.
    Otherwise, a string tensor.
docstr_tok: ["Detokenizes","a","tensor","of","int64","or","int32","phrase","ids","into","sentences",".","Detokenize","and","tokenize","an","input","string","returns","itself","when","the","input","string","is","normalized","and","the","tokenized","phrases","do","n't","contain","`","<","unk",">","`",".","#","#","#","Example",":",">",">",">","vocab","=","[","``","I","''",",","``","have","''",",","``","a","''",",","``","dream","''",",","``","a","dream","''",",","``","I","have","a","''",",","``","<","UNK",">","''","]",">",">",">","tokenizer","=","PhraseTokenizer","(","vocab",",","support_detokenization=True",")",">",">",">","ids","=","tf.ragged.constant","(","[","[","0",",","1",",","2","]",",","[","5",",","3","]","]",")",">",">",">","tokenizer.detokenize","(","ids",")","<","tf.Tensor",":","shape=","(","2",",",")",",","dtype=string",",","...","numpy=array","(","[","b","'","I","have","a","'",",","b","'","I","have","a","dream","'","]",",","dtype=object",")",">","Args",":","input_t",":","An","N-dimensional","`","Tensor","`","or","`","RaggedTensor","`","of","int64","or","int32",".","Returns",":","A","`","RaggedTensor","`","of","sentences","that","has","N","-","1","dimension","when","N",">","1",".","Otherwise",",","a","string","tensor","."]
code: def detokenize(self, input_t):  # pylint: disable=redefined-builtin
      """Detokenizes a tensor of int64 or int32 phrase ids into sentences.
  
      Detokenize and tokenize an input string returns itself when the input string
      is normalized and the tokenized phrases don't contain `<unk>`.
  
      ### Example:
      >>> vocab = ["I", "have", "a", "dream", "a dream", "I have a", "<UNK>"]
      >>> tokenizer = PhraseTokenizer(vocab, support_detokenization=True)
      >>> ids = tf.ragged.constant([[0, 1, 2], [5, 3]])
      >>> tokenizer.detokenize(ids)
      <tf.Tensor: shape=(2,), dtype=string,
      ...       numpy=array([b'I have a', b'I have a dream'], dtype=object)>
  
      Args:
        input_t: An N-dimensional `Tensor` or `RaggedTensor` of int64 or int32.
  
      Returns:
        A `RaggedTensor` of sentences that has N - 1 dimension when N > 1.
        Otherwise, a string tensor.
      """
      name = None
      with ops.name_scope(
          name, "PhraseDetokenize", [input_t, self._model]
      ):
          # Check that the types are expected and the ragged rank is appropriate.
          # ragged_tensor.convert_to_tensor_or_ragged_tensor(input)
          phrase_ids = math_ops.cast(input_t, dtypes.int32)
          rank = phrase_ids.shape.ndims
          if rank is None:
              raise ValueError("input must have a known rank.")
  
          if rank < 2:
              words = self.detokenize(
                  array_ops_stack.stack([phrase_ids])
              )
              return words[0]
  
          if not ragged_tensor.is_ragged(phrase_ids):
              phrase_ids = ragged_tensor.RaggedTensor.from_tensor(
                  phrase_ids, ragged_rank=rank - 1
              )
          nested_row_splits = phrase_ids.nested_row_splits
          # Detokenize the wordpiece ids to texts.
          words = gen_phrase_tokenizer.tf_text_phrase_detokenize(
              input_values=phrase_ids.flat_values,
              input_row_splits=nested_row_splits[-1],
              phrase_model=self._model,
          )
          words = RaggedTensor.from_nested_row_splits(
              words, nested_row_splits[:-1], validate=False
          )
  
          return words
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensorflow.python.eager import monitoring
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor
  from tensorflow_text.core.pybinds import pywrap_phrase_tokenizer_model_builder
  from tensorflow_text.python.ops.tokenization import Detokenizer
  from tensorflow_text.python.ops.tokenization import Tokenizer
  from tensorflow.python.framework import load_library
  from tensorflow.python.platform import resource_loader
label_desc: Use image node_id 3 for calling the PhraseTokenizer obj's underlying member method code with example usage: obj.detokenize(input_t) and returns: words, words