I have a data frame with a Audio Transcript column from customer care phone conversation. I have created one list with words and sentences

words = ["rain", "buy new house", "tornado"]

What I need to do is create a column in the data frame which checks these words in the text column row by row and if it presents then update the column with word and it's frequency. For example first row text

"I was going to buy new house last week but it was raining since then. Once the rain stops I'll go and buy new house"

the column should read

{"buy new house",2}, {"rain",2}

or may be create a duplicate row and add the comma part in next row.

How to proceed in this as I am fairly new.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.