code: def explode_annotations_col(
      dataframe: DataFrame, column, output_column
  ):
      """Explodes an Annotation column, putting each result onto a separate row.
  
      Parameters
      ----------
      dataframe : DataFrame
          The Spark DataFrame containing output Annotations
      column : str
          Name of the column
      output_column : str
          Name of the output column
  
      Returns
      -------
      :class:`pyspark.sql.DataFrame`
          Transformed DataFrame
  
      Examples
      --------
      >>> from sparknlp.pretrained import PretrainedPipeline
      >>> from sparknlp.functions import *
      >>> explain_document_pipeline = PretrainedPipeline("explain_document_dl")
      >>> data = spark.createDataFrame([["U.N. official Ekeus heads for Baghdad."]]).toDF("text")
      >>> result = explain_document_pipeline.transform(data)
      >>> result.select("pos.result").show(truncate=False)
      +----------------------------------+
      |result                            |
      +----------------------------------+
      |[NNP, ., JJ, NNP, VBZ, IN, NNP, .]|
      +----------------------------------+
      >>> explode_annotations_col(result, "pos", "pos").select("pos.result").show()
      +------+
      |result|
      +------+
      |   NNP|
      |     .|
      |    JJ|
      |   NNP|
      |   VBZ|
      |    IN|
      |   NNP|
      |     .|
      +------+
      """
      from pyspark.sql.functions import explode
  
      return dataframe.withColumn(output_column, explode(column))
  
file_path: spark-nlp/python/sparknlp/functions.py
imports: from pyspark.sql.functions import udf, array
  from pyspark.sql.types import *
  from pyspark.sql import DataFrame
  from sparknlp.annotation import Annotation
label_desc: Use image node_id 7 for calling a global function with example usage: explode_annotations_col(dataframe, column, output_column) and returns: dataframe