NER with custom embeddings

I’m using one of the pre-trained NER models in DeepPavlov and want to be able to use it with embeddings created by another model. As far as I understand, I should include these emdeddings in the NER model config. How should I do it (or should I do something else)?

Thenk you in advance for your answer.

Thank you for your question! Currently, we do not offer the ability to change embeddings without altering the entire model. If you want to integrate your own model into our NER pipeline, you should create a new module and inherit from the “TorchModel” class:

class YourModel(TorchModel):

    def __call__(self,
                 input_ids: Union[List[List[int]], np.ndarray],
                 input_masks: Union[List[List[int]], np.ndarray],
                 y_masks: Union[List[List[int]], np.ndarray]):

Additionally, you will need to add your module with the tag “your_model_registry_tag” to the registry file at “deeppavlov/core/common/registry.json”.