Python Forum
Error on trying to use NLTK Punkt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error on trying to use NLTK Punkt
#1
Hi,

I have all NLTK packages loaded locally, however when I run the following commands in my source code i am getting errors:

import nltk
from nltk.tokenize import sent_tokenize, word_tokenize

data = "This is a test"
print(word_tokenize(data))

The error I am getting is:

Resource <-[93mpunkt<-[0m not found
Attempted to load <-[93mtokenizers/punkt/english.pickle<-[0m
Searched in:
<There is a series of windows folders it lists here>

It looks like I have what it is looking for, but not maybe in the proper windows folder ??..Should I move some folders around so it can see it in the path ?

Thanks
Reply
#2
Actually, I found out the issue...I had to have the nltk_data folder in the nltk path(list of directories nltk parses through to find packages)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [nltk] Parsing with CFG constantin01 1 2,100 Jul-05-2019, 11:11 PM
Last Post: Larz60+
  [nltk] Relations Extractor constantin01 3 3,515 Jun-28-2019, 10:41 AM
Last Post: constantin01
  [nltk] Naive Bayes Classifier constantin01 0 1,993 Jun-24-2019, 10:36 AM
Last Post: constantin01
  NLTK Download Attribute error laila1a 1 8,580 Jan-27-2019, 12:03 AM
Last Post: Larz60+
  [split] serious n00b.. NLTK in python 2.7 and 3.5 kevindenman 3 4,539 Feb-22-2018, 09:05 PM
Last Post: kevindenman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020