-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: TypeError when trying to use TextCategorizer #1728
Comments
Thanks – I think this is actually an error in the docs. Will fix this! The cause of the error is the same as described in #1702:
Since the textcat.from_disk('/path/to/model') nlp.add_pipe(textcat)
doc = nlp(u"This is a sentence.")
print(doc.cats) The example in the API docs should probably show an example with weights loaded in, since it's supposed to show the more abstract and standalone use of the class. |
@ines is there a pre-trained model that I can download and use, just like the language models? I know I can train one myself as per https://github.com/explosion/spacy/blob/master/examples/training/train_textcat.py, but I'm wondering if there's one that I can readily use. |
@safwank Not yet! Text classification is pretty specific, though, which makes it much harder to provide general-purpose models like the language models. However, it might be nice to offer an example model people can try out. If you're interested in an end-to-end workflow of training a text classifier, check out this video tutorial we've recorded for our annotation tool Prodigy: The workflow focuses on collecting the annotations to train the classifier – but under the hood, it updates spaCy's |
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. |
when running the following code (from the code exmple here https://spacy.io/api/textcategorizer):
I get the following error:
Info about spaCy
The text was updated successfully, but these errors were encountered: