# KeyError: 'label' when running textcat.teach

**URL:** <https://support.prodi.gy/t/keyerror-label-when-running-textcat-teach/393>\
**Category:** Uncategorized\
**Tags:** textcat, done\
**Created:** [March 12, 2018, 7:24pm UTC](https://support.prodi.gy/t/keyerror-label-when-running-textcat-teach/393 "2018-03-12T19:24:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [March 12, 2018, 7:42pm UTC](https://support.prodi.gy/t/keyerror-label-when-running-textcat-teach/393/2 "2018-03-12T19:42:45Z")

</div>

Thanks for the report – this is very strange! For some reason, an annotated example that came back from the web app seems to not have a `'label'` key present – which should never happen in text classification mode. Did you notice anything strange in the UI, like a question without a label? And how did your `textcat.teach` command look?

If you still have your browser with Prodigy open, your latest batch of annotations will still be there (if a request fails, the app will move the batch back to the “outbox” and try again next time). So you could try and stop the server and add a print statement to the `give_answers` function in `prodigy/app.py` that outputs the batch of examples Prodigy receives back:

```python
def give_answers(answers=[]):
    print(answers)
    # etc.

```

You can then re-start the server and hit the “save” button again (don’t reload the browser, though!). You’ll likely still come across the same error when the annotations hit the text classification model, but the `/give_answers` endpoint should have printed the batch it received back. This will hopefully make it easier to debug what’s going on!

---

_[View the full topic](https://support.prodi.gy/t/keyerror-label-when-running-textcat-teach/393)._
