Default algorithm used in prodigy train ner command

Hi,

What is the default algorithm that used in prodigy train ner command? Is it rule-based, machine learning, or already using the deep learning algorithm/architecture?

Note:
I am using the Prodigy 1.10.8 version

Hi! The prodigy train command is a thin wrapper around spaCy's train command: https://spacy.io/api/cli#train

If you're not specifying your own config for training, it will generate a default one using the components you set on the CLI. For example, when used with --ner, this will train a named entity recognizer. All these components are trainable pipeline components with their own neural network model. You can read more about the different components and their model architectures here: https://spacy.io/api#architecture-pipeline

Hi Ines,

In my case, I have used this command: prodigy train ner my-dataset blank:id --output my-model-name --eval-split 0.2 --n-iter 50.

I have explored the script here (ner pipeline) and if I am not wrong, the model architecture that used is spacy.TransitionBasedParser.v2. Is it correct?

I also have explored the TransitionBasedParser here. Do you have any resource suggestions for me to learn more about this architecture and the implementation for the NER case?

Thank you

If you're interested in transition-based parsing, Matt has an in-depth video where he explains the architecture and concept:

Hi Ines,

Thank you for the video suggestion.

In my case, I used the prodigy 1.10.8 and spacy 2.3.5 as the environment in my project. I am trying to explore the spacy code here to learn more about the algorithm that is used in the prodigy train ner or spacy train CLI, but I didn't find the precise code that fits with the documentation about TransitionBasedParser in the new spacy documentation here.

Can you suggest to me where I can find it? Or the model architecture that used in my environment is different?

In my case, I have used this command: prodigy train ner my-dataset blank:id --output my-model-name --eval-split 0.2 --n-iter 50 and here is the content of cfg file in the output model:

{
  "beam_width":1,
  "beam_density":0.0,
  "beam_update_prob":1.0,
  "cnn_maxout_pieces":3,
  "nr_feature_tokens":6,
  "nr_class":46,
  "hidden_depth":1,
  "token_vector_width":96,
  "hidden_width":64,
  "maxout_pieces":2,
  "pretrained_vectors":null,
  "bilstm_depth":0,
  "self_attn_depth":0,
  "conv_depth":4,
  "conv_window":1,
  "embed_size":2000
}

It's really important to me to know the algorithm used behind the prodigy train ner in my project environment.

Thank you

I am sorry Ines, do you have any suggestions about my question here?

Sorry, I didn't see the update since you edited you post :sweat_smile: If you click the "source" icon at the top of the different documented architectures, this should take you straight to the source of the model implementation. In this case, the TransitionBasedParser can be found here:

You might also find this paper helpful for background on transition-based parsing:

Hi Ines,

I have explored that code, but I think that code is for the newest version of Spacy. Is it correct? Or is the code the same as that used in the 2.3.5 version? I am using the 2.3.5 version so I have tried to find it in the old GitHub repository and having difficulty finding it.

Thank you

Ah, sorry, I missed that. The transition-based parsing architecture has changed slightly in terms of various details between v2.x and v3.x. The v2.x implementation is a bit messier (which is one aspect we fixed in v3.x) but you can find it here:

Is there any documentation about the changes?

One more thing, do you have any suggestions for me on how to train my ner model with my annotated dataset directly from spacy, instead of using the prodigy train ner CLI?

Thank you

hi @sigitpurnomo!

Sorry for the delay on the last part of your question.

Yes, check out this sample project repo that compares training a ner model using spacy and prodigy. It uses the spacy v3 project structure and config file structure. Hope this helps!