class_docstr: Build an EncodingVisualizer
  
  Args:
  
       tokenizer (:class:`~tokenizers.Tokenizer`):
          A tokenizer instance
  
       default_to_notebook (:obj:`bool`):
          Whether to render html output in a notebook by default
  
       annotation_converter (:obj:`Callable`, `optional`):
          An optional (lambda) function that takes an annotation in any format and returns
          an Annotation object
code: def __init__(
      self,
      tokenizer: Tokenizer,
      default_to_notebook: bool = True,
      annotation_converter: Optional[
          Callable[[Any], Annotation]
      ] = None,
  ):
      if default_to_notebook:
          try:
              from IPython.core.display import HTML, display
          except ImportError as e:
              raise Exception(
                  """We couldn't import IPython utils for html display.
                          Are you running in a notebook?
                          You can also pass `default_to_notebook=False` to get back raw HTML
                      """
              )
  
      self.tokenizer = tokenizer
      self.default_to_notebook = default_to_notebook
      self.annotation_coverter = annotation_converter
      pass
  
imports: import itertools
  import os
  import re
  from string import Template
  from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple
  from tokenizers import Encoding, Tokenizer
label_desc: Use image node_id 1 to create a new EncodingVisualizer object  with example: obj = EncodingVisualizer(tokenizer, default_to_notebook, annotation_converter)