mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +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
|
# avoid allocating memory if the doc does not contain any tokens
|
||||||
if self.length == 0:
|
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
|
# set a minimal orig so that the scorer can score an empty doc
|
||||||
self.orig = TokenAnnotation(ids=[])
|
self.orig = TokenAnnotation(ids=[])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -21,7 +21,8 @@ def test_issue5137():
|
||||||
def from_disk(self, path, **cfg):
|
def from_disk(self, path, **cfg):
|
||||||
pass
|
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 = English()
|
||||||
nlp.add_pipe(nlp.create_pipe("my_component"))
|
nlp.add_pipe(nlp.create_pipe("my_component"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user