可以通过使用nltk.tokenize删除一些不必要的停用词来对字符串进行标记。但是如何将包含停用词的短语标记为单个标记,同时删除其他停用词?
例如:
输入:特朗普是美国总统。
输出:['特朗普','美国总统']
如何获得仅删除“is”和第一个“the”但不删除“of”和第二个“the”的结果?
python tokenize nltk stop-words
nltk ×1
python ×1
stop-words ×1
tokenize ×1