class_docstr: Trains a deep-learning based Noisy Channel Model Spell Algorithm.
  
  Correction candidates are extracted combining context information and word
  information.
  
  For instantiated/pretrained models, see :class:`.ContextSpellCheckerModel`.
  
  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**.
  
  For extended examples of usage, see the article
  `Training a Contextual Spell Checker for Italian Language <https://towardsdatascience.com/training-a-contextual-spell-checker-for-italian-language-66dda528e4bf>`__,
  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
  ----------
  languageModelClasses
      Number of classes to use during factorization of the softmax output in
      the LM.
  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, by default 2.
      Possible values are:
  
      - 0: All uppercase letters
      - 1: First letter capitalized
      - 2: All letters
  errorThreshold
      Threshold perplexity for a word to be considered as an error.
  epochs
      Number of epochs to train the language model.
  batchSize
      Batch size for the training in NLM.
  initialRate
      Initial learning rate for the LM.
  finalRate
      Final learning rate for the LM.
  validationFraction
      Percentage of datapoints to use for validation.
  minCount
      Min number of times a token should appear to be included in vocab.
  compoundCount
      Min number of times a compound word should appear to be included in
      vocab.
  classCount
      Min number of times the word need to appear in corpus to not be
      considered of a special class.
  tradeoff
      Tradeoff between the cost of a word error and a transition in the
      language model.
  weightedDistPath
      The path to the file containing the weights for the levenshtein
      distance.
  maxWindowLen
      Maximum size for the window used to remember history prior to every
      correction.
  configProtoBytes
      ConfigProto from tensorflow, serialized into byte array.
  maxSentLen
      Maximum length for a sentence - internal use during training.
  graphFolder
      Folder path that contain external graph files.
  
  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
  
  For this example, we use the first Sherlock Holmes book as the training dataset.
  
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> tokenizer = Tokenizer() \
  ...     .setInputCols("document") \
  ...     .setOutputCol("token")
  >>> spellChecker = ContextSpellCheckerApproach() \
  ...     .setInputCols("token") \
  ...     .setOutputCol("corrected") \
  ...     .setWordMaxDistance(3) \
  ...     .setBatchSize(24) \
  ...     .setEpochs(8) \
  ...     .setLanguageModelClasses(1650)  # dependant on vocabulary size
  ...     # .addVocabClass("_NAME_", names) # Extra classes for correction could be added like this
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     tokenizer,
  ...     spellChecker
  ... ])
  >>> path = "sherlockholmes.txt"
  >>> dataset = spark.read.text(path) \
  ...     .toDF("text")
  >>> pipelineModel = pipeline.fit(dataset)
  
  See Also
  --------
  NorvigSweetingApproach, SymmetricDeleteApproach : For alternative approaches to spell checking
class_docstr_tok: ["Trains","a","deep-learning","based","Noisy","Channel","Model","Spell","Algorithm",".","Correction","candidates","are","extracted","combining","context","information","and","word","information",".","For","instantiated\/pretrained","models",",","see",":","class",":","`",".ContextSpellCheckerModel","`",".","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","*","*",".","For","extended","examples","of","usage",",","see","the","article","`","Training","a","Contextual","Spell","Checker","for","Italian","Language","<","https",":","\/\/towardsdatascience.com\/training-a-contextual-spell-checker-for-italian-language-66dda528e4bf",">","`","__",",","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","--","--","--","--","--","languageModelClasses","Number","of","classes","to","use","during","factorization","of","the","softmax","output","in","the","LM",".","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",",","by","default","2",".","Possible","values","are",":","-","0",":","All","uppercase","letters","-","1",":","First","letter","capitalized","-","2",":","All","letters","errorThreshold","Threshold","perplexity","for","a","word","to","be","considered","as","an","error",".","epochs","Number","of","epochs","to","train","the","language","model",".","batchSize","Batch","size","for","the","training","in","NLM",".","initialRate","Initial","learning","rate","for","the","LM",".","finalRate","Final","learning","rate","for","the","LM",".","validationFraction","Percentage","of","datapoints","to","use","for","validation",".","minCount","Min","number","of","times","a","token","should","appear","to","be","included","in","vocab",".","compoundCount","Min","number","of","times","a","compound","word","should","appear","to","be","included","in","vocab",".","classCount","Min","number","of","times","the","word","need","to","appear","in","corpus","to","not","be","considered","of","a","special","class",".","tradeoff","Tradeoff","between","the","cost","of","a","word","error","and","a","transition","in","the","language","model",".","weightedDistPath","The","path","to","the","file","containing","the","weights","for","the","levenshtein","distance",".","maxWindowLen","Maximum","size","for","the","window","used","to","remember","history","prior","to","every","correction",".","configProtoBytes","ConfigProto","from","tensorflow",",","serialized","into","byte","array",".","maxSentLen","Maximum","length","for","a","sentence","-","internal","use","during","training",".","graphFolder","Folder","path","that","contain","external","graph","files",".","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","For","this","example",",","we","use","the","first","Sherlock","Holmes","book","as","the","training","dataset",".",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","tokenizer","=","Tokenizer","(",")","\\","...",".setInputCols","(","``","document","''",")","\\","...",".setOutputCol","(","``","token","''",")",">",">",">","spellChecker","=","ContextSpellCheckerApproach","(",")","\\","...",".setInputCols","(","``","token","''",")","\\","...",".setOutputCol","(","``","corrected","''",")","\\","...",".setWordMaxDistance","(","3",")","\\","...",".setBatchSize","(","24",")","\\","...",".setEpochs","(","8",")","\\","...",".setLanguageModelClasses","(","1650",")","#","dependant","on","vocabulary","size","...","#",".addVocabClass","(","``","_NAME_","''",",","names",")","#","Extra","classes","for","correction","could","be","added","like","this",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","tokenizer",",","...","spellChecker","...","]",")",">",">",">","path","=","``","sherlockholmes.txt","''",">",">",">","dataset","=","spark.read.text","(","path",")","\\","...",".toDF","(","``","text","''",")",">",">",">","pipelineModel","=","pipeline.fit","(","dataset",")","See","Also","--","--","--","--","NorvigSweetingApproach",",","SymmetricDeleteApproach",":","For","alternative","approaches","to","spell","checking"]
docstr: Sets min number of times a token should appear to be included in
  vocab.
  
  Parameters
  ----------
  count : float
      Min number of times a token should appear to be included in vocab
docstr_tok: ["Sets","min","number","of","times","a","token","should","appear","to","be","included","in","vocab",".","Parameters","--","--","--","--","--","count",":","float","Min","number","of","times","a","token","should","appear","to","be","included","in","vocab"]
code: def setMinCount(self, count):
      """Sets min number of times a token should appear to be included in
      vocab.
  
      Parameters
      ----------
      count : float
          Min number of times a token should appear to be included in vocab
      """
      return self._set(minCount=count)
  
imports: from sparknlp.common import *
label_desc: Use image node_id 11 for calling the ContextSpellCheckerApproach obj's underlying member method code with example usage: obj.setMinCount(count) and returns: self