class_docstr: Trains a SentimentDL, an annotator for multi-class sentiment analysis.
  
  In natural language processing, sentiment analysis is the task of
  classifying the affective state or subjective view of a text. A common
  example is if either a product review or tweet can be interpreted positively
  or negatively.
  
  For the instantiated/pretrained models, see :class:`.SentimentDLModel`.
  
  Setting a test dataset to monitor model metrics can be done with
  ``.setTestDataset``. The method expects a path to a parquet file containing a
  dataframe that has the same required columns as the training dataframe. The
  pre-processing steps for the training dataframe should also be applied to the test
  dataframe. The following example will show how to create the test dataset:
  
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> embeddings = UniversalSentenceEncoder.pretrained() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("sentence_embeddings")
  >>> preProcessingPipeline = Pipeline().setStages([documentAssembler, embeddings])
  >>> (train, test) = data.randomSplit([0.8, 0.2])
  >>> preProcessingPipeline \
  ...     .fit(test) \
  ...     .transform(test)
  ...     .write \
  ...     .mode("overwrite") \
  ...     .parquet("test_data")
  >>> classifier = SentimentDLApproach() \
  ...     .setInputCols(["sentence_embeddings"]) \
  ...     .setOutputCol("sentiment") \
  ...     .setLabelColumn("label") \
  ...     .setTestDataset("test_data")
  
  For extended examples of usage, see the `Examples <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/training/english/classification/SentimentDL_train_multiclass_sentiment_classifier.ipynb>`__.
  
  ======================= ======================
  Input Annotation types  Output Annotation type
  ======================= ======================
  ``SENTENCE_EMBEDDINGS`` ``CATEGORY``
  ======================= ======================
  
  Parameters
  ----------
  batchSize
      Batch size, by default 64
  configProtoBytes
      ConfigProto from tensorflow, serialized into byte array.
  dropout
      Dropout coefficient, by default 0.5
  enableOutputLogs
      Whether to use stdout in addition to Spark logs, by default False
  evaluationLogExtended
      Whether logs for validation to be extended: it displays time and evaluation of
      each label. Default is False.
  labelColumn
      Column with label per each token
  lr
      Learning Rate, by default 0.005
  maxEpochs
      Maximum number of epochs to train, by default 30
  outputLogsPath
      Folder path to save training logs
  randomSeed
      Random seed
  testDataset
      Path to test dataset. If set used to calculate statistic on it during training.
  threshold
      The minimum threshold for the final result otheriwse it will be neutral,
      by default 0.6
  thresholdLabel
      In case the score is less than threshold, what should be the label, by default
      "neutral"
  validationSplit
      Choose the proportion of training dataset to be validated against the
      model on each Epoch. The value should be between 0.0 and 1.0 and by
      default it is 0.0 and off.
  verbose
      Level of verbosity during training
  
  Notes
  -----
  - This annotator accepts a label column of a single item in either type of
    String, Int, Float, or Double. So positive sentiment can be expressed as
    either ``"positive"`` or ``0``, negative sentiment as ``"negative"`` or
    ``1``.
  - UniversalSentenceEncoder, BertSentenceEmbeddings, or SentenceEmbeddings
    can be used for the ``inputCol``.
  
  Examples
  --------
  In this example, ``sentiment.csv`` is in the form::
  
      text,label
      This movie is the best movie I have watched ever! In my opinion this movie can win an award.,0
      This was a terrible movie! The acting was bad really bad!,1
  
  The model can then be trained with
  
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> smallCorpus = spark.read.option("header", "True").csv("src/test/resources/classifier/sentiment.csv")
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> useEmbeddings = UniversalSentenceEncoder.pretrained() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("sentence_embeddings")
  >>> docClassifier = SentimentDLApproach() \
  ...     .setInputCols(["sentence_embeddings"]) \
  ...     .setOutputCol("sentiment") \
  ...     .setLabelColumn("label") \
  ...     .setBatchSize(32) \
  ...     .setMaxEpochs(1) \
  ...     .setLr(5e-3) \
  ...     .setDropout(0.5)
  >>> pipeline = Pipeline().setStages([
  ...         documentAssembler,
  ...         useEmbeddings,
  ...         docClassifier
  ... ])
  >>> pipelineModel = pipeline.fit(smallCorpus)
class_docstr_tok: ["Trains","a","SentimentDL",",","an","annotator","for","multi-class","sentiment","analysis",".","In","natural","language","processing",",","sentiment","analysis","is","the","task","of","classifying","the","affective","state","or","subjective","view","of","a","text",".","A","common","example","is","if","either","a","product","review","or","tweet","can","be","interpreted","positively","or","negatively",".","For","the","instantiated\/pretrained","models",",","see",":","class",":","`",".SentimentDLModel","`",".","Setting","a","test","dataset","to","monitor","model","metrics","can","be","done","with","``",".setTestDataset","``",".","The","method","expects","a","path","to","a","parquet","file","containing","a","dataframe","that","has","the","same","required","columns","as","the","training","dataframe",".","The","pre-processing","steps","for","the","training","dataframe","should","also","be","applied","to","the","test","dataframe",".","The","following","example","will","show","how","to","create","the","test","dataset",":",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","embeddings","=","UniversalSentenceEncoder.pretrained","(",")","\\","...",".setInputCols","(","[","``","document","''","]",")","\\","...",".setOutputCol","(","``","sentence_embeddings","''",")",">",">",">","preProcessingPipeline","=","Pipeline","(",")",".setStages","(","[","documentAssembler",",","embeddings","]",")",">",">",">","(","train",",","test",")","=","data.randomSplit","(","[","0.8",",","0.2","]",")",">",">",">","preProcessingPipeline","\\","...",".fit","(","test",")","\\","...",".transform","(","test",")","...",".write","\\","...",".mode","(","``","overwrite","''",")","\\","...",".parquet","(","``","test_data","''",")",">",">",">","classifier","=","SentimentDLApproach","(",")","\\","...",".setInputCols","(","[","``","sentence_embeddings","''","]",")","\\","...",".setOutputCol","(","``","sentiment","''",")","\\","...",".setLabelColumn","(","``","label","''",")","\\","...",".setTestDataset","(","``","test_data","''",")","For","extended","examples","of","usage",",","see","the","`","Examples","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/blob\/master\/examples\/python\/training\/english\/classification\/SentimentDL_train_multiclass_sentiment_classifier.ipynb",">","`","__",".","=======================","======================","Input","Annotation","types","Output","Annotation","type","=======================","======================","``","SENTENCE_EMBEDDINGS","``","``","CATEGORY","``","=======================","======================","Parameters","--","--","--","--","--","batchSize","Batch","size",",","by","default","64","configProtoBytes","ConfigProto","from","tensorflow",",","serialized","into","byte","array",".","dropout","Dropout","coefficient",",","by","default","0.5","enableOutputLogs","Whether","to","use","stdout","in","addition","to","Spark","logs",",","by","default","False","evaluationLogExtended","Whether","logs","for","validation","to","be","extended",":","it","displays","time","and","evaluation","of","each","label",".","Default","is","False",".","labelColumn","Column","with","label","per","each","token","lr","Learning","Rate",",","by","default","0.005","maxEpochs","Maximum","number","of","epochs","to","train",",","by","default","30","outputLogsPath","Folder","path","to","save","training","logs","randomSeed","Random","seed","testDataset","Path","to","test","dataset",".","If","set","used","to","calculate","statistic","on","it","during","training",".","threshold","The","minimum","threshold","for","the","final","result","otheriwse","it","will","be","neutral",",","by","default","0.6","thresholdLabel","In","case","the","score","is","less","than","threshold",",","what","should","be","the","label",",","by","default","``","neutral","''","validationSplit","Choose","the","proportion","of","training","dataset","to","be","validated","against","the","model","on","each","Epoch",".","The","value","should","be","between","0.0","and","1.0","and","by","default","it","is","0.0","and","off",".","verbose","Level","of","verbosity","during","training","Notes","--","--","-","-","This","annotator","accepts","a","label","column","of","a","single","item","in","either","type","of","String",",","Int",",","Float",",","or","Double",".","So","positive","sentiment","can","be","expressed","as","either","``","``","positive","''","``","or","``","0","``",",","negative","sentiment","as","``","``","negative","''","``","or","``","1","``",".","-","UniversalSentenceEncoder",",","BertSentenceEmbeddings",",","or","SentenceEmbeddings","can","be","used","for","the","``","inputCol","``",".","Examples","--","--","--","--","In","this","example",",","``","sentiment.csv","``","is","in","the","form",":",":","text",",","label","This","movie","is","the","best","movie","I","have","watched","ever","!","In","my","opinion","this","movie","can","win","an","award.,0","This","was","a","terrible","movie","!","The","acting","was","bad","really","bad","!",",1","The","model","can","then","be","trained","with",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","pyspark.ml","import","Pipeline",">",">",">","smallCorpus","=","spark.read.option","(","``","header","''",",","``","True","''",")",".csv","(","``","src\/test\/resources\/classifier\/sentiment.csv","''",")",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","useEmbeddings","=","UniversalSentenceEncoder.pretrained","(",")","\\","...",".setInputCols","(","[","``","document","''","]",")","\\","...",".setOutputCol","(","``","sentence_embeddings","''",")",">",">",">","docClassifier","=","SentimentDLApproach","(",")","\\","...",".setInputCols","(","[","``","sentence_embeddings","''","]",")","\\","...",".setOutputCol","(","``","sentiment","''",")","\\","...",".setLabelColumn","(","``","label","''",")","\\","...",".setBatchSize","(","32",")","\\","...",".setMaxEpochs","(","1",")","\\","...",".setLr","(","5e-3",")","\\","...",".setDropout","(","0.5",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","useEmbeddings",",","...","docClassifier","...","]",")",">",">",">","pipelineModel","=","pipeline.fit","(","smallCorpus",")"]
docstr: Sets what the label should be, if the score is less than threshold,
  by default "neutral".
  
  Parameters
  ----------
  p : str
      The label, if the score is less than threshold
docstr_tok: ["Sets","what","the","label","should","be",",","if","the","score","is","less","than","threshold",",","by","default","``","neutral","''",".","Parameters","--","--","--","--","--","p",":","str","The","label",",","if","the","score","is","less","than","threshold"]
code: def setThresholdLabel(self, p):
      """Sets what the label should be, if the score is less than threshold,
      by default "neutral".
  
      Parameters
      ----------
      p : str
          The label, if the score is less than threshold
      """
      return self._set(thresholdLabel=p)
  
file_path: spark-nlp/python/sparknlp/annotator/classifier_dl/sentiment_dl.py
imports: from sparknlp.annotator.param import EvaluationDLParams, ClassifierEncoder
  from sparknlp.common import *
label_desc: Use image node_id 3 for calling the SentimentDLApproach obj's underlying member method code with example usage: obj.setThresholdLabel(p) and returns: self