SentenceSegmenter Attribute error using textcat.teach

I just ran into an error using textcat.teach with a custom model trained on a previous round of labeling. I ran

prodigy textcat.teach capture capture-model masdar_sents.json --label CAPTURE

and after about 20 labels got

Exception when serving /give_answers
Traceback (most recent call last):
  File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/waitress/", line 338, in service
  File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/waitress/", line 169, in service
  File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/waitress/", line 399, in execute
    app_iter =, start_response)
  File "hug/", line 420, in hug.api.ModuleSingleton.__call__.api_auto_instantiate (hug/api.c:14291)
  File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/falcon/", line 227, in __call__
    responder(req, resp, **params)
  File "hug/", line 659, in hug.interface.HTTP.__call__ (hug/interface.c:19188)
  File "hug/", line 600, in hug.interface.HTTP.call_function (hug/interface.c:17322)
  File "hug/", line 99, in hug.interface.Interfaces.__call__ (hug/interface.c:3672)
  File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/prodigy/", line 66, in give_answers
  File "cython_src/prodigy/core.pyx", line 71, in prodigy.core.Controller.receive_answers
  File "cython_src/prodigy/models/textcat.pyx", line 182, in prodigy.models.textcat.TextClassifier.update
  File "cython_src/prodigy/models/textcat.pyx", line 204, in prodigy.models.textcat.TextClassifier._update
AttributeError: 'SentenceSegmenter' object has no attribute 'update'

Let me know if it would be helpful to have the model or text and I can get it to you.

I’m really enjoying Prodigy! I hope the bug reports don’t make it seem like I’m not.

1 Like

Thanks, and definitely keep reporting :slight_smile:

It seems the ._update() method is assuming the textcat model is the last in the pipeline. Seems like an easy bug to fix.

In the meantime, you could work around this by reordering the nlp.pipeline list?