nltkダウンロードエラーの究極の解決策[Errno61]接続が拒否されました



Ultimate Solution Nltk Download Errors Connection Refused



間違った説明

Pythonコマンドラインの下

import nltk nltk.download()

表示されます



解決

1.これをダウンロードする https://github.com/nltk/nltk_data/tree/gh-pages

2.解凍後は、nltk_data-gh-pagesという名前のフォルダーになります。



3.上記のダウンロードディレクトリのパスの下に新しいフォルダnltk_data(空)を作成します

4.nltk_data-gh-pagesフォルダー内のパッケージ内のすべてのフォルダーをnltk_dataにコピーします

5.pythonコマンドラインで次のコマンドを実行します



import nltk from nltk.book import *

インストールが成功したことを示すために次のように表示されます

>>> from nltk.book import * *** Introductory Examples for the NLTK Book *** Loading text1, ..., text9 and sent1, ..., sent9 Type the name of the text or sentence to view it. Type: 'texts()' or 'sents()' to list the materials. text1: Moby Dick by Herman Melville 1851 text2: Sense and Sensibility by Jane Austen 1811 text3: The Book of Genesis text4: Inaugural Address Corpus text5: Chat Corpus text6: Monty Python and the Holy Grail text7: Wall Street Journal text8: Personals Corpus text9: The Man Who Was Thursday by G . K . Chesterton 1908

それについて話した後、多くの人がいなくなっています。次にストップワードを導入する方法は?

from nltk import stopwords

このスタイルは良くありません! ! ! ! !

このように使用する必要があります

from nltk.corpus import stopwords