code: def _get_sequence_vector(
      sequence,
      tokenizer,
      tokenizer_type,
      format_dtype,
      unit_to_id,
      lowercase=True,
      unknown_symbol=UNKNOWN_SYMBOL,
  ) -> np.ndarray:
      unit_sequence = tokenizer(
          sequence.lower() if lowercase else sequence
      )
  
      unit_indices_vector = np.empty(
          len(unit_sequence), dtype=format_dtype
      )
      for i in range(len(unit_sequence)):
          curr_unit = unit_sequence[i]
          if tokenizer_type == "hf_tokenizer":
              unit_indices_vector[i] = curr_unit
          else:
              if curr_unit in unit_to_id:
                  unit_indices_vector[i] = unit_to_id[curr_unit]
              else:
                  unit_indices_vector[i] = unit_to_id[unknown_symbol]
  
      # Add start and stop symbols.
      # Huggingface's pretrained tokenizers take care of this implicitly:
      # https://huggingface.co/docs/transformers/preprocessing
      if tokenizer_type != "hf_tokenizer":
          unit_indices_vector = np.append(
              unit_indices_vector, unit_to_id[STOP_SYMBOL]
          )
          unit_indices_vector = np.insert(
              unit_indices_vector, 0, unit_to_id[START_SYMBOL]
          )
      return unit_indices_vector
  
imports: import logging
  import re
  import unicodedata
  from collections import Counter
  from dataclasses import dataclass
  from enum import Enum
  from typing import Dict, List, Optional, Set, Union
  import numpy
  from dateutil.parser import parse
  from ludwig.constants import PADDING_SYMBOL, START_SYMBOL, STOP_SYMBOL, UNKNOWN_SYMBOL
  from ludwig.data.dataframe.base import DataFrameEngine
  from ludwig.data.dataframe.pandas import PANDAS
  from ludwig.utils.fs_utils import open_file
  from ludwig.utils.math_utils import int_type
  from ludwig.utils.tokenizers import get_tokenizer_from_registry
  from ludwig.utils.types import Series
label_desc: Use image node_id 22 for calling a global function with example usage: _get_sequence_vector(sequence, tokenizer, tokenizer_type, format_dtype, unit_to_id, lowercase, unknown_symbol) and returns: unit_indices_vector