class_docstr: Convert raw texts to n-gram vectors.
  
  # Arguments
      max_tokens: Int. The maximum size of the vocabulary. Defaults to 20000.
      ngrams: Int or tuple of ints. Passing an integer will create ngrams up
          to that integer, and passing a tuple of integers will create ngrams
          for the specified values in the tuple. If left unspecified, it will
          be tuned automatically.
class_docstr_tok: ["Convert","raw","texts","to","n-gram","vectors",".","#","Arguments","max_tokens",":","Int",".","The","maximum","size","of","the","vocabulary",".","Defaults","to","20000.","ngrams",":","Int","or","tuple","of","ints",".","Passing","an","integer","will","create","ngrams","up","to","that","integer",",","and","passing","a","tuple","of","integers","will","create","ngrams","for","the","specified","values","in","the","tuple",".","If","left","unspecified",",","it","will","be","tuned","automatically","."]
code: def __init__(
      self,
      max_tokens: int = 20000,
      ngrams: Union[int, Tuple[int], None] = None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.max_tokens = max_tokens
      self.ngrams = ngrams
  
imports: from typing import Optional
  from typing import Tuple
  from typing import Union
  from keras_tuner.engine import hyperparameters
  from tensorflow import nest
  from tensorflow.keras import layers
  from autokeras import analysers
  from autokeras import keras_layers
  from autokeras.engine import block
  from autokeras.utils import io_utils
  from autokeras.utils import utils
label_desc: Use image node_id 1 to create a new TextToNgramVector object from inherited base classes: block_module with example: obj = TextToNgramVector(max_tokens, ngrams)