Open meimei96tq opened 3 years ago
Two significant changes should be made for spacy3.x.
add_pipeline
method as follows.In spacy2.x:
ner = nlp.create_pipe('ner') nlp.add_pipe(ner, last=True)
In 3.x it should be updated to,
ner = nlp.add_pipe('ner', last=True)
update
method should be updated as follows according to the documentation,In spacy2.x:
nlp.update( [text], [annotations], drop=0.5, sgd=optimizer, losses=losses)
In 3.x it should be updated to,
example = Example.from_dict(self.nlp.make_doc(text), annotations) nlp.update( [example], drop=0.5, sgd=optimizer, losses=losses)
Example
class can be found under from spacy.training import Example
Hope this will be helpful for somebody if a late reply
@Kasun-Imesha Thanks a lot.....
Could you please update for space version 3.0?