---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_dictionary_get_token.md
  - href: en/concepts/python-reference_dictionary_get_token.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# get_token

<!-- source: en/_includes/work_src/reusage-tokenizer/get_token.md -->
Return the token that corresponds to the given identifier.
<!-- endsource: en/_includes/work_src/reusage-tokenizer/get_token.md -->


## Method call format {#call-format}

```
get_token(token_id)
```

## Parameters {#parameters}

### token_id

#### Description

The identifier of the token that should be returned.

**Data types**

int

**Default value**

Obligatory parameter

## Type of return value {#return-value}

string

## Example {#example}

```python
from catboost.text_processing import Dictionary

dictionary = Dictionary(occurence_lower_bound=0)\
    .fit(["his", "tender", "heir", "whatever"])

print(dictionary.get_token(3))
```

Output:
```bash
whatever
```

{% note info %}

This method returns the token value in accordance with the numeration in the built dictionary. In this example, the numeration for the input list for building the dictionary and the one of the dictionary differ.

{% endnote %}


