clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.76k stars 1.58k forks source link

from pattern.en import conjugate get zipfile.BadZipFile error #252

Open shizi626 opened 5 years ago

shizi626 commented 5 years ago

I dived into source code and found that in pattern\text\en\wordnet\__init__.py when trying get necessary corpora of nltk, the code(as below) doesn't handle zipfile.BadZipFile: File is not a zip file error

for token in ("wordnet", "wordnet_ic", "sentiwordnet"):
    try:
        nltk.data.find("corpora/" + token)

And I find that download these packages("wordnet", "wordnet_ic", "sentiwordnet") from nltk mannually can fix this bug.

luzhongqiu commented 5 years ago

I have the same issue, :(

emilmuller commented 5 years ago

same here

tarskiandhutch commented 5 years ago

Same here. (Using Python 2.7.15 via pyenv on Mac OS Mojave version 10.14.3.)

kazemihabib commented 5 years ago

Run the following command in the python shell:

>>> import nltk
>>> nltk.download()

A NLTK Downloader will open. Go to the Corpora tab and download the "wordnet", "wordnet_ic", "sentiwordnet".