在Python 3中从文本中一起删除两个单词(词组)

时间:2018-08-09 15:24:57

标签: python-3.x nltk text-mining

我正在尝试从2万条评论中删除单词。单词存储在数据框中,大约有2000多个。注释在其他数据框中,大约20K。

下面是示例:

import pandas as pd

data = pd.Dataframe()   
data = ['Hull Damage happened and its insured by maritime hull insurance company','Non Cash Entry and claims are blocked']  

stopwords = ['Hull insurance', 'Non Cash Entry']

预期输出:

output = ['Hull Damage happened and its insured by maritime company','and claims are blocked']  

0 个答案:

没有答案