JohnSnowLabs/spark-nlp

NerDLModel don't load a pretrained NerDLAproach

Arierref46 opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues and did not find a match.

Who can help?

No response

What are you working on?

I amd developing a pipeline to do NER in custom data.

Current Behavior

When loading a pretrained NerDLModel, it shows a error Py4JJavaError: An error occurred while calling o152.load.
: java.lang.ClassCastException: com.johnsnowlabs.nlp.annotators.ner.dl.NerDLApproach cannot be cast to com.johnsnowlabs.nlp.annotators.ner.dl.NerDLModel
at com.johnsnowlabs.nlp.ParamsAndFeaturesReadable.$anonfun$onRead$1(ParamsAndFeaturesReadable.scala:50)

Expected Behavior

It should load the model normally.

Steps To Reproduce

https://colab.research.google.com/drive/1vwkMo6MGPBMGpERLOVtjrJv4dAd0edjq?usp=sharing

Spark NLP version and Apache Spark

spark 3.3.1
spark-nlp 5.3.2

Type of Spark Application

No response

Java Version

openjdk version "1.8.0_402"

Java Home Directory

No response

Setup and installation

No response

Operating System and Version

windows 11

Link to your project (if available)

No response

Additional Information

No response

Hi,

Could you please make that notebook public?

com.johnsnowlabs.nlp.annotators.ner.dl.NerDLApproach cannot be cast to com.johnsnowlabs.nlp.annotators.ner.dl.NerDLModel

You must not be saving the correct trained annotator. Should be a small fix in your code when we see it.

Sorry, it is now public