I am trying to I am tring to delete stop words via spark,the code is as follow
from nltk.corpus import stopwords
from pyspark.context import SparkContext
fro
It's to do with uploading of stop words module. As a work around import stopwords library with in the function itself. please see the similar issue linked below. I had same the issue and this work around fixed the problem.
def stopwords_delete(word_list):
from nltk.corpus import stopwords
filtered_words=[]
print word_list
Similar Issue
I would recommend from pyspark.ml.feature import StopWordsRemover
as permanent fix.