'How to pass several columns from a DataFrame all together in Word2Vec

While using Word2Vec algorithm, how to pass several text columns from a pandas data frame all together for the model to train.

Image showing columns present in DataFrame][1] [1]: https://i.stack.imgur.com/80iiq.png

'task' is the name of the dataframe.

Code is as follows:

import gensim from gensim import corpora, models, similarities

model_taskname = gensim.models.Word2Vec(task.iloc[:,0], min_count=1, size = 32, window = 10, sg=1) model_elementname = gensim.models.Word2Vec(task.iloc[:,1], min_count=1, size = 32, window = 10, sg=1)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source