最佳做法是分别用停用词和停用词清除数据吗?我在下面有一个数据框,但需要删除特定的短语和特定的停用词。
import pandas as pd
from nltk.corpus import stopwords
stop = stopwords.words('english')
list_of_phrases_remove = 'I love this asdfasdf car'
stop.append('asdfasdf')
pos_tweets = [('I love this asdfasdf car', 'positive'),
('This view is amazing', 'positive'),
('I feel great this morning', 'positive'),
('I am so excited about the concert', 'positive'),
('He is my best friend', 'positive')]
test = pd.DataFrame(pos_tweets)
test.columns = ["tweet","class"]
如果我需要删除停用词“ asdfasdf”又需要从我的list_of_phrases_remove中删除“我爱这辆asdfasdf汽车”怎么办?
从这样的文本的pandas dataframe列中删除停用词以及特定短语的命令流程是什么?