如何使用pandas dataframe通过POS标记NLTK来覆盖单词?
例如我有:
from_dict()
我的意见:
data = pd.read_csv('dataset.csv', delimiter='\t', names=columns)
data['POSTags'] = pos_tag_sents(data['Sentence'].apply(word_tokenize).tolist())
立即输出:
DAW1 was further investigated by
我需要输出的内容:
[('DAW1', 'NNP'), ('was', 'VBD'), ('further', 'RBR'), ('investigated', 'VBN'), ('by', 'IN')]