我想要删除一个单词。 我有一个由大约15,000个字符串组成的列表。这些字符串是小文本。我的代码如下: h = []
for w in clean.split():
if w not in cachedStopWords:
h.append(w)
if w in cachedStopWords:
h.append(" ")
print(h)
我的
我试图用NLTK包写一个python程序来删除从一个句子停用词 from nltk.corpus import stopwords
chachedWords = stopwords.words('english')
下面给出TypeError: 'LazyCorpusLoader' object is not callable
我有清洁一组禁用词的文本功能: def clean_text(raw_text, stopwords_set):
# removing everything which is not a letter
letters_only = re.sub("[^a-zA-Z]", " ", raw_text)
# lower case + split --> list of w
我在我的pyspark数据框上使用了pyspark.ml.feature.StopWordsRemover类。它有ID和文本列。除了提供的默认停止词列表之外,我想添加自己的自定义列表以从字符串中删除所有数值。 我可以看到有一种方法可以为这个类添加setStopWords。我想我正在努力使用正确的语法来使用这种方法。 from pyspark.sql.functions import *
from