Re: nltk related issue

2018-06-25 Thread Glenn Hutchings
  To: Sharan Basappa
From: Glenn Hutchings 

On 21/06/18 04:40, Sharan Basappa wrote:
 > Folks,
 >
 > I am trying to run a simple example associated with nltk.
 > I get some error and I don't know what the issue is.
 > I need some guidance please.
 >

[...]

 > LookupError:
 > **
 >Resource u'tokenizers/punkt/english.pickle' not found.  Please
 >use the NLTK Downloader to obtain the resource:  >>>
 >nltk.download()
 >Searched in:
 >  - 'D:\\Users\\sharanb/nltk_data'
 >  - 'C:\\nltk_data'
 >  - 'D:\\nltk_data'
 >  - 'E:\\nltk_data'
 >  -
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\nltk_d
ata'
 >  -
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\lib\\n
ltk_data'
 >  - 'D:\\Users\\sharanb\\AppData\\Roaming\\nltk_data'
 >  - u''
 > **
 >

As the error message says, you need to do a one-time installation of the NLTK
data.  See http://www.nltk.org/data.html for more info.

Glenn

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: nltk related issue

2018-06-24 Thread Glenn Hutchings

On 21/06/18 04:40, Sharan Basappa wrote:
> Folks,
>
> I am trying to run a simple example associated with nltk.
> I get some error and I don't know what the issue is.
> I need some guidance please.
>

[...]

> LookupError:
> **
>Resource u'tokenizers/punkt/english.pickle' not found.  Please
>use the NLTK Downloader to obtain the resource:  >>>
>nltk.download()
>Searched in:
>  - 'D:\\Users\\sharanb/nltk_data'
>  - 'C:\\nltk_data'
>  - 'D:\\nltk_data'
>  - 'E:\\nltk_data'
>  - 
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\nltk_data'
>  - 
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\lib\\nltk_data'

>  - 'D:\\Users\\sharanb\\AppData\\Roaming\\nltk_data'
>  - u''
> **
>

As the error message says, you need to do a one-time installation of the 
NLTK data.  See http://www.nltk.org/data.html for more info.


Glenn
--
https://mail.python.org/mailman/listinfo/python-list


nltk related issue

2018-06-20 Thread Sharan Basappa
Folks,

I am trying to run a simple example associated with nltk.
I get some error and I don't know what the issue is.
I need some guidance please.

I am using python canopy distribution

The following is the code:

inputstring = ' This is an example sent. The sentence splitter will split on 
sent markers. Ohh really !!'
from nltk.tokenize import sent_tokenize

sentences = sent_tokenize(inputstring)

print sentences


The following is the error report:

LookupErrorTraceback (most recent call last)
D:\Projects\Initiatives\machine learning\programs\nltk_1.py in ()
  2 from nltk.tokenize import sent_tokenize
  3 
> 4 sentences = sent_tokenize(inputstring)
  5 
  6 print sentences
D:\Users\sharanb\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\nltk\tokenize\__init__.pyc
 in sent_tokenize(text, language)
 94 :param language: the model name in the Punkt corpus
 95 """
---> 96 tokenizer = load('tokenizers/punkt/{0}.pickle'.format(language))
 97 return tokenizer.tokenize(text)
 98 
D:\Users\sharanb\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\nltk\data.pyc
 in load(resource_url, format, cache, verbose, logic_parser, fstruct_reader, 
encoding)
812 
813 # Load the resource.
--> 814 opened_resource = _open(resource_url)
815 
816 if format == 'raw':
D:\Users\sharanb\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\nltk\data.pyc
 in _open(resource_url)
930 
931 if protocol is None or protocol.lower() == 'nltk':
--> 932 return find(path_, path + ['']).open()
933 elif protocol.lower() == 'file':
934 # urllib might not use mode='rb', so handle this one ourselves:
D:\Users\sharanb\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\nltk\data.pyc
 in find(resource_name, paths)
651 sep = '*' * 70
652 resource_not_found = '\n%s\n%s\n%s' % (sep, msg, sep)
--> 653 raise LookupError(resource_not_found)
654 
655 
LookupError: 
**
  Resource u'tokenizers/punkt/english.pickle' not found.  Please
  use the NLTK Downloader to obtain the resource:  >>>
  nltk.download()
  Searched in:
- 'D:\\Users\\sharanb/nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
- 
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\nltk_data'
- 
'D:\\Users\\sharanb\\AppData\\Local\\Enthought\\Canopy\\edm\\envs\\User\\lib\\nltk_data'
- 'D:\\Users\\sharanb\\AppData\\Roaming\\nltk_data'
- u''
** 
-- 
https://mail.python.org/mailman/listinfo/python-list