# Getting entity offset from ONNX outputs

**URL:** <https://discuss.huggingface.co/t/getting-entity-offset-from-onnx-outputs/17307>\
**Category:** Intermediate\
**Created:** [April 28, 2022, 7:07pm UTC](https://discuss.huggingface.co/t/getting-entity-offset-from-onnx-outputs/17307 "2022-04-28T19:07:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shensmobile](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@shensmobile](https://discuss.huggingface.co/u/shensmobile)\
**Post date:** [April 28, 2022, 7:07pm UTC](https://discuss.huggingface.co/t/getting-entity-offset-from-onnx-outputs/17307/1 "2022-04-28T19:07:39Z")

</div>

Hi all,

Working with a BERT model that I’ve exported successfully for NER. ONNX inference is successful, I’m just wondering if there’s a built-in function to convert the token index (from the model output) to the char offsets. I want to be able to identify the exact position of the entity in the original text.

Hopefully this isn’t too dumb of a question.

---

<div class="post-metadata">

**Author:** ![shensmobile](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@shensmobile](https://discuss.huggingface.co/u/shensmobile)\
**Post date:** [April 28, 2022, 7:19pm UTC](https://discuss.huggingface.co/t/getting-entity-offset-from-onnx-outputs/17307/2 "2022-04-28T19:19:58Z")

</div>

Nevermind, I’m an idiot. You can find out how to do it here:

> **[Fast tokenizers' special powers - Hugging Face Course](https://huggingface.co/course/chapter6/3)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

There’s just too much documentation to sift through!
