Ang Sheng Jun
Ang Sheng Jun

Reputation: 131

Heroku model deployed success, but nltk.txt not found

I am new to Heroku deployments and am deploying a text classifier (python 3.6.7). I followed Heroku guide and created an nltk.txt file in the root of the app folder. The content is 'stopwords' (for Stopwords Corpus). However, during the deployment, the following log message is observed:

    remote: -----> Downloading NLTK corpora…
    remote:  !     'nltk.txt' not found, not downloading any corpora
    remote:  !     Learn more: https://devcenter.heroku.com/articles/python-nltk

The deployed model seems to work fine though, but I suspect there may be hidden issues since stopwords is not used, from the observed msg.

Kindly advise, Thanks in advance.

Upvotes: 1

Views: 331

Answers (1)

Ang Sheng Jun
Ang Sheng Jun

Reputation: 131

Update: This is a surprising find. Though the name of nltk.txt is displayed as 'nltk.txt', when I check the file name extensions, the file name is actually 'nltk.txt.txt'! After renaming the file name to 'nltk.txt', Heroku is able to detect and load the nltk modules correctly. Issue solved.

Upvotes: 1

Related Questions