Open Ligh7bringer opened 5 years ago
Maybe something in NLTK docs?
I did find something. Apparently
import nltk
nltk.download('wordnet', quiet=True)
disables it but I don't know where nltk.download()
is used in chatterbot. Furthermore, even if I did find out, that would mean I would have to modify the library files and it will only work for me. I can't really come up with a solution. Thanks for the suggestion though.
In an upcoming release, I'd be happy to add an option that makes it possible to disable this output.
I did find something. Apparently
import nltk nltk.download('wordnet', quiet=True)
disables it but I don't know where
nltk.download()
is used in chatterbot. Furthermore, even if I did find out, that would mean I would have to modify the library files and it will only work for me. I can't really come up with a solution. Thanks for the suggestion though.
Hi @gunthercox @Ligh7bringer
I have tried adding these two lines in the python file (code for chatbot) but did not work for me. May I know to which file this needs to be added.
Many thanks
I have seen all these lines in downloader.py which resides inside nltk folder. Below is an example.
class UpToDateMessage(DownloaderMessage): """The package download file is already up-to-date""" def init(self, package): self.package = package
I did not understand what """The package download file is already up-to-date""" is doing.
Is it something like a print statement? I have removed this sort of lines but did not work. It still prints this in command line output.
https://www.youtube.com/watch?v=POKSIoePv3Q&t=15s I hope this will help you guys... and sorry for bad video quality
C:\Users\YOUR_USER_NAME\AppData\Roaming\nltk_data
or venv/nltk_data
or where nltk_data is downloaded..nltk_data/corpora/stopwords
to nltk_data/stopwords
nltk_data/taggers/averaged_perceptron_tagger
to nltk_data/averaged_perceptron_tagger
Before:
After:
In version 1.0.5, chatterbot/utils.py has four download_nltk_xxx functions:
def download_nltk_stopwords():
"""
Download required NLTK stopwords corpus if it has not already been downloaded.
"""
nltk_download_corpus('stopwords') # should be 'corpora/stopwords'
def download_nltk_wordnet():
"""
Download required NLTK corpora if they have not already been downloaded.
"""
nltk_download_corpus('corpora/wordnet')
def download_nltk_averaged_perceptron_tagger():
"""
Download the NLTK averaged perceptron tagger that is required for this algorithm
to run only if the corpora has not already been downloaded.
"""
nltk_download_corpus('averaged_perceptron_tagger') # should be 'taggers/averaged_perceptron_tagger'
def download_nltk_vader_lexicon():
"""
Download the NLTK vader lexicon for sentiment analysis
that is required for this algorithm to run.
"""
nltk_download_corpus('vader_lexicon')
They all call the function nltk_download_corpus
, whose parameter resource_path
represents the path to check if the data exists.
[nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] C:\Users\smart\AppData\Roaming\nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! [nltk_data] Downloading package punkt to [nltk_data] C:\Users\smart\AppData\Roaming\nltk_data... [nltk_data] Package punkt is already up-to-date!
How to remove it from pycharm????
https://www.youtube.com/watch?v=POKSIoePv3Q&t=15s I hope this will help you guys... and sorry for bad video quality
Please add this video again I am also facing this issue. It would be really great help dude.
[nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] C:\Users\smart\AppData\Roaming\nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! [nltk_data] Downloading package punkt to [nltk_data] C:\Users\smart\AppData\Roaming\nltk_data... [nltk_data] Package punkt is already up-to-date!
How to remove it from pycharm????
Did you get the solution for this? I am also facing the same issue. Can someone please help !!
didn't find solution by far... using ntlk.download('wordnet', quite=True) does stop for the first time but if you are running while True it will show up again.. so doesn't solve it. :|
seriously needed this.
Hi. 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:
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.