Facebook 開源的 fastText

準確度維持在同一個水準上,但是速度卻快了 n 個數量級的 text classification 工具:「FAIR open-sources fastText」。

可以看到 fastText 的執行速度跟其他方法的差距:

Our experiments show that fastText is often on par with deep learning classifiers in terms of accuracy, and many orders of magnitude faster for training and evaluation.

除了 open source 外,也發表了論文:「Enriching Word Vectors with Subword Information」,看 abstract 的時候發現提到了 Skip-gram:

In this paper, we propose a new approach based on the skip-gram model, where each word is represented as a bag of character n-grams.

結果找資料發現自己以前寫過「Skip-gram」這篇 XDDD

MySQL 5.7 的 InnoDB 的全文搜尋

在「InnoDB Full-Text : N-gram Parser」這邊看到對 MySQL 5.7 InnoDB 的全文搜尋功能介紹。開頭就有很重要的說明:

I’m now very happy to say that in MySQL 5.7.6 we’ve made use of the new pluggable full-text parser support in order to provide you with an n-gram parser that can be used with CJK!

這對資料量在中等或是更少的公司相當方便,你可以架 replication server 專門跑 search,而不需要利用 reliable queue 確保更新後推進 SolrElastic (改名了,之前叫 ElasticSearch)。

不過,如果資料量很大的話應該還是得用 Solr 或 Elastic 的方案...

Skip-gram

一路翻資料翻到 Skip-gram:「A CloserLook at Skip-gram Modelling (PDF)」,不確定是 2005 年 (出自「CiteSeerX — Citation Query A Closer look at Skip-gram modeling」) 還是 2006 年 (出自「CiteSeerX — A Closer Look at Skip-gram Modelling」) 的論文,不過 Google Scholar 是標 2006 年...

Skip-gram 實際上的定義很簡單,就是允許跳幾個字的意思... 依照原論文裡的定義,這個句子:

Insurgents killed in ongoing fighting.

在 bi-grams 的時候是拆成:{insurgents killed, killed in, in ongoing, ongoing fighting}。

在 2-skip-bi-grams 的時候拆成:{insurgents killed, insurgents in, insurgents ongoing, killed in, killed ongoing, killed fighting, in ongoing, in fighting, ongoing fighting}。

在 tri-grams 的時候是:{insurgents killed in, killed in ongoing, in ongoing fighting}。

在 2-skip-tri-grams 的時候是:{insurgents killed in, insurgents killed ongoing, insurgents killed fighting, insurgentsin ongoing, insurgents in fighting, insurgents ongoing fighting, killed in ongoing, killed in fighting, killed ongoing fighting, in ongoing fighting}。

這樣就有辦法在整篇文章都是用「台灣大學」的情況下以「台大」找到文章,解決一些「同義詞」想要解決的問題。

在論文裡有分析 coverage,不過這邊 coverage 是指什麼客觀評估方式就不知道了,等下來找找看到底是什麼...