class_docstr: Averaged Perceptron model to tag words part-of-speech. Sets a POS tag to
  each word within a sentence.
  
  This is the instantiated model of the :class:`.PerceptronApproach`. For
  training your own model, please see the documentation of that class.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> posTagger = PerceptronModel.pretrained() \
  ...     .setInputCols(["document", "token"]) \
  ...     .setOutputCol("pos")
  
  
  The default model is ``"pos_anc"``, if no name is provided.
  
  For available pretrained models please see the `Models Hub
  <https://sparknlp.org/models?task=Part+of+Speech+Tagging>`__.
  Additionally, pretrained pipelines are available for this module, see
  `Pipelines <https://sparknlp.org/docs/en/pipelines>`__.
  
  For extended examples of usage, see the `Examples
  <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/training/french/Train-Perceptron-French.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``TOKEN, DOCUMENT``    ``POS``
  ====================== ======================
  
  Parameters
  ----------
  None
  
  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")
  >>> posTagger = PerceptronModel.pretrained() \
  ...     .setInputCols(["document", "token"]) \
  ...     .setOutputCol("pos")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     tokenizer,
  ...     posTagger
  ... ])
  >>> data = spark.createDataFrame([["Peter Pipers employees are picking pecks of pickled peppers"]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.selectExpr("explode(pos) as pos").show(truncate=False)
  +-------------------------------------------+
  |pos                                        |
  +-------------------------------------------+
  |[pos, 0, 4, NNP, [word -> Peter], []]      |
  |[pos, 6, 11, NNP, [word -> Pipers], []]    |
  |[pos, 13, 21, NNS, [word -> employees], []]|
  |[pos, 23, 25, VBP, [word -> are], []]      |
  |[pos, 27, 33, VBG, [word -> picking], []]  |
  |[pos, 35, 39, NNS, [word -> pecks], []]    |
  |[pos, 41, 42, IN, [word -> of], []]        |
  |[pos, 44, 50, JJ, [word -> pickled], []]   |
  |[pos, 52, 58, NNS, [word -> peppers], []]  |
  +-------------------------------------------+
docstr: Downloads and loads a pretrained model.
  
  Parameters
  ----------
  name : str, optional
      Name of the pretrained model, by default "pos_anc"
  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
  -------
  PerceptronModel
      The restored model
code: def pretrained(name="pos_anc", lang="en", remote_loc=None):
      """Downloads and loads a pretrained model.
  
      Parameters
      ----------
      name : str, optional
          Name of the pretrained model, by default "pos_anc"
      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
      -------
      PerceptronModel
          The restored model
      """
      from sparknlp.pretrained import ResourceDownloader
  
      return ResourceDownloader.downloadModel(
          PerceptronModel, name, lang, remote_loc
      )
  
file_path: spark-nlp/python/sparknlp/annotator/pos/perceptron.py
imports: from sparknlp.common import *
label_desc: Use image node_id 2 for calling the PerceptronModel obj's underlying member method code with example usage: obj.pretrained(name, lang, remote_loc) and returns: ResourceDownloader