我的 NLP 管道使用来自 johnsnowlabs 的预训练 BERT 嵌入模型“bert_base_uncased”。但是在加载这个下载的模型时,我遇到了以下异常。
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)