# TypeError: 'str' object does not support item assignment - ner.manual

**URL:** https://support.prodi.gy/t/typeerror-str-object-does-not-support-item-assignment-ner-manual/6200
**Category:** Uncategorized
**Tags:** ner
**Created:** [December 21, 2022, 11:48pm UTC](https://support.prodi.gy/t/typeerror-str-object-does-not-support-item-assignment-ner-manual/6200 "2022-12-21T23:48:19Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [December 22, 2022, 12:11am UTC](https://support.prodi.gy/t/typeerror-str-object-does-not-support-item-assignment-ner-manual/6200/2 "2022-12-22T00:11:21Z")

</div>

hi @bev.manz!

> [@bev.manz](#):
>
> ```python
> File "cython_src/prodigy/models/matcher.pyx", line 235, in __call__
> TypeError: 'str' object does not support item assignment
> 
> ```

This looks similar to this issue, where it was a problem in the data, i.e., the `meta` tag.

> [@TypeError: 'str' object does not support item assignment](https://support.prodi.gy/t/typeerror-str-object-does-not-support-item-assignment/4610/2):
>
> Hi! I just tried it and it looks like the problem here is that your data includes a simple string value as its "meta", which Prodigy normally uses as a dict: "meta":"NG" The matcher tries to add its score to it thinking it's a dict, so that's what causes the error you see. We should add a workaround for this to prevent the error and port the meta to a dict automatically, but in the meantime, you can fix this by making the meta a dictionary with keys, e.g. like this: "meta": {"id": "NG"}

Can you check?

This is very similar too:

> [@What is the syntax for textcat.teach for multi-class?](https://support.prodi.gy/t/what-is-the-syntax-for-textcat-teach-for-multi-class/5897/2):
>
> Hello @jdewsnip, thank you for your question and welcome to the prodigy forum! Could you post an example of your .jsonl-file? I suspect that you might use the key "meta" with a string value in your data, for which Prodigy uses a dict as value. During the prediction, it tries to add a score to the meta-dictionary which could cause the error you see.

If it's not obvious, I would start to remove part of your data. For example, start with one record that you're confident is correct. Then add in 50% other data, then the remainder.

Initially I had suspect it was a problem with your pattern file too, since it seemed to hit the `matcher.pyx`. So if you can't find the data issue, another thing to try is run it without the pattern file.

Unfortunately, these errors are really tough for us to diagnose without a reproducible example. I understand your data may be too sensitive to share, but if you're still having issues, if you could even create one or two dummy examples that makes it a lot easier for us to reproduce.

Hope this helps!

---

_[View the full topic](https://support.prodi.gy/t/typeerror-str-object-does-not-support-item-assignment-ner-manual/6200)._
