class_docstr: XlmRoBertaForZeroShotClassification using a `ModelForSequenceClassification` trained on NLI (natural language
  inference) tasks. Equivalent of `XlmRoBertaForSequenceClassification` models, but these models don't require a hardcoded
  number of potential classes, they can be chosen at runtime. It usually means it's slower but it is much more
  flexible.
  
  Note that the model will loop through all provided labels. So the more labels you have, the
  longer this process will take.
  
  Any combination of sequences and labels can be passed and each combination will be posed as a premise/hypothesis
  pair and passed to the pretrained model.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> sequenceClassifier = XlmRoBertaForZeroShotClassification.pretrained() \
  ...     .setInputCols(["token", "document"]) \
  ...     .setOutputCol("label")
  
  The default model is ``"xlm_roberta_large_zero_shot_classifier_xnli_anli"``, if no name is
  provided.
  
  For available pretrained models please see the `Models Hub
  <https://sparknlp.orgtask=Text+Classification>`__.
  
  To see which models are compatible and how to import them see
  `Import Transformers into Spark NLP 🚀
  <https://github.com/JohnSnowLabs/spark-nlp/discussions/5669>`_.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``DOCUMENT, TOKEN``    ``CATEGORY``
  ====================== ======================
  
  Parameters
  ----------
  batchSize
      Batch size. Large values allows faster processing but requires more
      memory, by default 8
  caseSensitive
      Whether to ignore case in tokens for embeddings matching, by default
      True
  configProtoBytes
      ConfigProto from tensorflow, serialized into byte array.
  maxSentenceLength
      Max sentence length to process, by default 128
  coalesceSentences
      Instead of 1 class per sentence (if inputCols is `sentence`) output 1
      class per document by averaging probabilities in all sentences, by
      default False
  activation
      Whether to calculate logits via Softmax or Sigmoid, by default
      `"softmax"`.
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> tokenizer = Tokenizer() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("token")
  >>> sequenceClassifier = XlmRoBertaForZeroShotClassification.pretrained() \
  ...     .setInputCols(["token", "document"]) \
  ...     .setOutputCol("label") \
  ...     .setCaseSensitive(True)
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     tokenizer,
  ...     sequenceClassifier
  ... ])
  >>> data = spark.createDataFrame([["I loved this movie when I was a child.", "It was pretty boring."]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.select("label.result").show(truncate=False)
  +------+
  |result|
  +------+
  |[pos] |
  |[neg] |
  +------+
class_docstr_tok: ["XlmRoBertaForZeroShotClassification","using","a","`","ModelForSequenceClassification","`","trained","on","NLI","(","natural","language","inference",")","tasks",".","Equivalent","of","`","XlmRoBertaForSequenceClassification","`","models",",","but","these","models","do","n't","require","a","hardcoded","number","of","potential","classes",",","they","can","be","chosen","at","runtime",".","It","usually","means","it","'s","slower","but","it","is","much","more","flexible",".","Note","that","the","model","will","loop","through","all","provided","labels",".","So","the","more","labels","you","have",",","the","longer","this","process","will","take",".","Any","combination","of","sequences","and","labels","can","be","passed","and","each","combination","will","be","posed","as","a","premise\/hypothesis","pair","and","passed","to","the","pretrained","model",".","Pretrained","models","can","be","loaded","with",":","meth",":","`",".pretrained","`","of","the","companion","object",":",">",">",">","sequenceClassifier","=","XlmRoBertaForZeroShotClassification.pretrained","(",")","\\","...",".setInputCols","(","[","``","token","''",",","``","document","''","]",")","\\","...",".setOutputCol","(","``","label","''",")","The","default","model","is","``","``","xlm_roberta_large_zero_shot_classifier_xnli_anli","''","``",",","if","no","name","is","provided",".","For","available","pretrained","models","please","see","the","`","Models","Hub","<","https",":","\/\/sparknlp.orgtask=Text+Classification",">","`","__",".","To","see","which","models","are","compatible","and","how","to","import","them","see","`","Import","Transformers","into","Spark","NLP","\ud83d\ude80","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/discussions\/5669",">","`","_",".","======================","======================","Input","Annotation","types","Output","Annotation","type","======================","======================","``","DOCUMENT",",","TOKEN","``","``","CATEGORY","``","======================","======================","Parameters","--","--","--","--","--","batchSize","Batch","size",".","Large","values","allows","faster","processing","but","requires","more","memory",",","by","default","8","caseSensitive","Whether","to","ignore","case","in","tokens","for","embeddings","matching",",","by","default","True","configProtoBytes","ConfigProto","from","tensorflow",",","serialized","into","byte","array",".","maxSentenceLength","Max","sentence","length","to","process",",","by","default","128","coalesceSentences","Instead","of","1","class","per","sentence","(","if","inputCols","is","`","sentence","`",")","output","1","class","per","document","by","averaging","probabilities","in","all","sentences",",","by","default","False","activation","Whether","to","calculate","logits","via","Softmax","or","Sigmoid",",","by","default","`","``","softmax","''","`",".","Examples","--","--","--","--",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","pyspark.ml","import","Pipeline",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","tokenizer","=","Tokenizer","(",")","\\","...",".setInputCols","(","[","``","document","''","]",")","\\","...",".setOutputCol","(","``","token","''",")",">",">",">","sequenceClassifier","=","XlmRoBertaForZeroShotClassification.pretrained","(",")","\\","...",".setInputCols","(","[","``","token","''",",","``","document","''","]",")","\\","...",".setOutputCol","(","``","label","''",")","\\","...",".setCaseSensitive","(","True",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","tokenizer",",","...","sequenceClassifier","...","]",")",">",">",">","data","=","spark.createDataFrame","(","[","[","``","I","loved","this","movie","when","I","was","a","child",".","``",",","``","It","was","pretty","boring",".","``","]","]",")",".toDF","(","``","text","''",")",">",">",">","result","=","pipeline.fit","(","data",")",".transform","(","data",")",">",">",">","result.select","(","``","label.result","''",")",".show","(","truncate=False",")","+","--","--","--","+","|result|","+","--","--","--","+","|","[","pos","]","|","|","[","neg","]","|","+","--","--","--","+"]
docstr: Loads a locally saved model.
  
  Parameters
  ----------
  folder : str
      Folder of the saved model
      spark_session : pyspark.sql.SparkSession
      The current SparkSession
  
  Returns
  -------
  XlmRoBertaForZeroShotClassification
      The restored model
docstr_tok: ["Loads","a","locally","saved","model",".","Parameters","--","--","--","--","--","folder",":","str","Folder","of","the","saved","model","spark_session",":","pyspark.sql.SparkSession","The","current","SparkSession","Returns","--","--","--","-","XlmRoBertaForZeroShotClassification","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
      -------
      XlmRoBertaForZeroShotClassification
          The restored model
      """
      from sparknlp.internal import _XlmRoBertaForZeroShotClassification
  
      jModel = _XlmRoBertaForZeroShotClassification(
          folder, spark_session._jsparkSession
      )._java_obj
      return XlmRoBertaForZeroShotClassification(java_model=jModel)
  
file_path: spark-nlp/python/sparknlp/annotator/classifier_dl/xlm_roberta_for_zero_shot_classification.py
imports: from sparknlp.common import *
label_desc: Use image node_id 6 for calling the XlmRoBertaForZeroShotClassification obj's underlying member method code with example usage: obj.loadSavedModel(folder, spark_session) and returns: XlmRoBertaForZeroShotClassification