# Probs with ner.teach in bertbasedcase

**URL:** <https://support.prodi.gy/t/probs-with-ner-teach-in-bertbasedcase/2598>\
**Category:** Uncategorized\
**Tags:** usage, ner, transformers\
**Created:** [February 27, 2020, 3:06pm UTC](https://support.prodi.gy/t/probs-with-ner-teach-in-bertbasedcase/2598 "2020-02-27T15:06:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaldoviber](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ronaldoviber/32/795_2.png) [@ronaldoviber](https://support.prodi.gy/u/ronaldoviber)\
**Post date:** [February 27, 2020, 3:06pm UTC](https://support.prodi.gy/t/probs-with-ner-teach-in-bertbasedcase/2598/1 "2020-02-27T15:06:06Z")

</div>

if i user this call  
`!prodigy ner.teach jg02 de_trf_bertbasecased_lg corp2mb.txt --label PERSON,LOCATION`

i get an error  
`_pickle.PicklingError: it's not the same object as typing.Union`

using net.manual it works quiet well. The pickle points to a serializer problem. Any idea how to fix this?

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 27, 2020, 4:32pm UTC](https://support.prodi.gy/t/probs-with-ner-teach-in-bertbasedcase/2598/2 "2020-02-27T16:32:52Z")

</div>

It looks like something is trying to `deepcopy` an object that includes a Python type `Union`, which is a known Python issue. Not sure where that happens and where the type would come from, though 🤔

In any case, there's not really a point in using a transformer starter model for `ner.teach`. The entity recognizer you train won't use the transformer weights anyways (you're just training a regular spaCy NER model) – and even if it did, updating/finetuning the model in the loop would be way too slow and not really effective, as the transformer models typically need larger batch sizes and need more than just a simple, single update with a small batch. So the model wouldn't really change as you update.
