class_docstr: Implements a deep-learning based Noisy Channel Model Spell Algorithm.
  Correction candidates are extracted combining context information and word
  information.
  
  Spell Checking is a sequence to sequence mapping problem. Given an input
  sequence, potentially containing a certain number of errors,
  ``ContextSpellChecker`` will rank correction sequences according to three
  things:
  
  #. Different correction candidates for each word — **word level**.
  #. The surrounding text of each word, i.e. it’s context —
     **sentence level**.
  #. The relative cost of different correction candidates according to the
     edit operations at the character level it requires — **subword level**.
  
  This is the instantiated model of the :class:`.ContextSpellCheckerApproach`.
  For training your own model, please see the documentation of that class.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> spellChecker = ContextSpellCheckerModel.pretrained() \
  ...     .setInputCols(["token"]) \
  ...     .setOutputCol("checked")
  
  
  The default model is ``"spellcheck_dl"``, if no name is provided.
  For available pretrained models please see the `Models Hub <https://sparknlp.org/models?task=Spell+Check>`__.
  
  For extended examples of usage, see the `Examples <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/training/italian/Training_Context_Spell_Checker_Italian.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``TOKEN``              ``TOKEN``
  ====================== ======================
  
  Parameters
  ----------
  wordMaxDistance
      Maximum distance for the generated candidates for every word.
  maxCandidates
      Maximum number of candidates for every word.
  caseStrategy
      What case combinations to try when generating candidates.
  errorThreshold
      Threshold perplexity for a word to be considered as an error.
  tradeoff
      Tradeoff between the cost of a word error and a transition in the
      language model.
  maxWindowLen
      Maximum size for the window used to remember history prior to every
      correction.
  gamma
      Controls the influence of individual word frequency in the decision.
  correctSymbols
      Whether to correct special symbols or skip spell checking for them
  compareLowcase
      If true will compare tokens in low case with vocabulary.
  configProtoBytes
      ConfigProto from tensorflow, serialized into byte array.
  vocabFreq
      Frequency words from the vocabulary.
  idsVocab
      Mapping of ids to vocabulary.
  vocabIds
      Mapping of vocabulary to ids.
  classes
      Classes the spell checker recognizes.
  weights
      Levenshtein weights.
  useNewLines
      When set to true new lines will be treated as any other character. When set to false correction is applied on paragraphs as defined by newline characters.
  
  
  References
  -------------
  For an in-depth explanation of the module see the article `Applying Context
  Aware Spell Checking in Spark NLP
  <https://medium.com/spark-nlp/applying-context-aware-spell-checking-in-spark-nlp-3c29c46963bc>`__.
  
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("doc")
  >>> tokenizer = Tokenizer() \
  ...     .setInputCols(["doc"]) \
  ...     .setOutputCol("token")
  >>> spellChecker = ContextSpellCheckerModel \
  ...     .pretrained() \
  ...     .setTradeoff(12.0) \
  ...     .setInputCols("token") \
  ...     .setOutputCol("checked")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     tokenizer,
  ...     spellChecker
  ... ])
  >>> data = spark.createDataFrame([["It was a cold , dreary day and the country was white with smow ."]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.select("checked.result").show(truncate=False)
  +--------------------------------------------------------------------------------+
  |result                                                                          |
  +--------------------------------------------------------------------------------+
  |[It, was, a, cold, ,, dreary, day, and, the, country, was, white, with, snow, .]|
  +--------------------------------------------------------------------------------+
  
  See Also
  --------
  NorvigSweetingModel, SymmetricDeleteModel: For alternative approaches to spell checking
class_docstr_tok: ["Implements","a","deep-learning","based","Noisy","Channel","Model","Spell","Algorithm",".","Correction","candidates","are","extracted","combining","context","information","and","word","information",".","Spell","Checking","is","a","sequence","to","sequence","mapping","problem",".","Given","an","input","sequence",",","potentially","containing","a","certain","number","of","errors",",","``","ContextSpellChecker","``","will","rank","correction","sequences","according","to","three","things",":","#",".","Different","correction","candidates","for","each","word","\u2014","*","*","word","level","*","*",".","#",".","The","surrounding","text","of","each","word",",","i.e",".","it","\u2019","s","context","\u2014","*","*","sentence","level","*","*",".","#",".","The","relative","cost","of","different","correction","candidates","according","to","the","edit","operations","at","the","character","level","it","requires","\u2014","*","*","subword","level","*","*",".","This","is","the","instantiated","model","of","the",":","class",":","`",".ContextSpellCheckerApproach","`",".","For","training","your","own","model",",","please","see","the","documentation","of","that","class",".","Pretrained","models","can","be","loaded","with",":","meth",":","`",".pretrained","`","of","the","companion","object",":",">",">",">","spellChecker","=","ContextSpellCheckerModel.pretrained","(",")","\\","...",".setInputCols","(","[","``","token","''","]",")","\\","...",".setOutputCol","(","``","checked","''",")","The","default","model","is","``","``","spellcheck_dl","''","``",",","if","no","name","is","provided",".","For","available","pretrained","models","please","see","the","`","Models","Hub","<","https",":","\/\/sparknlp.org\/models","?","task=Spell+Check",">","`","__",".","For","extended","examples","of","usage",",","see","the","`","Examples","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/blob\/master\/examples\/python\/training\/italian\/Training_Context_Spell_Checker_Italian.ipynb",">","`","__",".","======================","======================","Input","Annotation","types","Output","Annotation","type","======================","======================","``","TOKEN","``","``","TOKEN","``","======================","======================","Parameters","--","--","--","--","--","wordMaxDistance","Maximum","distance","for","the","generated","candidates","for","every","word",".","maxCandidates","Maximum","number","of","candidates","for","every","word",".","caseStrategy","What","case","combinations","to","try","when","generating","candidates",".","errorThreshold","Threshold","perplexity","for","a","word","to","be","considered","as","an","error",".","tradeoff","Tradeoff","between","the","cost","of","a","word","error","and","a","transition","in","the","language","model",".","maxWindowLen","Maximum","size","for","the","window","used","to","remember","history","prior","to","every","correction",".","gamma","Controls","the","influence","of","individual","word","frequency","in","the","decision",".","correctSymbols","Whether","to","correct","special","symbols","or","skip","spell","checking","for","them","compareLowcase","If","true","will","compare","tokens","in","low","case","with","vocabulary",".","configProtoBytes","ConfigProto","from","tensorflow",",","serialized","into","byte","array",".","vocabFreq","Frequency","words","from","the","vocabulary",".","idsVocab","Mapping","of","ids","to","vocabulary",".","vocabIds","Mapping","of","vocabulary","to","ids",".","classes","Classes","the","spell","checker","recognizes",".","weights","Levenshtein","weights",".","useNewLines","When","set","to","true","new","lines","will","be","treated","as","any","other","character",".","When","set","to","false","correction","is","applied","on","paragraphs","as","defined","by","newline","characters",".","References","--","--","--","--","--","--","-","For","an","in-depth","explanation","of","the","module","see","the","article","`","Applying","Context","Aware","Spell","Checking","in","Spark","NLP","<","https",":","\/\/medium.com\/spark-nlp\/applying-context-aware-spell-checking-in-spark-nlp-3c29c46963bc",">","`","__",".","Examples","--","--","--","--",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","pyspark.ml","import","Pipeline",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","doc","''",")",">",">",">","tokenizer","=","Tokenizer","(",")","\\","...",".setInputCols","(","[","``","doc","''","]",")","\\","...",".setOutputCol","(","``","token","''",")",">",">",">","spellChecker","=","ContextSpellCheckerModel","\\","...",".pretrained","(",")","\\","...",".setTradeoff","(","12.0",")","\\","...",".setInputCols","(","``","token","''",")","\\","...",".setOutputCol","(","``","checked","''",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","tokenizer",",","...","spellChecker","...","]",")",">",">",">","data","=","spark.createDataFrame","(","[","[","``","It","was","a","cold",",","dreary","day","and","the","country","was","white","with","smow",".","``","]","]",")",".toDF","(","``","text","''",")",">",">",">","result","=","pipeline.fit","(","data",")",".transform","(","data",")",">",">",">","result.select","(","``","checked.result","''",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|result","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","[","It",",","was",",","a",",","cold",",",",",",","dreary",",","day",",","and",",","the",",","country",",","was",",","white",",","with",",","snow",",",".","]","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","See","Also","--","--","--","--","NorvigSweetingModel",",","SymmetricDeleteModel",":","For","alternative","approaches","to","spell","checking"]
docstr: Gets the classes of words to be corrected.
  
  Returns
  -------
  List[str]
      Classes of words to be corrected
docstr_tok: ["Gets","the","classes","of","words","to","be","corrected",".","Returns","--","--","--","-","List","[","str","]","Classes","of","words","to","be","corrected"]
code: def getWordClasses(self):
      """Gets the classes of words to be corrected.
  
      Returns
      -------
      List[str]
          Classes of words to be corrected
      """
      it = self._call_java("getWordClasses").toIterator()
      result = []
      while it.hasNext():
          result.append(it.next().toString())
      return result
  
imports: from sparknlp.common import *
label_desc: Use image node_id 14 for calling the ContextSpellCheckerModel obj's underlying member method code with example usage: obj.getWordClasses() and returns: result