JasonKessler / scattertext

Beautiful visualizations of how language differs among document types.
Apache License 2.0
2.23k stars 289 forks source link

Stopwords not working #114

Closed MeeqatSuharwardy closed 2 years ago

MeeqatSuharwardy commented 2 years ago

Hi, Can I know how to use custom stop words to exclude the word's from scattertext plot. I am trying to do so but failed. Can you guide regarding this. The code snippet is attached.

english_stopwords = { stopword for stopword in pd.read_csv('/Users/meeqat.suharwardy/Desktop/stopwords.txt', sep=" ", lineterminator='\n') if stopword.strip() } not_a_word = re.compile(r'^\W+$')

print(english_stopwords)

corpus = st.CorpusFromPandas(convention_df, category_col='Speaker', text_col='Text', nlp=st.whitespace_nlp_with_sentences ).build( ).remove_terms(english_stopwords, ignore_absences=True)

JasonKessler commented 2 years ago

Closing since this is not reproducible. Please follow the bug report instructions.