code: def score_model_as_udf(model_uri, result_type="string"):
      spark = mlflow.johnsnowlabs._get_or_create_sparksession()
      pandas_df = pd.DataFrame({"text": ["Hello World"]})
      spark_df = spark.createDataFrame(pandas_df).coalesce(1)
      pyfunc_udf = spark_udf(
          spark=spark,
          model_uri=model_uri,
          env_manager="virtualenv",
          result_type=result_type,
      )
      new_df = spark_df.withColumn(
          "prediction", pyfunc_udf(*pandas_df.columns)
      )
      return [x["prediction"] for x in new_df.collect()]
  
imports: import json
  import os
  from pathlib import Path
  from unittest import mock
  import pandas
  import pyspark
  import pytest
  from johnsnowlabs import nlp
  from packaging.version import Version
  import mlflow
  import mlflow.utils.file_utils
  from mlflow import pyfunc
  from mlflow.environment_variables import MLFLOW_DFS_TMP
  from mlflow.models import Model, infer_signature
  from mlflow.models.utils import _read_example
  from mlflow.pyfunc import spark_udf
  from mlflow.utils.environment import _mlflow_conda_env
  from mlflow.utils.file_utils import TempDir
  from tests.helper_functions import assert_register_model_called_with_local_model_path
label_desc: Use image node_id 8 for calling a global function with example usage: score_model_as_udf(model_uri, result_type) and returns: unknown