# annotate automatically same token occurs in the text

**URL:** <https://support.prodi.gy/t/annotate-automatically-same-token-occurs-in-the-text/6269>\
**Category:** Uncategorized\
**Tags:** ner\
**Created:** [January 24, 2023, 7:26am UTC](https://support.prodi.gy/t/annotate-automatically-same-token-occurs-in-the-text/6269 "2023-01-24T07:26:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jette16](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/jette16/32/3162_2.png) [@Jette16](https://support.prodi.gy/u/Jette16)\
**Post date:** [January 24, 2023, 1:42pm UTC](https://support.prodi.gy/t/annotate-automatically-same-token-occurs-in-the-text/6269/2 "2023-01-24T13:42:26Z")

</div>

Hi @Bharath,  
thank you for your question 🙂  
If you know the words that you want to annotate beforehand, you could use a [pattern file](https://prodi.gy/docs/text-classification#patterns) and the `--patterns` flag in your [ner.manual command](https://prodi.gy/docs/recipes#ner-manual).

If you don't know these words beforehand, you could write a custom recipe to add your annotated spans to the Matcher while annotating. In order to achieve this, you need to add an `update()` function to your recipe. For that, you might want to checkout the following two posts by Ines:

- [NER Training for Corporate Names - #16 by ines](https://support.prodi.gy/t/ner-training-for-corporate-names/1353/16)
- [Prodigy Custom Model; Model in the Loop (matcher) - #2 by ines](https://support.prodi.gy/t/prodigy-custom-model-model-in-the-loop-matcher/4534/2)

In both update-functions, spans are added to the `PatternMatcher` during the annotation process.  
I hope that this helps you with your problem. Please let me know if you have any further questions.

---

_[View the full topic](https://support.prodi.gy/t/annotate-automatically-same-token-occurs-in-the-text/6269)._
