flair icon indicating copy to clipboard operation
flair copied to clipboard

[Question]: How to do what MultiTagger used to do?

Open raykyn opened this issue 3 months ago • 1 comments

Question

I use flairNLP to annotate nested entities. Currently, I'm experimenting to use different models for different syntactic layers. My plan to do so was, to be a bit more efficient, to load the three models I'm using with a MultiTagger. I've seen that this has been removed since the last time I used it. If I've read the comments in the code correctly, I should still be able to do the same by loading the models with the SequenceTagger class:

tagger = Classifier.load({ "doc": MODEL_PATH_DOC, "mention": MODEL_PATH_MENTION, "desc": MODEL_PATH_DESC })

MODEL_PATH_DOC etc. are paths to the models as strings.

I'm absolutely clueless if this is correct, but I didn't see any other way to include label_names, which I then want to use when I predict:

tagger.predict(sent, label_name=label_name)

e.g. label_name would be "doc" for the first iteration on the sentence, but when annotating inside an entity I use the label_name "mention".

Is there a way to do this?

I'm currently using three independent models (although embeddings are the same), but training them in a Multitask settings is next on my list.

raykyn avatar May 16 '24 08:05 raykyn