I have a trained model for Name Entity Recognition (NER) from eBrevia. I am wondering if there is a way that I can load it into CoreNLP or Spacy using Python or Java programmatically.
Edit: If the pretrained model is a pickle model, is there a way that I can use Corenlp or Spacy to load it?
Thanks in advance!
With spaCy (Python), you should be able to write a custom component and within that, implement a wrapper around your current NER model. Custom components always take a
doc
as input, modify it, and return it. This allows chaining of both custom as well as "pre-fab" components.For instance, if your NER model takes a list of tokens as input, and returns a list of their BILUO tags, you could wrap that model as such:
Once you have defined that custom pipeline component called
custom_ner_wrapper
, you have to add it to yournlp
pipeline like so:More information can be found here: https://spacy.io/usage/processing-pipelines#wrapping-models-libraries