I would like to perform text analysis like world cloud and ngram on one of the text columns. I have broken down the sentence into tokens and want to join back it to the original table. For example here are my two rows:
Code Text
ST-441 Purpose of your visit mentioned
St-432 Describe how and where it happened
after doing text cleaning on the text column I applied the following function
After applying the split function the sentence has broken down into words, one row has become n rows and wants to add it back to the original table using a unique identifier column.
def cleans(data):
tokens = list(map(lambda data: data.split(' '), text))
Now I got the list of tokens like 'purpose', 'your', 'visit', 'mentioned', 'described' ...
I am looking for the below output
Code Text
ST-441 Purpose
ST-441 your
ST-441 Visit
ST-441 mentioned
ST-432 Describe
ST-432 how
Any help would be much appreciated.