title: how to override downloader directory with local directory in polyglot in python
body: <p>I run polyglot sentiment detection. When I upload it to the server I cannot run the <code>downloader.download(&quot;TASK:sentiment2&quot;)</code> command, so I downloaded the sentiment2 folder and saved it in the same folder as the python file.</p>
  <p>I tried to set <code>downloader.download_dir = os.path.join(os.getcwd(),'polyglot_data')</code> pointing at the sentiment2 folder location as it says in the <a href="https://polyglot.readthedocs.io/en/latest/polyglot.html#module-polyglot.downloader" rel="nofollow noreferrer">polyglot documentation</a> but it doesnt work.</p>
  <p><strong>How do I override downloader directory so it will access the sentiment2 local folder when it executes the sentiment analysis?</strong></p>
  <p>Please see the full code below. This code works on my computer and localhost but returns zero when I run it on the server.</p>
  <pre><code>from polyglot.downloader import downloader
  #downloader.download(&quot;TASK:sentiment2&quot;)
  from polyglot.text import Text
  
  downloader.download_dir = os.path.join(os.getcwd(),'polyglot_data')
  
  def get_text_sentiment(text):
     result = 0
     ttext = Text(text)
     for w in ttext.words:
        try:
           result += w.polarity
        except ValueError:
           pass
     if result: 
        return result/ len(ttext.words)
     else:
        return 0
  
  text = &quot;he is feeling proud with ❤&quot;
  print(get_text_sentiment(text))
  
  </code></pre>
  <p>my localhost returns - 0.1666</p>
  <p>the server returns - 0.0</p>