我只是關注NLTK書的第5章,tagged_words()中的'simplify_tags'參數似乎是意想不到的。我使用Python 3.4,PyCharm和標準的NLTK包。NLTK - TypeError:tagged_words()得到了一個意想不到的關鍵字參數'simplify_tags'
In[4]: nltk.corpus.brown.tagged_words()
Out[4]: [('The', 'AT'), ('Fulton', 'NP-TL'), ...]
In[5]: nltk.corpus.brown.tagged_words(simplify_tags = True)
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\IPython\core\interactiveshell.py", line 2883, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-5-c4f914e3e846>", line 1, in <module>
nltk.corpus.brown.tagged_words(simplify_tags = True)
TypeError: tagged_words() got an unexpected keyword argument 'simplify_tags'
沒有simplify_tags,運行此函數沒有問題。我讚賞任何建議或意見。謝謝!
你認爲這是一個有效的命名參數?您是否正在使用nltk書的[最新版本](http://www.nltk.org/book/)? – 2015-04-02 18:01:47
@DavidKelley謝謝!我正在關注最新版本(現在仍在更新)。 – 2015-04-02 19:43:05