# How to do relation annotation after using bert.mer.manual

**URL:** <https://support.prodi.gy/t/how-to-do-relation-annotation-after-using-bert-mer-manual/6612>\
**Category:** Uncategorized\
**Tags:** transformers, relations\
**Created:** [June 18, 2023, 7:35am UTC](https://support.prodi.gy/t/how-to-do-relation-annotation-after-using-bert-mer-manual/6612 "2023-06-18T07:35:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jiachen](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Jiachen](https://support.prodi.gy/u/Jiachen)\
**Post date:** [June 18, 2023, 7:35am UTC](https://support.prodi.gy/t/how-to-do-relation-annotation-after-using-bert-mer-manual/6612/1 "2023-06-18T07:35:53Z")

</div>

Hi, I'm using Prodigy to do annotation for fine-tuning BERTs, which aims to do the NER and RE tasks. I've annotated the NER with the 'bert.ner.manual' recipe. I wondered if there is a recipe for relation annotation using the dataset I annotated. I've tried the scripts (prodigy rel.manual ner\_rels\_dep blank: en dataset:ner\_rels\_ent --label SUBJECT,LOCATION --wrap) to run rel.manual for this purpose but things happened like the original tokenizer cannot identify my labeled data.

---

<div class="post-metadata">

**Author:** ![ryanwesslen](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ryanwesslen/32/2969_2.png) [@ryanwesslen](https://support.prodi.gy/u/ryanwesslen)\
**Post date:** [June 19, 2023, 1:57pm UTC](https://support.prodi.gy/t/how-to-do-relation-annotation-after-using-bert-mer-manual/6612/2 "2023-06-19T13:57:52Z")

</div>

hi @Jiachen!

Thanks for your question and welcome to the Prodigy community 👋

Have you seen this post?

> [@Tokenization compatibility issues in rel.manual](https://support.prodi.gy/t/tokenization-compatibility-issues-in-rel-manual/3241/3):
>
> If you're happy to just annotate the BPE tokens and relations between them, and don't care so much about aligning the tokens to spaCy's linguistic tokenization, you could also just load in pre-tokenized text using your tokenizer. Here's an example using a word piece tokenizer for NER annotation that aligns with a transformer model: [https://prodi.gy/docs/named-entity-recognition#transformers-tokenizers](https://prodi.gy/docs/named-entity-recognition#transformers-tokenizers) You don't have to do it within the recipe – you could also use the logic as a preprocessing st…

The idea is to pass in the pre-tokenized text and avoiding spaCy's tokenizer. You'll need to create a custom recipe as `rel.manual` will assume you're using a spaCy tokenizer -- but as the post mentions, you can use the `bert.ner.manual` as an example of how to use the BPE tokenizer. Also, you can find the `rel.manual` recipe (for reference) in your installed Prodigy library. Run `prodigy stats`, find the `Location:` path (aka where Prodigy is installed), and then look for `recipes/rel.py` script.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Jiachen](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Jiachen](https://support.prodi.gy/u/Jiachen)\
**Post date:** [December 12, 2023, 10:47pm UTC](https://support.prodi.gy/t/how-to-do-relation-annotation-after-using-bert-mer-manual/6612/3 "2023-12-12T22:47:59Z")

</div>

Thank you for your reply! I think now the prodigy can use an annotated dataset as input for the rel.manual. I looked into the data format that uses built-in recipes and compared them with the output annotated by the `bert.ner.manual`, I can then process them in my ide for training them on the bert-based-model. but now the spacy has supported the `transformers`, so now I can use the Bert-based model.
