NLTK

since 2012-01-30

http://www.nltk.org/

Natural Language Toolkit

python ベースのパッケージ。

Mac OS X 10.6.8 マシンで macports 環境を構築。

sudo port install python27
sudo port install py27-nltk

python2.7 という実行ファイルの中で import nltk できるようになる:

$ which python
/usr/bin/python
$ which python2.7
/opt/local/bin/python2.7

$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named nltk

$ python2.7
Python 2.7.2 (default, Jan 13 2012, 17:11:09) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> 

nltk.downloader() で book を選んだらエラーになった。下記のやり方で成功した:

$ python2.7 -m nltk.downloader book
...
[nltk_data]    | 
[nltk_data]  Done downloading collection 'book'

参考記事 http://6-bit.com/2011/08/23/ubuntu%E3%81%AEpython%E3%81%A7nltk%E3%82%92%E8%A9%A6%E3%81%97%E3%81%9F%E3%81%84/

調子に乗って sudo port install py27-scipy したら gcc44 を入れ始めた。重そうである。。

入門 自然言語処理
入門 自然言語処理
posted with amazlet at 12.01.30
Steven Bird Ewan Klein Edward Loper
オライリージャパン
売り上げランキング: 130370

分類器

nltk.txt · 最終更新: 2012/05/10 15:03 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0