停用词是一组常用词,它们在文本中添加更多噪音而不是有用信息。英语中常见的停用词有:a、the、in、an,标点符号也可以是停用词。
一些图书馆很糟糕,因为 NLTK 已经为英语建立了停用词集。 Example:
import nltk
from nltk.corpus import stopwords
set(stopwords.words('english'))
您还可以根据您正在构建的 NLP 应用程序的上下文自定义停用词列表。
每种语言都有一组不同的停用词,英文的停用词集如下所示:
english_stop_words = ["the","a","an","it","by","or",...]
虽然葡萄牙语停用词列表如下所示:
portuguse_stop_words = ["a", "o","um","uma","pelo", "pela","ou",...]
一组法语停用词可能是:
french_stop_words = ["le","la", "à","alors","ce",...]
因此,对于每种语言,您都需要该语言的一组特定停用词。不一定是从一种语言到另一种语言的停用词的直接翻译。
同样,这一切都与您的应用程序的目的有关。在自然语言处理管道的预处理步骤中使用停用词作为降噪步骤。
Here is a website that has a list of stop words for several languages.
祝你好运:)