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
文字列照合に基づく全文検索について
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
masaya82
January 23, 2018
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
文字列照合に基づく全文検索について
masaya82
January 23, 2018
More Decks by masaya82
See All by masaya82
文献紹介 : More is not always better: balancing sense distributions for all-words
masaya82
0
170
文献紹介:Enhancing Modern Supervised Word Sense Disambiguation Models
masaya82
0
180
文献紹介:The Word Sense Disambiguation Test Suite at WMT18
masaya82
0
120
文献紹介:Preposition Sense Disambiguation and Representation
masaya82
0
150
文献紹介:Word Sense Disambiguation Based on Word Similarity Calculation Using Word Vector Representation from a Knowledge-based Graph
masaya82
0
170
Distributional Lesk: Effective Knowledge-Based Word Sense Disambiguation
masaya82
0
130
Japanese all-words WSD system using the Kyoto Text Analysis ToolKit
masaya82
0
150
Improving Word Sense Disambiguation in Neural Machine Translation with Sense Embeddings
masaya82
0
160
Learning_to_Identify_the_Best_Contexts_for_Knowledge-based_WSD
masaya82
0
150
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
4M
Google's AI Overviews - The New Search
badams
0
1.1k
Done Done
chrislema
186
16k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
250
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Practical Orchestrator
shlominoach
191
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Navigating Team Friction
lara
192
16k
Transcript
文字列照合に基づく 全文検索について 自然言語処理研究室 B3 福嶋 真也
参考文献 北 研二、津田 和彦、獅々堀 正幹 著 「情報検索アルゴリズム」 2002年 共立出版株式会社 平田
富夫 著 「アルゴリズムとデータ構造」 1990年 森北出版会社
全文検索とは 与えられたキーワードに対して、文書中からキーワードと完全 に一致する部分を探し出す技術 テキストエディタの検索コマンドやテキストデータベースの検索、 スペリング検査、テキスト編集などに利用 大きく分けて2つの方法が存在 ・文字列照合を用いる方法 ・索引を用いる方法 今回は文字列照合を用いる方法について紹介
文字列照合に用いられるアルゴリズム 単一のキーワードに対して用いられるアルゴリズム ・ Knuth-Morris-Pratt法(KMP法) ・Boyer-Moore法(BM法) 複数のキーワードに対して用いられるアルゴリズム ・Aho-Corasick法(AC法)
SimpleSearch もっとも単純な文字列照合アルゴリズム キーワード(長さn)に対して検索対象となる文字列(テキストス トリング)の1文字目からn文字目まで一致しているか確認 2文字目からn+1文字まで一致しているか確認 テキストストリングの文字列の末尾まで繰り返す ・ ・ ・
SimpleSearch 例 キーワード abcaba テキストストリング abcabcababcab 位置 1 2 3
4 5 6 7 8 9 10 11 12 13 text a b c a b c a b a b c a b 照合 状況 〇 〇 〇 〇 〇 × × × 〇 〇 〇 〇 〇 ◎ × × 〇 〇 × ×
KMP法 SimpleSearchでは1文字ずつずらす ずらす量を変えることができれば試行回数は少なくなる 失敗関数を用いてずらす量を計算 失敗関数 f(i)=1+max{u|0≦u<i-1,1 2 … = −
−+1 … −1}
KMP法 例 キーワード abcaba テキストストリング abcabcaba 位置 1 2 3
4 5 6 7 8 9 text a b c a b c a b a 照合状況 〇 〇 〇 〇 〇 × 〇 〇 〇 ◎
KMP法 失敗関数 位置 1 2 3 4 5 6 7
キー ワード a b c a b a a b c a b a a b c a b a f(i) 0 1 1 0 1 3 2
BM法 キーワードの末尾から照合をしていくことでずらせる量を増やす 方法 例 キーワード abcaba テキストストリング abcabcaba 位置 1
2 3 4 5 6 7 8 9 text a b c a b c a b a 照合状況 × ◎ 〇 〇 〇 〇 〇
BM法 skip関数 キーワードの末尾から何文字目に目的の文字が存在するかを 示す関数 (もしキーワード内に目的の文字がなければキーワードの長さ がskip関数の値となる) 例:abcaba 文字 Skip関数 a
2 b 1 c 3 その他の文字 6
AC法 マシンACと呼ばれる一種の有限オートマトンを複数のキーワー ドから構成し、これに入力としてテキストストリングを与えること で文字列照合を行う手法 ※有限オートマトン 有限個の状態の遷移と動作の組み合わせからなる「ふるまい のモデル」 現在状態から遷移しうる状態、遷移のきっかけとなる条件を列 挙することで定義される
AC法 マシンAC goto関数、failure関数、output関数からなる goto関数 入力によってどのような状態に遷移するかを示す状態遷移図 failure関数 goto関数で遷移が失敗したときにどの状態になるかを表す関 数 output関数 ある状態になったとき検出されるキーワードを表す関数
AC法 例1:{”ab”,”bc”,”bab”,”d”,”abcde”}のキーワードからなるマシン AC s f(s) 1 0 2 3 3
0 4 0 5 1 6 2 7 0 8 4 9 7 10 0 s output(s) 2 {“ab”} 4 {“bc”} 6 {“bab”,”ab”} 7 {“d”} 8 {“bc”} 9 {“d”} 10 {“abcde”} (a)goto関数 (b)failure関数 (c)output関数
AC法 例2:テキストストリング”xbabcdexを例1の入力として入れた時 の遷移 0 0 3 5 6 8 9
10 0 goto関数による 遷移 failure関数による 遷移 2 0 x b x b a c d e
本日の発表内容 全文検索 ・SimpleSearch ・KMP法 ・BM法 ・AC法