Action disabled: source

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 を入れ始めた。重そうである。。

<html> <div class="amazlet-box" style="margin-bottom:0px;"><div class="amazlet-image" style="float:left;margin:0px 12px 1px 0px;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114705/r4wh-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://ecx.images-amazon.com/images/I/51EoFqAGo1L._SL160_.jpg" alt="入門 自然言語処理" style="border: none;" /></a></div><div class="amazlet-info" style="line-height:120%; margin-bottom: 10px"><div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114705/r4wh-22/ref=nosim/" name="amazletlink" target="_blank">入門 自然言語処理</a><div class="amazlet-powered-date" style="font-size:80%;margin-top:5px;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/4873114705/r4wh-22/ref=nosim/" title="入門 自然言語処理" target="_blank">amazlet</a> at 12.01.30</div></div><div class="amazlet-detail">Steven Bird Ewan Klein Edward Loper <br />オライリージャパン <br />売り上げランキング: 130370<br /></div><div class="amazlet-sub-info" style="float: left;"><div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114705/r4wh-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div></div></div><div class="amazlet-footer" style="clear: left"></div></div> </html>

分類器

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