Introduction and benchmarking of MeCab.jl #JapanR

28
MeCab.jlつくってみた Michiaki Ariga @chezou Japan.R 2014 @Freakout

description

Japan.Rで発表したMeCab.jlの紹介です。

Transcript of Introduction and benchmarking of MeCab.jl #JapanR

Page 1: Introduction and benchmarking of MeCab.jl  #JapanR

MeCab.jlつくってみたMichiaki Ariga @chezou

Japan.R 2014 @Freakout

Page 2: Introduction and benchmarking of MeCab.jl  #JapanR

大事なこと

Page 3: Introduction and benchmarking of MeCab.jl  #JapanR

の話はしません

Page 4: Introduction and benchmarking of MeCab.jl  #JapanR

Tokyoから来ました

Page 5: Introduction and benchmarking of MeCab.jl  #JapanR

自己紹介有賀康顕 / @chezou

ソフトウェアエンジニア@Cookpad

クックパッド本体のサービス開発

最近はレコメンドとか

JuliaTokyo / MLCT / kawasaki.rb

Page 6: Introduction and benchmarking of MeCab.jl  #JapanR

と私

Page 7: Introduction and benchmarking of MeCab.jl  #JapanR
Page 8: Introduction and benchmarking of MeCab.jl  #JapanR

そそのかされた😇

Page 9: Introduction and benchmarking of MeCab.jl  #JapanR

Julia Advent Calendar 参加者募集中です!http://qiita.com/advent-calendar/2014/julialang

Page 10: Introduction and benchmarking of MeCab.jl  #JapanR
Page 11: Introduction and benchmarking of MeCab.jl  #JapanR

日本で10枚くらいの    ステッカー

Page 12: Introduction and benchmarking of MeCab.jl  #JapanR

http://goo.gl/9eMKt0

Page 13: Introduction and benchmarking of MeCab.jl  #JapanR

スターが一番多い!!!

Page 14: Introduction and benchmarking of MeCab.jl  #JapanR

つくったものたち

Julia100本ノック

ConfidenceWeighted.jl

MeCab.jl

Page 15: Introduction and benchmarking of MeCab.jl  #JapanR

MeCab.jl

工藤さん作の形態素解析器MeCabのJulia wrapper

これで、Juliaで自然言語処理ができる!!1

Page 16: Introduction and benchmarking of MeCab.jl  #JapanR

DEMO

Page 17: Introduction and benchmarking of MeCab.jl  #JapanR

で、速いの?

Page 18: Introduction and benchmarking of MeCab.jl  #JapanR

Benchmark平均処理時間

[sec

]

0

0.2

0.4

0.6

0.8

Ruby(node) Julia(node) Ruby Julia R

• 対象: ブログデータ(734kB) • 単語の頻度カウント • 10回の平均を取得 • Nodeと表層の2パターン

• RはRMeCabFreq()

https://gist.github.com/chezou/1f947423c6655c266e0a

Page 19: Introduction and benchmarking of MeCab.jl  #JapanR

ファッ!?

Page 20: Introduction and benchmarking of MeCab.jl  #JapanR

これは…!?

Page 21: Introduction and benchmarking of MeCab.jl  #JapanR

あ…ありのまま 今 起こった事を話すぜ!

Page 22: Introduction and benchmarking of MeCab.jl  #JapanR

「おれはRと戦っていたと思ったら いつのまにかCと戦っていた」

Page 23: Introduction and benchmarking of MeCab.jl  #JapanR

RMeCabはCだった

Page 24: Introduction and benchmarking of MeCab.jl  #JapanR

ちなみに…

Page 25: Introduction and benchmarking of MeCab.jl  #JapanR

Benchmark平均処理時間

[sec

]

0

0.2

0.4

0.6

0.8

Ruby(node)Julia(node) Ruby Julia R Julia(w/o gc)

• 対象: ブログデータ(734kB) • 単語の頻度カウント • 10回の平均を取得 • Nodeと表層の2パターン

• RはRMeCabFreq()

Page 26: Introduction and benchmarking of MeCab.jl  #JapanR

GCを抑えればよかった😇

Page 27: Introduction and benchmarking of MeCab.jl  #JapanR

Julia Advent Calendar 参加者募集中です!http://qiita.com/advent-calendar/2014/julialang

Page 28: Introduction and benchmarking of MeCab.jl  #JapanR

JuliaのPros/Cons

Pros

Cのコードを書かないでもバインディングできる

Cons

C++は(まだ)辛い

gc!!!