# EncoderDecoderModel for token classification

**URL:** <https://discuss.huggingface.co/t/encoderdecodermodel-for-token-classification/25204>\
**Category:** 🤗Transformers\
**Created:** [October 29, 2022, 8:50pm UTC](https://discuss.huggingface.co/t/encoderdecodermodel-for-token-classification/25204 "2022-10-29T20:50:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Logmms](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Logmms](https://discuss.huggingface.co/u/Logmms)\
**Post date:** [October 29, 2022, 8:50pm UTC](https://discuss.huggingface.co/t/encoderdecodermodel-for-token-classification/25204/1 "2022-10-29T20:50:25Z")

</div>

Is there some way I can use an `EncoderDecoderModel` for token classification? I know of course that you can use any `xxxForTokenClassification` model to do token classification. The reason I do not want to use such a `xxxForTokenClassification` model is that I want to use beam search to find an optimal sequence of token labels. As far as I can gather, that is not possible with a `xxxForTokenClassification` model.
