class_docstr: WordSegmenter which tokenizes non-english or non-whitespace separated
  texts.
  
  Many languages are not whitespace separated and their sentences are a
  concatenation of many symbols, like Korean, Japanese or Chinese. Without
  understanding the language, splitting the words into their corresponding
  tokens is impossible. The WordSegmenter is trained to understand these
  languages and plit them into semantically correct parts.
  
  This is the instantiated model of the :class:`.WordSegmenterApproach`. For
  training your own model, please see the documentation of that class.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> wordSegmenter = WordSegmenterModel.pretrained() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("words_segmented")
  
  The default model is ``"wordseg_pku"``, default language is ``"zh"``, if no
  values are provided. For available pretrained models please see the `Models
  Hub <https://sparknlp.org/models?task=Word+Segmentation>`__.
  
  For extended examples of usage, see the `Examples
  <https://github.com/JohnSnowLabs/spark-nlp/blob/master/jupyter/annotation/chinese/word_segmentation/words_segmenter_demo.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``DOCUMENT``           ``TOKEN``
  ====================== ======================
  
  Parameters
  ----------
  None
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> wordSegmenter = WordSegmenterModel.pretrained() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("token")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     wordSegmenter
  ... ])
  >>> data = spark.createDataFrame([["然而，這樣的處理也衍生了一些問題。"]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.select("token.result").show(truncate=False)
  +--------------------------------------------------------+
  |result                                                  |
  +--------------------------------------------------------+
  |[然而, ，, 這樣, 的, 處理, 也, 衍生, 了, 一些, 問題, 。      ]|
  +--------------------------------------------------------+
docstr: Downloads and loads a pretrained model.
  
  Parameters
  ----------
  name : str, optional
      Name of the pretrained model, by default "wordseg_pku"
  lang : str, optional
      Language of the pretrained model, by default "en"
  remote_loc : str, optional
      Optional remote address of the resource, by default None. Will use
      Spark NLPs repositories otherwise.
  
  Returns
  -------
  WordSegmenterModel
      The restored model
docstr_tok: ["Downloads","and","loads","a","pretrained","model",".","Parameters","--","--","--","--","--","name",":","str",",","optional","Name","of","the","pretrained","model",",","by","default","``","wordseg_pku","''","lang",":","str",",","optional","Language","of","the","pretrained","model",",","by","default","``","en","''","remote_loc",":","str",",","optional","Optional","remote","address","of","the","resource",",","by","default","None",".","Will","use","Spark","NLPs","repositories","otherwise",".","Returns","--","--","--","-","WordSegmenterModel","The","restored","model"]
code: def pretrained(name="wordseg_pku", lang="zh", remote_loc=None):
      """Downloads and loads a pretrained model.
  
      Parameters
      ----------
      name : str, optional
          Name of the pretrained model, by default "wordseg_pku"
      lang : str, optional
          Language of the pretrained model, by default "en"
      remote_loc : str, optional
          Optional remote address of the resource, by default None. Will use
          Spark NLPs repositories otherwise.
  
      Returns
      -------
      WordSegmenterModel
          The restored model
      """
      from sparknlp.pretrained import ResourceDownloader
  
      return ResourceDownloader.downloadModel(
          WordSegmenterModel, name, lang, remote_loc
      )
  
imports: from sparknlp.common import *
label_desc: Use image node_id 5 for calling the WordSegmenterModel obj's underlying member method code with example usage: obj.pretrained(name, lang, remote_loc) and returns: ResourceDownloader