How to disable nltk_data command line output?
See original GitHub issueHi. I’m developing a chatbot with this library. I was wondering if there’s any way to suppress the output to the command line related to nltk_data every time I run my program. I am talking about this:
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/sgeor/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package punkt to /home/sgeor/nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to /home/sgeor/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
I am using flask for the frontend of my app and every time the server is restarted (or I run any of the flask do_something
commands I have implemented) this appears in the console.
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
python - How to stop NLTK from outputting to terminal when ...
Use quiet=True : import nltk nltk.download('wordnet', quiet=True).
Read more >nltk.downloader
TXT """ The NLTK corpus and module downloader. This module defines several interfaces which can be used to download corpora, models, and other...
Read more >Python & NLTK Frequently Asked Questions
Uninstall your current version of NLTK: Open up a terminal windows and type sudo pip uninstall nltk. · Install NLTK 2.0. · Verify...
Read more >Part of Speech Tagging with Stop words using NLTK in python
There is no universal list of stop words in nlp research, however the nltk module contains a list of stop words. You can...
Read more >How to Use the Python Natural Language Toolkit (NLTK) in ...
Download NLTK Data for all users (not recommended). Warning. This procedure needs command-line access and administrative privileges on the machine hosting ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
C:\Users\YOUR_USER_NAME\AppData\Roaming\nltk_data
orvenv/nltk_data
or where nltk_data is downloaded…nltk_data/corpora/stopwords
tonltk_data/stopwords
nltk_data/taggers/averaged_perceptron_tagger
tonltk_data/averaged_perceptron_tagger
Before:
After:
In version 1.0.5, chatterbot/utils.py has four download_nltk_xxx functions:
They all call the function
nltk_download_corpus
, whose parameterresource_path
represents the path to check if the data exists.In an upcoming release, I’d be happy to add an option that makes it possible to disable this output.