LoginSignup
12

More than 5 years have passed since last update.

【TreeTagger】TreeTagger入門

Last updated at Posted at 2015-03-04

TreeTaggerとは?

英語用の形態素解析ツール。(フランス語、ドイツ語も対応しているらしい。)
日本語の形態素解析はmecabが有名。

インストール

自分はCentOSにインストールした。

1.TreeTaggerのサイトから、4ファイルをダウンロードして適当なディレクトリに置く。展開はしなくて良い。

  • Download the tagger package for your system
    ※自分の環境にあったパッケージファイル。
    linuxなので、tree-tagger-linux-3.2.tar.gz。

  • Download the tagging scripts into the same directory.
    tagger-scripts.tar.gz

  • Download the installation script install-tagger.sh
    ※インストールのためのシェルスクリプト
    install-tagger.sh

  • Download the parameter files for the languages you want to process.
    ※形態素解析したい言語のパラメータファイル。
    英語用にenglish-par-linux-3.2-utf8.bin.gz

2.インストール用のシェルスクリプト実行

install-tagger.sh 

3.動作確認

以下を実行して品詞解析の結果が出力されるか確認。

echo “A quick brown fox jumps over the lazy black dog.” | cmd/tree-tagger-english

これでインストール完了!

使い方

cmd/tree-tagger-englishにパイプで解析したい文書を渡す。

cat file.txt | cmd/tree-tagger-english

その他

解析結果の品詞については品詞の一覧を参照。

インストールの参考
http://d.hatena.ne.jp/rkmt/20140114/1389687306
http://otani0083.hatenablog.com/entry/2013/10/01/195037

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12