class_docstr: This transformer reconstructs a ``DOCUMENT`` type annotation from tokens,
  usually after these have been normalized, lemmatized, normalized, spell
  checked, etc, in order to use this document annotation in further
  annotators. Requires ``DOCUMENT`` and ``TOKEN`` type annotations as input.
  
  For more extended examples on document pre-processing see the
  `Examples <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/annotation/text/english/token-assembler/Assembling_Tokens_to_Documents.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``DOCUMENT, TOKEN``    ``DOCUMENT``
  ====================== ======================
  
  Parameters
  ----------
  preservePosition
      Whether to preserve the actual position of the tokens or reduce them to
      one space
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  
  First, the text is tokenized and cleaned
  
  >>> documentAssembler = DocumentAssembler() \
  ...    .setInputCol("text") \
  ...    .setOutputCol("document")
  >>> sentenceDetector = SentenceDetector() \
  ...    .setInputCols(["document"]) \
  ...    .setOutputCol("sentences")
  >>> tokenizer = Tokenizer() \
  ...    .setInputCols(["sentences"]) \
  ...    .setOutputCol("token")
  >>> normalizer = Normalizer() \
  ...    .setInputCols(["token"]) \
  ...    .setOutputCol("normalized") \
  ...    .setLowercase(False)
  >>> stopwordsCleaner = StopWordsCleaner() \
  ...    .setInputCols(["normalized"]) \
  ...    .setOutputCol("cleanTokens") \
  ...    .setCaseSensitive(False)
  
  Then the TokenAssembler turns the cleaned tokens into a ``DOCUMENT`` type
  structure.
  
  >>> tokenAssembler = TokenAssembler() \
  ...    .setInputCols(["sentences", "cleanTokens"]) \
  ...    .setOutputCol("cleanText")
  >>> data = spark.createDataFrame([["Spark NLP is an open-source text processing library for advanced natural language processing."]]) \
  ...    .toDF("text")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     sentenceDetector,
  ...     tokenizer,
  ...     normalizer,
  ...     stopwordsCleaner,
  ...     tokenAssembler
  ... ]).fit(data)
  >>> result = pipeline.transform(data)
  >>> result.select("cleanText").show(truncate=False)
  +---------------------------------------------------------------------------------------------------------------------------+
  |cleanText                                                                                                                  |
  +---------------------------------------------------------------------------------------------------------------------------+
  |[[document, 0, 80, Spark NLP opensource text processing library advanced natural language processing, [sentence -> 0], []]]|
  +---------------------------------------------------------------------------------------------------------------------------+
class_docstr_tok: ["This","transformer","reconstructs","a","``","DOCUMENT","``","type","annotation","from","tokens",",","usually","after","these","have","been","normalized",",","lemmatized",",","normalized",",","spell","checked",",","etc",",","in","order","to","use","this","document","annotation","in","further","annotators",".","Requires","``","DOCUMENT","``","and","``","TOKEN","``","type","annotations","as","input",".","For","more","extended","examples","on","document","pre-processing","see","the","`","Examples","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/blob\/master\/examples\/python\/annotation\/text\/english\/token-assembler\/Assembling_Tokens_to_Documents.ipynb",">","`","__",".","======================","======================","Input","Annotation","types","Output","Annotation","type","======================","======================","``","DOCUMENT",",","TOKEN","``","``","DOCUMENT","``","======================","======================","Parameters","--","--","--","--","--","preservePosition","Whether","to","preserve","the","actual","position","of","the","tokens","or","reduce","them","to","one","space","Examples","--","--","--","--",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","pyspark.ml","import","Pipeline","First",",","the","text","is","tokenized","and","cleaned",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","sentenceDetector","=","SentenceDetector","(",")","\\","...",".setInputCols","(","[","``","document","''","]",")","\\","...",".setOutputCol","(","``","sentences","''",")",">",">",">","tokenizer","=","Tokenizer","(",")","\\","...",".setInputCols","(","[","``","sentences","''","]",")","\\","...",".setOutputCol","(","``","token","''",")",">",">",">","normalizer","=","Normalizer","(",")","\\","...",".setInputCols","(","[","``","token","''","]",")","\\","...",".setOutputCol","(","``","normalized","''",")","\\","...",".setLowercase","(","False",")",">",">",">","stopwordsCleaner","=","StopWordsCleaner","(",")","\\","...",".setInputCols","(","[","``","normalized","''","]",")","\\","...",".setOutputCol","(","``","cleanTokens","''",")","\\","...",".setCaseSensitive","(","False",")","Then","the","TokenAssembler","turns","the","cleaned","tokens","into","a","``","DOCUMENT","``","type","structure",".",">",">",">","tokenAssembler","=","TokenAssembler","(",")","\\","...",".setInputCols","(","[","``","sentences","''",",","``","cleanTokens","''","]",")","\\","...",".setOutputCol","(","``","cleanText","''",")",">",">",">","data","=","spark.createDataFrame","(","[","[","``","Spark","NLP","is","an","open-source","text","processing","library","for","advanced","natural","language","processing",".","''","]","]",")","\\","...",".toDF","(","``","text","''",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","...","documentAssembler",",","...","sentenceDetector",",","...","tokenizer",",","...","normalizer",",","...","stopwordsCleaner",",","...","tokenAssembler","...","]",")",".fit","(","data",")",">",">",">","result","=","pipeline.transform","(","data",")",">",">",">","result.select","(","``","cleanText","''",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|cleanText","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","[","[","document",",","0",",","80",",","Spark","NLP","opensource","text","processing","library","advanced","natural","language","processing",",","[","sentence","-",">","0","]",",","[","]","]","]","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+"]
code: def setParams(self):
      kwargs = self._input_kwargs
      return self._set(**kwargs)
  
file_path: spark-nlp/python/sparknlp/base/token_assembler.py
imports: from pyspark import keyword_only
  from pyspark.ml.param import TypeConverters, Params, Param
  from sparknlp.common.annotator_type import AnnotatorType
  from sparknlp.internal import AnnotatorTransformer
  from sparknlp.common import AnnotatorProperties
label_desc: Use image node_id 2 for calling the TokenAssembler obj's underlying member method code with example usage: obj.setParams() and returns: self