Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
文字列照合に基づく全文検索について
Search
masaya82
January 23, 2018
220
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
140
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
160
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
7.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Code Review Best Practice
trishagee
74
20k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Six Lessons from altMBA
skipperchong
29
4.5k
Mind Mapping
helmedeiros
1
360
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
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法