def make_topic_word(topic_words):
    return udf(lambda c: label_maker_topic(c, topic_words))
df = sc.parallelize([(['union'],)]).toDF(['tokens'])
df.withColumn('topics', make_topic_word(keyword_list)(col('tokens'))).show()
Passing a data frame column and external list to udf under withColumn