Slide 1

Slide 1 text

FastText 触ってみた 2017/07/06 珍田

Slide 2

Slide 2 text

FastText とは より早い Word2Vec facebook 製

Slide 3

Slide 3 text

Word2Vec ???

Slide 4

Slide 4 text

Word2Vec とは 単語のベクトル表現

Slide 5

Slide 5 text

類似の概念

Slide 6

Slide 6 text

Word2Vec の画期的なところ 言語の vector 表現は以前からあった.

Slide 7

Slide 7 text

Word2Vec の画期的なところ 足し算引き算( ベクトルの演算) ができる!!!

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Word2Vec の演算 king − man + woman = queen paris − france + japan = tokyo

Slide 10

Slide 10 text

で,FastText Word2vec の作者謹製の, 次世代 Word2Vec 高速!!!

Slide 11

Slide 11 text

事前準備 https://github.com/facebookresearch/fastText python3, numpy, scipy, cython が使えること => b r i e / d o c k e r ‐ n u m p y ‐ s c i p y とか使うのが楽 利用するテキスト( 日本語だったら分かち書きしてあること) ※ 分かち書きされた文書の準備 m e c a b ‐ O w a k a t i h o g e . t x t > h o g e . w a k a t i . t x t

Slide 12

Slide 12 text

使い方 $ ( p i p i n s t a l l c y t h o n ) $ ( p i p i n s t a l l f a s t t e x t ) $ p i p i n s t a l l g e n s i m i m p o r t g e n s i m f r o m g e n s i m . m o d e l s i m p o r t w o r d 2 v e c s e n t e n c e s = w o r d 2 v e c . T e x t 8 C o r p u s ( ' h o g e f u g a . w a k a t i . t x t ' ) m o d e l = w o r d 2 v e c . W o r d 2 V e c ( s e n t e n c e s , s i z e = 2 0 0 , w i n d o w = 5 , w o r k e r s = m o d e l . m o s t _ s i m i l a r ( p o s i t i v e = [ ' ほげー' , ' ふがー' ] , n e g a t i v e = [ ' ばず'

Slide 13

Slide 13 text

デモ