Rajasree
Rajasree

Reputation: 35

Python code for sentiment analysis

Initially nltk produced an error,

import nltk

ImportError: No module named nltk

which I resolved by installing nltk. Now it produces the below code as error

self.nltk_splitter = nltk.data.load('tokenizers/punkt/english.pickle')

AttributeError: 'module' object has no attribute 'data'

What is the module that should be added for data?

Upvotes: 2

Views: 851

Answers (1)

jazz
jazz

Reputation: 2379

import nltk.data

in short. Then you have the module available.

Upvotes: 3

Related Questions