Closed vaidyan5 closed 4 years ago
df_test.csv.zip corpus = st.CorpusFromPandas(df_test,category_col='loc_k',text_col='message',nlp=nlp).build().remove_terms(nlp.Defaults.stop_words, ignore_absences=True)
term_freq_df = corpus.get_term_freq_df()
Produces error:' TypeError: unsupported operand type(s) for +: 'int' and 'str'
What is the full trace of the error?
TypeError Traceback (most recent call last)
These types of errors occur when non-string category names are used. Version 0.0.2.61 fixes this issue.
>>> corpus = st.CorpusFromPandas(df_test,category_col='loc_k',text_col='message',nlp=nlp).build().remove_terms(nlp.Defaults.stop_words, ignore_absences=True)
>>> corpus.get_term_freq_df()
458 freq 530 freq 484 freq 515 freq 507 freq 506 freq 467 freq
term
anybody 1 0 0 0 0 0 0
interested 2 0 0 0 0 0 0
trading 1 0 0 0 0 0 0
Your Environment