# Token classification

**URL:** <https://discuss.huggingface.co/t/token-classification/10680>\
**Category:** Beginners\
**Created:** [October 11, 2021, 11:09am UTC](https://discuss.huggingface.co/t/token-classification/10680 "2021-10-11T11:09:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk021](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sk021](https://discuss.huggingface.co/u/sk021)\
**Post date:** [October 11, 2021, 11:09am UTC](https://discuss.huggingface.co/t/token-classification/10680/1 "2021-10-11T11:09:08Z")

</div>

[https://huggingface.co/transformers/custom\_datasets.html](https://huggingface.co/transformers/custom_datasets.html)

i followed token classification tutorial on above link trained completed successufully then i predicted

````auto
model = DistilBertForTokenClassification.from_pretrained('./results/checkpoint-500', num_labels=len(unique_tags))
trainer = Trainer(
    model=model, # the instantiated 🤗 Transformers model to be trained
)

res = trainer.predict(new_dataset)
predictions = res.predictions```
 
i am getting an numpy array of d dimension how to convert predicted values to its corresponding tokens and i am assuming that res.predictions is numerical value of tags not tokens if i am wrong correct me
````

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [October 11, 2021, 11:52am UTC](https://discuss.huggingface.co/t/token-classification/10680/2 "2021-10-11T11:52:07Z")

</div>

You can check out [this thread](https://discuss.huggingface.co/t/decoding-the-predicted-output-array-in-distilbertbase-uncased-model-for-ner/10673/2) I just wrote on how to convert predictions to actual labels for token classification models.
