# Token classification

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftoken-classification%2F10680%3E%5C
**Category:** Beginners\
**Created:** [October 11, 2021, 11:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftoken-classification%2F10680 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsk021)%5C
**Post date:** [October 11, 2021, 11:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftoken-classification%2F10680%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [October 11, 2021, 11:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftoken-classification%2F10680%2F2 "2021-10-11T11:52:07Z")

</div>

You can check out [this thread](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdecoding-the-predicted-output-array-in-distilbertbase-uncased-model-for-ner%2F10673%2F2) I just wrote on how to convert predictions to actual labels for token classification models.
