explosion / spacy-stanza

💥 Use the latest Stanza (StanfordNLP) research models directly in spaCy
MIT License
723 stars 59 forks source link

Question: fine tuning stanza models from within Spacy #74

Closed srsridharan closed 3 years ago

srsridharan commented 3 years ago

Details

After importing a Stanza model into Spacy (e.g. the bio NER model in stanza - which also contains its own word embedding), could I use spacy/thinc to train or finetune the Stanza model (which itself is a pytorch model under the hood).

As training/finetuning NER in Stanza is currently quite cumbersome (and doing NER tuning in Spacy is easier) so that would be a huge plus! Any insights are welcome. I'm not too optimistic simply because Stanza NER training itself has a range of parameters that need to be set. However I would be happy to be contradicted by the Spacy team given their familiarity with this.

adrianeboyd commented 3 years ago

In spacy-stanza, the stanza model is run as part of the tokenization (what happens in nlp.make_doc), so it's not loaded in the same way as the built-in trainable components.

I would imagine that it's technically possible some effort in thinc and spacy, but I think you're probably better off using their training methods.