Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TF-IDF
Search
Atom
March 07, 2019
1
120
TF-IDF
Atom
March 07, 2019
Tweet
Share
More Decks by Atom
See All by Atom
文献紹介 / Structure-based Knowledge Tracing: An Influence Propagation View
roraidolaurent
0
82
文献紹介 / Knowledge Tracing with GNN
roraidolaurent
0
85
文献紹介 / Non-Intrusive Parametric Reduced Order Models withHigh-Dimensional Inputs via Gradient-Free Active Subspace
roraidolaurent
0
52
ニューラルネットワークのベイズ推論 / Bayesian inference of neural networks
roraidolaurent
1
2.8k
Graph Convolutional Networks
roraidolaurent
0
220
文献紹介 / A Probabilistic Annotation Model for Crowdsourcing Coreference
roraidolaurent
0
63
文献紹介Deep Temporal-Recurrent-Replicated-Softmax for Topical Trends over Time
roraidolaurent
0
94
文献紹介/ Bayesian Learning for Neural Dependency Parsing
roraidolaurent
0
110
ポッキー数列の加法定理 / Pocky number additon theorem
roraidolaurent
0
200
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Fireside Chat
paigeccino
37
3.4k
Faster Mobile Websites
deanohume
306
31k
How GitHub (no longer) Works
holman
314
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Build your cross-platform service in a week with App Engine
jlugia
230
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
770
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Building Applications with DynamoDB
mza
94
6.4k
Transcript
TF-IDF法 文書検索の基礎 第9回 B3勉強会 2019/3/7 長岡技術科学大学 自然言語処理研究室 吉澤 亜斗武
参考文献・資料 [1] 黒橋禎夫,柴田知秀:自然言語処理概論,サイエンス社(2016) [2] Dheeraj Mekala et al. : Sparse
Composite Document Vectors using soft clustering over distributional representations https://www.arxiv-vanity.com/papers/1612.06778/ [3] @fufufukakaka :文書ベクトルをお手軽に高い精度で作れるSCDVって実際 どうなのか日本語コーパスで実験した(EMNLP2017) https://qiita.com/fufufukakaka/items/a7316273908a7c400868 2
Contents (1) 転置インデックス (2) 語の重要度(TF-IDF法) (3) TF-IDF法における文書ベクトル (4) SCDVについて 3
(1) 転置インデックス 転置インデックス(inversed index) ・単語がどの文書に出現するかを事前に調べて置き, 索引としたもの. ・出現位置などもインデックスしているものもあり, 複合語などの検索も可能となる. 4
(1) 転置インデックス 5 文書1 言語,コンピュータ,問題 文書2 コンピュータ,問題 文書3 言語,問題,情報 文書4
問題,情報 文書5 情報,コンピュータ 言語 文書1, 文書3 コンピュータ 文書1, 文書2, 文書5 問題 文書1, 文書2, 文書3,文書4 情報 文書3, 文書4, 文書5
(2) 語の重要度(TF-IDF法) 6 クエリ(query):検索したい語集合や自然文 文書をクエリに対する関連度によってランキングしたい. → 語の重要度に基づいて関連度を計算する. TF(term frequency):文書 における語
の頻度 , TFが大きいほど,その文書と語は強く関連している.
(2) 語の重要度(TF-IDF法) 7 DF(document frequency):ある語 を含む文書の頻度 IDF(inversed document frequency) DFの逆数に対数をとったもの.
𝑖𝑖𝑖𝑖 = log 𝑑𝑑 −1 IDFが大きいほど,語 は稀な頻度で文書に現れることを表す. TF-IDF法:語の重要度を以下のように定義する. 𝑡𝑡 , × 𝑖𝑖𝑖𝑖
(2) 語の重要度(TF-IDF法) 8 先ほどの転置インデックスを例にして, TF-IDFを求めてみる. 簡単のため,TFを頻度ではなく,出現回数とする. 例えば,「文書1」に対する「言語」の重要度を求める. 𝑡𝑡 言語, 文書1
= 2 とし, 𝑖𝑖𝑖𝑖 言語 = log 2 5 −1 ≅ 0.40 ∴ 𝑡𝑡 言語, 文書1 × 𝑖𝑖𝑖𝑖 言語 = 0.80
(2) 語の重要度(TF-IDF法) 9 df idf 文書1 文書2 文書3 文書4 文書5
言語 2 0.40 2, 0.80 0, 0.00 1, 0.40 0, 0.00 0, 0.00 コンピュータ 3 0.22 1, 0.22 1, 0.22 0, 0.00 0, 0.00 2, 0.44 問題 4 0.10 2, 0.20 2, 0.20 3, 0.30 1, 0.10 0, 0.00 情報 3 0.22 0, 0.00 0, 0.00 2, 0.44 1, 0.22 1, 0.22 TF-IDF法の計算例(文書の列の2 つの値は𝑡𝑡 と𝑡𝑡 − 𝑖𝑖𝑖𝑖 )
(3) TF-IDF法における文書ベクトル 10 クエリ,文書をベクトルで表現し,その類似度を計算することで ランキングすることができる. 1 = 0.80 0.22 0.20
0.00 , 2 = 0.00 0.22 0.20 0.00 , 3 = 0.40 0.00 0.30 0.44 ⋯ , = 1 0 1 0
(3) TF-IDF法における文書ベクトル 11 cos 1 , = 0.83 cos 2
, = 0.48 cos 3 , = 0.74 cos 4 , = 0.30 cos 5 , = 0.00 検索のランキングは,文書1,文書3,文書2,文書4,文書5 となる.
(3) TF-IDF法における文書ベクトル 12 問題点:言語の構造や意味(多義性や同義性)を考慮してない TF, IDFによる類似度の計算方法を変えたり, Word2Vec, Doc2Vec, SCDV, DoCoVを用いるなどの手法を用い
て類似文書検索を模索しているのが現状.
(4) SCDVについて 13 SCDV(Sparse Composite Document Vectors) word2vecのベクトル空間を混合ガウスモデルを用いてクラスタ リングして、各単語がどのトピックに属しているのか、それを考 慮したベクトル空間に修正し,スパース性を持たせたもの.
(4) SCDVについて 14 引用[2]
(4) SCDVについて 15 引用[2]