Resource punkt_tab not found — for NLTK (NLP)

PATRICK
2 min readNov 21, 2024

--

Note: this is not AI generated content. This is from research…

Over the past few years, quite a few folks are STILL getting this error in Jupyter Notebook for an NLP / NLTK code cell. And it means, again, a lot of troubleshooting on my part. The instructor for the course I am taking (one of several Gen AI courses) did not get that error or they have an environment set up for that specific .ipynb file. And as such, they did not comment on it.

After I did that last step — !pip install punkt — I had to do an additional install for the tokenizers — !pip install punkt_tab, I received the following status that allowed the code to run. See image:

After troubleshooting this (which was the last missing piece for my notebook issue) and sharing it on my course site, for that specific lesson for others who get stuck on this one ‘little’ thing….

I also shared it on a github thread that started in 2022. And no one had a specific answer. But one person DID come up with a solution — TWO weeks ago and had already posted it. I upbraided him/her for that, in a good manner for beating me to sharing that info. And it was an easy one as it turned out.

There were other additional installs that had to be done prior to that as well for my Jupyter Notebook to get all of their code in the .ipynb file to run and produce output for all the cells:

a) !pip install spacy

b) !python -m spacy download en_core_web_sm

c) !pip install -U NLTK

— — and in conjunction with our doing the nltk.download(‘punkt’), I also had to do this one:

d) nltk.download(‘punkt_tab’)

Not sure about this one, but did it anyway:

Ran this install because I was getting NLTK errors, needing older version of numpy (v1.26…), which scipy installs…:
e) !pip install scipy

.

.

tags: jupyter notebook, punkt_tab, punkt, nltk, nlp, natural language processing, spacy, setuptools, scipy, download en_core_web_sm

--

--

PATRICK
PATRICK

Written by PATRICK

Data Engineer, Cloud Architect, Intelligence & Cyber guy: -- Innovation, Change, Improvement & Equality - 4 ALL! See my ABOUT https://patrick642.wordpress.com/

No responses yet