class_docstr: Zero Shot Image Classifier based on CLIP.
  
  CLIP (Contrastive Language-Image Pre-Training) is a neural network that was trained on image
  and text pairs. It has the ability to predict images without training on any hard-coded
  labels. This makes it very flexible, as labels can be provided during inference. This is
  similar to the zero-shot capabilities of the GPT-2 and 3 models.
  
  Pretrained models can be loaded with ``pretrained`` of the companion object:
  
  
  .. code-block:: python
  
      imageClassifier = CLIPForZeroShotClassification.pretrained() \
          .setInputCols(["image_assembler"]) \
          .setOutputCol("label")
  
  
  The default model is ``"zero_shot_classifier_clip_vit_base_patch32"``, if no name is provided.
  
  For available pretrained models please see the
  `Models Hub <https://sparknlp.org/models?task=Zero-Shot+Classification>`__.
  
  Models from the HuggingFace 🤗 Transformers library are also compatible with Spark NLP 🚀. To
  see which models are compatible and how to import them see
  https://github.com/JohnSnowLabs/spark-nlp/discussions/5669 and to see more extended
  examples, see
  `CLIPForZeroShotClassificationTestSpec <https://github.com/JohnSnowLabs/spark-nlp/blob/master/src/test/scala/com/johnsnowlabs/nlp/annotators/cv/CLIPForZeroShotClassificationTestSpec.scala>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``IMAGE``              ``CATEGORY``
  ====================== ======================
  
  Parameters
  ----------
  batchSize
      Batch size, by default `2`.
  candidateLabels
      Array of labels for classification
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> imageDF = spark.read \
  ...     .format("image") \
  ...     .option("dropInvalid", value = True) \
  ...     .load("src/test/resources/image/")
  >>> imageAssembler = ImageAssembler() \
  ...     .setInputCol("image") \
  ...     .setOutputCol("image_assembler")
  >>> candidateLabels = [
  ...     "a photo of a bird",
  ...     "a photo of a cat",
  ...     "a photo of a dog",
  ...     "a photo of a hen",
  ...     "a photo of a hippo",
  ...     "a photo of a room",
  ...     "a photo of a tractor",
  ...     "a photo of an ostrich",
  ...     "a photo of an ox"]
  >>> imageClassifier = CLIPForZeroShotClassification \
  ...     .pretrained() \
  ...     .setInputCols(["image_assembler"]) \
  ...     .setOutputCol("label") \
  ...     .setCandidateLabels(candidateLabels)
  >>> pipeline = Pipeline().setStages([imageAssembler, imageClassifier])
  >>> pipelineDF = pipeline.fit(imageDF).transform(imageDF)
  >>> pipelineDF \
  ...   .selectExpr("reverse(split(image.origin, '/'))[0] as image_name", "label.result") \
  ...   .show(truncate=False)
  +-----------------+-----------------------+
  |image_name       |result                 |
  +-----------------+-----------------------+
  |palace.JPEG      |[a photo of a room]    |
  |egyptian_cat.jpeg|[a photo of a cat]     |
  |hippopotamus.JPEG|[a photo of a hippo]   |
  |hen.JPEG         |[a photo of a hen]     |
  |ostrich.JPEG     |[a photo of an ostrich]|
  |junco.JPEG       |[a photo of a bird]    |
  |bluetick.jpg     |[a photo of a dog]     |
  |chihuahua.jpg    |[a photo of a dog]     |
  |tractor.JPEG     |[a photo of a tractor] |
  |ox.JPEG          |[a photo of an ox]     |
  +-----------------+-----------------------+
docstr: Loads a locally saved model.
  
  Parameters
  ----------
  folder : str
      Folder of the saved model
  spark_session : pyspark.sql.SparkSession
      The current SparkSession
  
  Returns
  -------
  CLIPForZeroShotClassification
      The restored model
code: def loadSavedModel(folder, spark_session):
      """Loads a locally saved model.
  
      Parameters
      ----------
      folder : str
          Folder of the saved model
      spark_session : pyspark.sql.SparkSession
          The current SparkSession
  
      Returns
      -------
      CLIPForZeroShotClassification
          The restored model
      """
      from sparknlp.internal import _CLIPForZeroShotClassification
  
      jModel = _CLIPForZeroShotClassification(
          folder, spark_session._jsparkSession
      )._java_obj
      return CLIPForZeroShotClassification(java_model=jModel)
  
file_path: spark-nlp/python/sparknlp/annotator/cv/clip_for_zero_shot_classification.py
imports: from sparknlp.common import *
label_desc: Use image node_id 3 for calling the CLIPForZeroShotClassification obj's underlying member method code with example usage: obj.loadSavedModel(folder, spark_session) and returns: CLIPForZeroShotClassification