> For the complete documentation index, see [llms.txt](https://boinc-ai.gitbook.io/tokenizers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boinc-ai.gitbook.io/tokenizers/api/visualizer.md).

# Visualizer

## Visualizer

PythonRustNode

### Annotation

#### class tokenizers.tools.Annotation

[\<source>](https://github.com/huggingface/tokenizers/blob/v0.13.4.rc2/src/tokenizers/tools/visualizer.py#L16)

( start: intend: intlabel: str )

### EncodingVisualizer

#### class tokenizers.tools.EncodingVisualizer

[\<source>](https://github.com/huggingface/tokenizers/blob/v0.13.4.rc2/src/tokenizers/tools/visualizer.py#L67)

( tokenizer: Tokenizerdefault\_to\_notebook: bool = Trueannotation\_converter: typing.Union\[typing.Callable\[\[typing.Any], tokenizers.tools.visualizer.Annotation], NoneType] = None )

Parameters

* **tokenizer** ([Tokenizer](https://huggingface.co/docs/tokenizers/v0.13.4.rc2/en/api/tokenizer#tokenizers.Tokenizer)) — A tokenizer instance
* **default\_to\_notebook** (`bool`) — Whether to render html output in a notebook by default
* **annotation\_converter** (`Callable`, *optional*) — An optional (lambda) function that takes an annotation in any format and returns an Annotation object

Build an EncodingVisualizer

**\_\_call\_\_**

[\<source>](https://github.com/huggingface/tokenizers/blob/v0.13.4.rc2/src/tokenizers/tools/visualizer.py#L108)

( text: strannotations: typing.List\[tokenizers.tools.visualizer.Annotation] = \[]default\_to\_notebook: typing.Optional\[bool] = None )

Parameters

* **text** (`str`) — The text to tokenize
* **annotations** (`List[Annotation]`, *optional*) — An optional list of annotations of the text. The can either be an annotation class or anything else if you instantiated the visualizer with a converter function
* **default\_to\_notebook** (`bool`, *optional*, defaults to *False*) — If True, will render the html in a notebook. Otherwise returns an html string.

Build a visualization of the given text
