Should GoldParse.__init__ accept doc=None?
See original GitHub issueNot sure if this is bug exactly (the GoldParse API documentation isn’t specific on whether the doc
argument is optional or not, but given that there is a words
argument, it would be nice to not have to pass in doc
when this argument has been specified
How to reproduce the behaviour
from spacy.gold import GoldParse
annotation = GoldParse(words=["some", "words"], cats={"mylabel": 1.0})
produces the following error.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-28-f161c45966e4> in <module>
----> 1 annotation = GoldParse(words=["some", "words"], cats={"mylabel": 1.0})
gold.pyx in spacy.gold.GoldParse.__init__()
TypeError: __init__() takes at least 1 positional argument (0 given)
My current workaround is something like the following, but would be nice to avoid this unless it is still necessary for a reason that I am missing.
from spacy.gold import GoldParse
import spacy
tokenizer = spacy.load('en_core_web_sm').tokenizer
annotation = GoldParse(tokenizer(" ".join(["some", "words"])), cats={"mylabel": 1.0})
Your Environment
- spaCy version: 2.3.5
- Platform: Darwin-20.2.0-x86_64-i386-64bit
- Python version: 3.7.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
What's New in v3.0 · spaCy Usage Documentation
You can use the quickstart widget or the init config command to get started. ... all take batches of Example objects instead of...
Read more >spacy.util.minibatch Example - Program Talk
Here are the examples of the python api spacy.util.minibatch taken from open source projects. By voting up you can indicate which examples are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the clarification @svlandeg, this makes sense now!
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.