How to create PipelineModel which includes AnnotatorApproach as one stage #424
Unanswered
mwunderlich
asked this question in
sparknlp-ocr
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a SparkNLP's
PipelineModel
all the stages have to be of typeAnnotatorModel
. But what if one of those annotatormodels requires a certain column in the dataset as input and this input column is the output of anAnnotatorApproach
?For instance, I have a trained model for NER (as the last stage of the pipeline) which requires tokens and POS tags as two of the inputs. The tokens are also required by the POS tagger. But the Tokenizer is an
AnnotatorApproach
and I am not able to add this to the pipeline.This is how the Tokenizer is instantiated (in Java):
AnnotatorApproach<TokenizerModel> tokenizer = new Tokenizer();
This works:
Pipeline pipeline = new Pipeline().setStages( new PipelineStage[]{tokenizer} );
But this doesn't work, because Tokenizer is not a Transformer:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions