title: Multi Threading in NLTK WordNetLemmatizer?
body: <p>I am trying to use multi threading to speed up the process. I am using the wordnetlemmatizer to lemmatize the words and those words can be further used by sentiwordnet to calculate the sentiment of the text. My Sentiment analysis  function where I am using the WordNetLemmatizer is as follows:</p>
  
  <pre><code>import nltk
  from nltk.corpus import sentiwordnet as swn
  
  def SentimentA(doc, file_path):
      sentences = nltk.sent_tokenize(doc)
      # print(sentences)
      stokens = [nltk.word_tokenize(sent) for sent in sentences]
      taggedlist = []
      for stoken in stokens:
          taggedlist.append(nltk.pos_tag(stoken))
      wnl = nltk.WordNetLemmatizer()
      score_list = []
      for idx, taggedsent in enumerate(taggedlist):
          score_list.append([])
          for idx2, t in enumerate(taggedsent):
              newtag = ''
              lemmatized = wnl.lemmatize(t[0])
              if t[1].startswith('NN'):
                  newtag = 'n'
              elif t[1].startswith('JJ'):
                  newtag = 'a'
              elif t[1].startswith('V'):
                  newtag = 'v'
              elif t[1].startswith('R'):
                  newtag = 'r'
              else:
                  newtag = ''
              if (newtag != ''):
                  synsets = list(swn.senti_synsets(lemmatized, newtag))
  
                  score = 0
                  if (len(synsets) &gt; 0):
                      for syn in synsets:
                          score += syn.pos_score() - syn.neg_score()
                      score_list[idx].append(score / len(synsets))
      return SentiCal(score_list)
  </code></pre>
  
  <p>After running 4 threads, I am getting the following error for the first 3 threads and the last thread is working perfectly.</p>
  
  <pre><code>AttributeError: 'WordNetCorpusReader' object has no attribute '_LazyCorpusLoader__args'
  </code></pre>
  
  <p>I have already tried importing the NLTK package locally as given in this NLTK <a href="http://github.com/nltk/nltk/issues/1576" rel="nofollow noreferrer">issue</a> 
  and tried the solution given on this <a href="https://stackoverflow.com/questions/27433370/what-would-cause-wordnetcorpusreader-to-have-no-attribute-lazycorpusloader/27437149#27437149">page</a>.</p>