class_docstr: Contains common processing steps used by each vectorizer.
  
  These are the preprocessing steps that in applied in order:
  
  Parameters
  ----------
  on
      The name of the feature that contains the text to vectorize. If `None`, then each
      `learn_one` and `transform_one` should treat `x` as a `str` and not as a `dict`.
  strip_accents
      Whether or not to strip accent characters.
  lowercase
      Whether or not to convert all characters to lowercase.
  preprocessor
      An optional preprocessing function which overrides the `strip_accents` and `lowercase`
      steps, while preserving the tokenizing and n-grams generation steps.
  tokenizer_pattern
      The tokenization pattern which is used when no `tokenizer` function is passed. A single
      capture group may optionally be specified.
  tokenizer
      A function used to convert preprocessed text into a `dict` of tokens. A default tokenizer
      is used if `None` is passed. Set to `False` to disable tokenization.
  stop_words
      An optional set of tokens to remove.
  ngram_range
      The lower and upper boundary of the range n-grams to be extracted. All values of n such
      that `min_n <= n <= max_n` will be used. For example an `ngram_range` of `(1, 1)` means
      only unigrams, `(1, 2)` means unigrams and bigrams, and `(2, 2)` means only bigrams.
  
  Attributes
  ----------
  processing_steps : list
      A list of preprocessing steps that are applied to each text.
code: def __init__(
      self,
      on: str | None = None,
      strip_accents=True,
      lowercase=True,
      preprocessor: typing.Callable | None = None,
      stop_words: set[str] | None = None,
      tokenizer_pattern=r"(?u)\b\w[\w\-]+\b",
      tokenizer: typing.Callable | None = None,
      ngram_range=(1, 1),
  ):
      self.on = on
      self.strip_accents = strip_accents
      self.lowercase = lowercase
      self.preprocessor = preprocessor
      self.stop_words = set(stop_words) if stop_words else stop_words
      self.tokenizer_pattern = tokenizer_pattern
      self.tokenizer = tokenizer
      self.ngram_range = ngram_range
  
      self.processing_steps: list[typing.Any] = []
  
      # Text extraction
      if on is not None:
          self.processing_steps.append(operator.itemgetter(on))
  
      # Preprocessing
      if preprocessor:
          self.processing_steps.append(preprocessor)
      else:
          if self.strip_accents:
              self.processing_steps.append(strip_accents_unicode)
          if self.lowercase:
              self.processing_steps.append(str.lower)
  
      # Tokenization
      if self.tokenizer:
          self.processing_steps.append(self.tokenizer)
      else:
          tokenizer = functools.partial(
              tokenize_using_regex_pattern,
              pattern=self.tokenizer_pattern,
          )
          self.processing_steps.append(tokenizer)
  
      # Stop word removal
      if self.stop_words:
          self.processing_steps.append(
              functools.partial(
                  remove_stop_words, stop_words=stop_words
              )
          )
  
      # n-grams
      if ngram_range[1] > 1:
          self.processing_steps.append(
              functools.partial(
                  find_all_ngrams,
                  ngram_range=range(ngram_range[0], ngram_range[1] + 1),
              )
          )
  
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import math
  import operator
  import re
  import typing
  import unicodedata
  import pandas
  from scipy import sparse
  from river import base
label_desc: Use image node_id 1 to create a new VectorizerMixin object  with example: obj = VectorizerMixin(on, strip_accents, lowercase, preprocessor, stop_words, tokenizer_pattern, tokenizer, ngram_range)