class_docstr: BertForSequenceClassification can load Bert Models with sequence classification/regression head on top
  (a linear layer on top of the pooled output) e.g. for multi-class document classification tasks.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> sequenceClassifier = BertForSequenceClassification.pretrained() \
  ...     .setInputCols(["token", "document"]) \
  ...     .setOutputCol("label")
  
  The default model is ``"bert_base_sequence_classifier_imdb"``, if no name is
  provided.
  
  For available pretrained models please see the `Models Hub
  <https://sparknlp.org/models?task=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 = BertForSequenceClassification.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: Instead of 1 class per sentence (if inputCols is '''sentence''') output 1 class per document by averaging probabilities in all sentences.
  Due to max sequence length limit in almost all transformer models such as BERT (512 tokens), this parameter helps feeding all the sentences
  into the model and averaging all the probabilities for the entire document instead of probabilities per sentence. (Default: true)
  
  Parameters
  ----------
  value : bool
      If the output of all sentences will be averaged to one output
docstr_tok: ["Instead","of","1","class","per","sentence","(","if","inputCols","is","``","'sentence","''","'",")","output","1","class","per","document","by","averaging","probabilities","in","all","sentences",".","Due","to","max","sequence","length","limit","in","almost","all","transformer","models","such","as","BERT","(","512","tokens",")",",","this","parameter","helps","feeding","all","the","sentences","into","the","model","and","averaging","all","the","probabilities","for","the","entire","document","instead","of","probabilities","per","sentence",".","(","Default",":","true",")","Parameters","--","--","--","--","--","value",":","bool","If","the","output","of","all","sentences","will","be","averaged","to","one","output"]
code: def setCoalesceSentences(self, value):
      """Instead of 1 class per sentence (if inputCols is '''sentence''') output 1 class per document by averaging probabilities in all sentences.
      Due to max sequence length limit in almost all transformer models such as BERT (512 tokens), this parameter helps feeding all the sentences
      into the model and averaging all the probabilities for the entire document instead of probabilities per sentence. (Default: true)
  
      Parameters
      ----------
      value : bool
          If the output of all sentences will be averaged to one output
      """
      return self._set(coalesceSentences=value)
  
file_path: spark-nlp/python/sparknlp/annotator/classifier_dl/bert_for_sequence_classification.py
imports: from sparknlp.common import *
label_desc: Use image node_id 3 for calling the BertForSequenceClassification obj's underlying member method code with example usage: obj.setCoalesceSentences(value) and returns: self