I have a dataframe called article
+--------------------+
| processed_title|
+--------------------+
|[new, relictual, ...|
|[once, upon,a,time..|
+--------------------+
I want to flatten it to get it as bag of words. How could I achieve this using the current situation. I have tried the code below which seems to give me a Type mismatch issue.
val bow_corpus = article.select("processed_title").rdd.flatMap(y => y)
I eventually want to use this bow_corpus to train a word2vec model.
Thanks