[Tutor] about nltk

Abdirizak abdi a_abdi406@yahoo.com
Wed May 28 11:10:02 2003


--0-293102233-1054081431=:53804
Content-Type: text/plain; charset=us-ascii

Hi,
 
I was trying to play with python NLTK  text classification tutorial , I can not run the following code even if the way I installed NLTK is correct, I cann't run the followingcode:
 
>>> import nltk.classifier
>>> test = nltk.classifier.LabeledText('test','q')
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
AttributeError: 'module' object has no attribute 'LabeledText'
 
the result I am expecting after runing this code is:
' test ' / ' q '
the above class is from:
 
http://nltk.sourceforge.net/ref/nltk.classifier.LabeledText.html
 
Can anyonbe help me understand why it is giving me this error ?
 
Another quesstion is how do we use interface classes in python ?
 
thanks in advance


---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
--0-293102233-1054081431=:53804
Content-Type: text/html; charset=us-ascii

<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I was trying to play with python NLTK&nbsp; text classification tutorial&nbsp;, I can not run the following code even if the way I installed NLTK is correct, I cann't run the followingcode:</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>&gt;&gt;&gt; import nltk.classifier</STRONG></DIV>
<DIV><STRONG>&gt;&gt;&gt; test = nltk.classifier.LabeledText('test','q')</STRONG></DIV>
<DIV><STRONG>Traceback (most recent call last):<BR>&nbsp; File "&lt;interactive input&gt;", line 1, in ?<BR>AttributeError: 'module' object has no attribute 'LabeledText'</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>the result I am expecting after runing this code is:</DIV>
<DIV><STRONG>' test ' / ' q '</STRONG></DIV>
<DIV><STRONG>the above class is from:</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><A href="http://nltk.sourceforge.net/ref/nltk.classifier.LabeledText.html">http://nltk.sourceforge.net/ref/nltk.classifier.LabeledText.html</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>Can anyonbe help me understand why it is giving me this error ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Another quesstion is how do we use interface classes in python ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks in advance</DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.
--0-293102233-1054081431=:53804--