已解决nltk.download('point') [nltk_data] Error loading point: [WinError 10060] [nltk_data]

Solved (nltk download thesaurus error) nltk.download('punkt')
[nltk_data] Error loading punkt: [WinError 10060]
[nltk_data] The connection was attempted because the connecting party did not reply correctly after a period of time or the connected host did not respond fail.
false









error code



A small friend in the fan group wanted to use nltk to load the thesaurus. More friends who will not solve this bug), the error code is as follows:

insert image description here


Error message content :


[nltk_data] Error loading punkt: [WinError 10060]
[nltk_data] The connection attempt failed because the connected party did not reply correctly after a period of time or the connected host did not respond.
false



error translation



Error translation translation :

[nltk_data] Error loading punkt: [WinError 10060]
[nltk_data] getaddrinfo failed >
error



Reason for error



Reason for error : may be due to network problems,The blogger has downloaded the thesaurus file for everyone, download it according to the following and put it in the specified file path!



Solution



The blogger has already downloaded three thesaurus commonly used by NLTK: stop thesaurus and part-of-speech thesaurus. . .Pay attention to the public account at the end of the article and reply: nltk_data, you can get it! ! !After downloading, put it under the specified file path of your own error message!

insert image description here


Pay attention to the public number at the end of the article and reply :nltk_data


insert image description here



At that time, I checked the information and learned that I could download this data myself. According to the error message, you can put it in any of the following directories (note: everyone's directory is not necessarily)


insert image description here



I created a nltk_data folder in the Python3.8 folder, created a corpora folder down, and finally put the decompressed folder of stopwords in the corpora folder: D:\Python3.8\nltk_data\corpora :

insert image description here

Run the program again to see that the stop word library is loaded:

insert image description here


help

This article has been included in: "Farewell to Bug" column

This column is used to record various difficult bugs encountered in study and work, as well as various problems raised by small partners in the fan group. Article format: error code + error translation + error reason + solution, including program installation, operation If you encounter other problems in the process of the program, if you encounter other problems after subscribing to the column + following the blogger, you can privately chat to help solve them! ! !

Guess you like

Origin blog.csdn.net/yuan2019035055/article/details/126408059