question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding text categories to an existing model is not allowed?

See original GitHub issue

I have a general question about text categorizing.

As far as I understand, it is not possible to add a new Category in an already existing model. If I load a ‘textcat’ pipe from an existing model, I am not allowed to add new categories. As a result the following code will not work:

 nlp = spacy.load(modelPath) 
 textcat = nlp.get_pipe("textcat")
 textcat.add_label("my_new_category")

Is this correct?

This implies that I have to know all categories for my model before I start the training for a new empty model.

This behaviour seems to be different to the Entity Recognition feature. When I get a ‘ner’ pipe from an existing model I can provide new entities and spyCy will refine the model.

I just ask this, because form the documentation and examples (which in general are really great!) this restriction is not clearly documented.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adrianeboydcommented, Jan 18, 2021

That’s right, you can’t add new labels to an existing textcat model in v2. (You will be able to to in v3, though!)

It depends on the component (you also can’t add labels to a tagger) and you’re right that this isn’t clearly documented.

0reactions
github-actions[bot]commented, Oct 26, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add alternative text to a shape, picture, chart, SmartArt graphic ...
You can create alternative text (Alt Text) for shapes, pictures, charts, SmartArt graphics, or other objects in your Microsoft 365 document.
Read more >
Models - Django documentation
Models ¶. A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the...
Read more >
Content categories - HTML: HyperText Markup Language | MDN
Most HTML elements are a member of one or more content categories — these categories group elements that share common characteristics.
Read more >
Edit document structure with the Content and Tags panels ...
Options allow you to search the page or document, and to add tags to ... The standard Adobe element tag types are available...
Read more >
Create and use variants - Figma Help Center
Note: Component sets can only contain components, so it's not possible to add text or annotations, nest frames, or group a subset of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found