My NLP pipeline uses pre-trained BERT embedding model "bert_base_uncased" from johnsnowlabs. But while loading this downloaded model I am getting following exception.
Caused by: java.util.NoSuchElementException: Param poolingLayer does not exist.
at org.apache.spark.ml.param.Params$$anonfun$getParam$2.apply(params.scala:729)
at org.apache.spark.ml.param.Params$$anonfun$getParam$2.apply(params.scala:729)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.ml.param.Params$class.getParam(params.scala:728)
at org.apache.spark.ml.PipelineStage.getParam(Pipeline.scala:42)
at org.apache.spark.ml.util.DefaultParamsReader$Metadata$$anonfun$setParams$1.apply(ReadWrite.scala:591)
at org.apache.spark.ml.util.DefaultParamsReader$Metadata$$anonfun$setParams$1.apply(ReadWrite.scala:589)
at scala.collection.immutable.List.foreach(List.scala:392)
at org.apache.spark.ml.util.DefaultParamsReader$Metadata.setParams(ReadWrite.scala:589)
at org.apache.spark.ml.util.DefaultParamsReader$Metadata.getAndSetParams(ReadWrite.scala:577)
at org.apache.spark.ml.util.DefaultParamsReader.load(ReadWrite.scala:497)
at com.johnsnowlabs.nlp.FeaturesReader.load(ParamsAndFeaturesReadable.scala:12)
at com.johnsnowlabs.nlp.FeaturesReader.load(ParamsAndFeaturesReadable.scala:8)
at org.apache.spark.ml.util.MLReadable$class.load(ReadWrite.scala:380)
at com.johnsnowlabs.nlp.embeddings.BertEmbeddings$.load(BertEmbeddings.scala:302)
at com.johnsnowlabs.nlp.embeddings.BertEmbeddings.load(BertEmbeddings.scala)
Based on the help from spark-nlp slack channel. I solved this problem by using latest trained models from spark-nlp. For BERT I used model "bert_base_cased_en_2.6.0_2.4_1598340336670"
Earlier I was working with 2.4.0 version models, after using 2.6.0 version models, I didn't see any errors. poolingLayer param is no longer exists in new models.