class_docstr: The DeBERTa model was proposed in DeBERTa: Decoding-enhanced BERT with
  Disentangled Attention by Pengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu
  Chen It is based on Google’s BERT model released in 2018 and Facebook’s
  RoBERTa model released in 2019.
  
  This model requires input tokenization with
  SentencePiece model, which is provided by Spark NLP (See tokenizers
  package).
  
  It builds on RoBERTa with disentangled attention and enhanced mask decoder
  training with half of the data used in RoBERTa.
  
  Pretrained models can be loaded with pretrained of the companion object:
  
  >>> embeddings = DeBertaEmbeddings.pretrained() \
  ...    .setInputCols(["sentence", "token"]) \
  ...    .setOutputCol("embeddings")
  
  The default model is ``"deberta_v3_base"``, if no name is provided.
  
  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``    ``WORD_EMBEDDINGS``
  ====================== ======================
  
  Parameters
  ----------
  batchSize
      Size of every batch, by default 8
  dimension
      Number of embedding dimensions, by default 768
  caseSensitive
      Whether to ignore case in tokens for embeddings matching, by default
      False
  configProtoBytes
      ConfigProto from tensorflow, serialized into byte array.
  maxSentenceLength
      Max sentence length to process, by default 128
  
  References
  ----------
  https://github.com/microsoft/DeBERTa
  
  https://www.microsoft.com/en-us/research/blog/microsoft-deberta-surpasses-human-performance-on-the-superglue-benchmark/
  
  **Paper abstract:**
  
  *Paper abstract: Recent progress in pre-trained neural language models has
  significantly improved the performance of many natural language processing
  (NLP) tasks. In this paper we propose a new model architecture DeBERTa (
  Decoding-enhanced BERT with disentangled attention) that improves the BERT
  and RoBERTa models using two novel techniques. The first is the disentangled
  attention mechanism, where each word is represented using two vectors that
  encode its content and position, respectively, and the attention weights
  among words are computed using disentangled matrices on their contents and
  relative positions. Second, an enhanced mask decoder is used to replace the
  output softmax layer to predict the masked tokens for model pretraining. We
  show that these two techniques significantly improve the efficiency of model
  pretraining and performance of downstream tasks. Compared to RoBERTa-Large,
  a DeBERTa model trained on half of the training data performs consistently
  better on a wide range of NLP tasks, achieving improvements on MNLI by +0.9%
  (90.2% vs. 91.1%), on SQuAD v2.0 by +2.3% (88.4% vs. 90.7%) and RACE by
  +3.6% (83.2% vs. 86.8%). The DeBERTa code and pre-trained models will be
  made publicly available at https://github.com/microsoft/DeBERTa.*
  
  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"]) \
  >>> embeddings = DeBertaEmbeddings.pretrained() \
  ...     .setInputCols(["token", "document"]) \
  ...     .setOutputCol("embeddings")
  >>> embeddingsFinisher = EmbeddingsFinisher() \
  ...     .setInputCols(["embeddings"]) \
  ...     .setOutputCols("finished_embeddings") \
  ...     .setOutputAsVector(True) \
  ...     .setCleanAnnotations(False)
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     tokenizer,
  ...     embeddings,
  ...     embeddingsFinisher
  ... ])
  >>> data = spark.createDataFrame([["This is a sentence."]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.selectExpr("explode(finished_embeddings) as result").show(5, 80)
  +--------------------------------------------------------------------------------+
  |                                                                          result|
  +--------------------------------------------------------------------------------+
  |[1.1342473030090332,-1.3855540752410889,0.9818322062492371,-0.784737348556518...|
  |[0.847029983997345,-1.047153353691101,-0.1520637571811676,-0.6245765686035156...|
  |[-0.009860038757324219,-0.13450059294700623,2.707749128341675,1.2916892766952...|
  |[-0.04192575812339783,-0.5764210224151611,-0.3196685314178467,-0.527840495109...|
  |[0.15583214163780212,-0.1614152491092682,-0.28423872590065,-0.135491415858268...|
  +--------------------------------------------------------------------------------+
class_docstr_tok: ["The","DeBERTa","model","was","proposed","in","DeBERTa",":","Decoding-enhanced","BERT","with","Disentangled","Attention","by","Pengcheng","He",",","Xiaodong","Liu",",","Jianfeng","Gao",",","Weizhu","Chen","It","is","based","on","Google","\u2019","s","BERT","model","released","in","2018","and","Facebook","\u2019","s","RoBERTa","model","released","in","2019",".","This","model","requires","input","tokenization","with","SentencePiece","model",",","which","is","provided","by","Spark","NLP","(","See","tokenizers","package",")",".","It","builds","on","RoBERTa","with","disentangled","attention","and","enhanced","mask","decoder","training","with","half","of","the","data","used","in","RoBERTa",".","Pretrained","models","can","be","loaded","with","pretrained","of","the","companion","object",":",">",">",">","embeddings","=","DeBertaEmbeddings.pretrained","(",")","\\","...",".setInputCols","(","[","``","sentence","''",",","``","token","''","]",")","\\","...",".setOutputCol","(","``","embeddings","''",")","The","default","model","is","``","``","deberta_v3_base","''","``",",","if","no","name","is","provided",".","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","``","``","WORD_EMBEDDINGS","``","======================","======================","Parameters","--","--","--","--","--","batchSize","Size","of","every","batch",",","by","default","8","dimension","Number","of","embedding","dimensions",",","by","default","768","caseSensitive","Whether","to","ignore","case","in","tokens","for","embeddings","matching",",","by","default","False","configProtoBytes","ConfigProto","from","tensorflow",",","serialized","into","byte","array",".","maxSentenceLength","Max","sentence","length","to","process",",","by","default","128","References","--","--","--","--","--","https",":","\/\/github.com\/microsoft\/DeBERTa","https",":","\/\/www.microsoft.com\/en-us\/research\/blog\/microsoft-deberta-surpasses-human-performance-on-the-superglue-benchmark\/","*","*","Paper","abstract",":","*","*","*","Paper","abstract",":","Recent","progress","in","pre-trained","neural","language","models","has","significantly","improved","the","performance","of","many","natural","language","processing","(","NLP",")","tasks",".","In","this","paper","we","propose","a","new","model","architecture","DeBERTa","(","Decoding-enhanced","BERT","with","disentangled","attention",")","that","improves","the","BERT","and","RoBERTa","models","using","two","novel","techniques",".","The","first","is","the","disentangled","attention","mechanism",",","where","each","word","is","represented","using","two","vectors","that","encode","its","content","and","position",",","respectively",",","and","the","attention","weights","among","words","are","computed","using","disentangled","matrices","on","their","contents","and","relative","positions",".","Second",",","an","enhanced","mask","decoder","is","used","to","replace","the","output","softmax","layer","to","predict","the","masked","tokens","for","model","pretraining",".","We","show","that","these","two","techniques","significantly","improve","the","efficiency","of","model","pretraining","and","performance","of","downstream","tasks",".","Compared","to","RoBERTa-Large",",","a","DeBERTa","model","trained","on","half","of","the","training","data","performs","consistently","better","on","a","wide","range","of","NLP","tasks",",","achieving","improvements","on","MNLI","by","+0.9","%","(","90.2","%","vs.","91.1","%",")",",","on","SQuAD","v2.0","by","+2.3","%","(","88.4","%","vs.","90.7","%",")","and","RACE","by","+3.6","%","(","83.2","%","vs.","86.8","%",")",".","The","DeBERTa","code","and","pre-trained","models","will","be","made","publicly","available","at","https",":","\/\/github.com\/microsoft\/DeBERTa",".","*","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","''","]",")","\\",">",">",">","embeddings","=","DeBertaEmbeddings.pretrained","(",")","\\","...",".setInputCols","(","[","``","token","''",",","``","document","''","]",")","\\","...",".setOutputCol","(","``","embeddings","''",")",">",">",">","embeddingsFinisher","=","EmbeddingsFinisher","(",")","\\","...",".setInputCols","(","[","``","embeddings","''","]",")","\\","...",".setOutputCols","(","``","finished_embeddings","''",")","\\","...",".setOutputAsVector","(","True",")","\\","...",".setCleanAnnotations","(","False",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","tokenizer",",","...","embeddings",",","...","embeddingsFinisher","...","]",")",">",">",">","data","=","spark.createDataFrame","(","[","[","``","This","is","a","sentence",".","``","]","]",")",".toDF","(","``","text","''",")",">",">",">","result","=","pipeline.fit","(","data",")",".transform","(","data",")",">",">",">","result.selectExpr","(","``","explode","(","finished_embeddings",")","as","result","''",")",".show","(","5",",","80",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","result|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","[","1.1342473030090332",",","-1.3855540752410889,0.9818322062492371",",","-0.784737348556518","...","|","|","[","0.847029983997345",",","-1.047153353691101",",","-0.1520637571811676",",","-0.6245765686035156","...","|","|","[","-0.009860038757324219",",","-0.13450059294700623,2.707749128341675,1.2916892766952","...","|","|","[","-0.04192575812339783",",","-0.5764210224151611",",","-0.3196685314178467",",","-0.527840495109","...","|","|","[","0.15583214163780212",",","-0.1614152491092682",",","-0.28423872590065",",","-0.135491415858268","...","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+"]
docstr: Loads a locally saved model.
  
  Parameters
  ----------
  folder : str
      Folder of the saved model
  spark_session : pyspark.sql.SparkSession
      The current SparkSession
  
  Returns
  -------
  DeBertaEmbeddings
      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","--","--","--","-","DeBertaEmbeddings","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
      -------
      DeBertaEmbeddings
          The restored model
      """
      from sparknlp.internal import _DeBERTaLoader
  
      jModel = _DeBERTaLoader(
          folder, spark_session._jsparkSession
      )._java_obj
      return DeBertaEmbeddings(java_model=jModel)
  
file_path: spark-nlp/python/sparknlp/annotator/embeddings/deberta_embeddings.py
imports: from sparknlp.common import *
label_desc: Use image node_id 3 for calling the DeBertaEmbeddings obj's underlying member method code with example usage: obj.loadSavedModel(folder, spark_session) and returns: DeBertaEmbeddings