Fix merge issues

This commit is contained in:
Ines Montani 2020-05-21 19:42:13 +02:00
parent 631e20d0c6
commit 245f91df78
2 changed files with 8 additions and 1 deletions

View File

@ -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:

View File

@ -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"))