TypeError: must be unicode, not str in NLTK
<p>I am using python2.7, nltk 3.2.1 and python-crfsuite 0.8.4.  I am following this page : <a href="http://www.nltk.org/api/nltk.tag.html?highlight=stanford#nltk.tag.stanford.NERTagger" rel="noreferrer">http://www.nltk.org/api/nltk.tag.html?highlight=stanford#nltk.tag.stanford.NERTagger</a> for nltk.tag.crf module. </p>

<p>To start with i just run this </p>

<pre><code>from nltk.tag import CRFTagger
ct = CRFTagger()
train_data = [[('dfd','dfd')]]
ct.train(train_data,"abc")
</code></pre>

<p>I tried this too </p>

<pre><code>f = open("abc","wb")
ct.train(train_data,f)
</code></pre>

<p>but i am getting the following error, </p>

<pre><code>  File "C:\Python27\lib\site-packages\nltk\tag\crf.py", line 129, in &lt;genexpr&gt;
    if all (unicodedata.category(x) in punc_cat for x in token):
TypeError: must be unicode, not str
</code></pre>