mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Fix merge issues
This commit is contained in:
parent
631e20d0c6
commit
245f91df78
|
@ -1050,6 +1050,12 @@ cdef class GoldParse:
|
|||
|
||||
# avoid allocating memory if the doc does not contain any tokens
|
||||
if self.length == 0:
|
||||
self.words = []
|
||||
self.tags = []
|
||||
self.heads = []
|
||||
self.labels = []
|
||||
self.ner = []
|
||||
self.morphs = []
|
||||
# set a minimal orig so that the scorer can score an empty doc
|
||||
self.orig = TokenAnnotation(ids=[])
|
||||
else:
|
||||
|
|
|
@ -21,7 +21,8 @@ def test_issue5137():
|
|||
def from_disk(self, path, **cfg):
|
||||
pass
|
||||
|
||||
Language.factories["my_component"] = lambda nlp, **cfg: MyComponent(nlp, **cfg)
|
||||
factory = lambda nlp, model, **cfg: MyComponent(nlp, **cfg)
|
||||
Language.factories["my_component"] = factory
|
||||
|
||||
nlp = English()
|
||||
nlp.add_pipe(nlp.create_pipe("my_component"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user