[Tutor] another error in tagging program

w chun wescpy at gmail.com
Wed Oct 12 16:12:06 CEST 2005


On 10/12/05, enas khalil <enas_khalil at yahoo.com> wrote:
>
> and got the following error :
> Traceback (most recent call last):
>   File "F:\MSC first Chapters\error correct.py", line 19, in -toplevel-
>     tagger.train(tagged_txt_token)
>   File
> "C:\Python24\Lib\site-packages\nltk\tagger\__init__.py",
> line 332, in train
>     tag = subtok[TAG]
> KeyError: 'TAG'
> >>>
> please help
> thanks
> enas


this error is due to TAG = 'TAG' and this key not being in your subtok
dictionary.  what are you trying to accomplish in your application? 
it looks like you are following a lesson plan of a course in natural
language processing.

-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2006,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list