# Word\_ids not working with deberta\_v2

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fword-ids-not-working-with-deberta-v2%2F21523%3E%5C
**Category:** 🤗Tokenizers\
**Created:** [August 11, 2022, 12:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fword-ids-not-working-with-deberta-v2%2F21523 "2022-08-11T12:43:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![v-moayman](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@v-moayman](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fv-moayman)%5C
**Post date:** [August 11, 2022, 12:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fword-ids-not-working-with-deberta-v2%2F21523%2F1 "2022-08-11T12:43:32Z")

</div>

Hello all,  
Currently, I am working on a token classification. When I have tried to use word\_ids function during tokenization, it gave me an error. Let me elaborate with the following example:

```auto
#train is a dict having the tokens and labels
import transformers
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("microsoft/deberta-v3-small", use_fast=True)
tokenized_input = tokenizer(train['tokens'][0], is_split_into_words=True)

```

Now, the problem is I want to use word\_ids() function. Why? “Special tokens added by the tokenizer are mapped to `None` and other tokens are mapped to the index of their corresponding word (several tokens will be mapped to the same word index if they are parts of that word)”.

When I call this function, the following error raises:

```auto
"word_ids() is not available when using Python-based tokenizers"

```

While using distillbert, it is working fine. Your help is appreciated!

---

<div class="post-metadata">

**Author:** ![v-moayman](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@v-moayman](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fv-moayman)%5C
**Post date:** [August 12, 2022, 12:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fword-ids-not-working-with-deberta-v2%2F21523%2F2 "2022-08-12T12:27:26Z")

</div>

Check this issue: [DeBERTa V3 Fast Tokenizer · Issue #14712 · huggingface/transformers (github.com)](https://github.com/huggingface/transformers/issues/14712)
