I have a pandas dataframe raw_df with 2 columns, ID and sentences. I need to convert each sentence to a string. The code below produces no errors and says datatype of rule is "object."
raw_df['sentences'] = raw_df.sentences.astype(str)
raw.df.sentences.dtypes
Out: dtype('O')
Then, I try to tokenize sentences and get a TypeError that the method is expecting a string or bytes-like object. What am I doing wrong?
raw_sentences=tokenizer.tokenize(raw_df)
Same TypeError for
raw_sentences = nltk.word_tokenize(raw_df)
tokenizer.tokenize
from? – Igneous