150 likes | 264 Views
半構造化テキストに対する 文字列照合アルゴリズム. 喜田 拓也 * 貴福 友晴 † 竹田 正幸 † * 九州大学附属図書館研究開発室 † 九州大学システム情報科学府情報理学専攻. 発表者: 喜田 拓也. 発表内容. 研究の目的 既存の手法 我々のアプローチ 文字列照合による処理の利点と問題点 提案アルゴリズム 誤検出を回避する方法 パスを考慮した照合処理 実験結果 まとめ. person. name. first. last. Makiko. Tanaka. 既存の手法. XML 文書. メモリ. XMLパーサー. DOM API.
E N D
半構造化テキストに対する文字列照合アルゴリズム半構造化テキストに対する文字列照合アルゴリズム 喜田 拓也* 貴福 友晴† 竹田 正幸† *九州大学附属図書館研究開発室†九州大学システム情報科学府情報理学専攻 発表者: 喜田 拓也
発表内容 • 研究の目的 • 既存の手法 • 我々のアプローチ • 文字列照合による処理の利点と問題点 • 提案アルゴリズム • 誤検出を回避する方法 • パスを考慮した照合処理 • 実験結果 • まとめ 2001年度冬のLAシンポジウム
person name first last Makiko Tanaka 既存の手法 XML文書 メモリ XMLパーサー DOM API プログラム XML文書 2001年度冬のLAシンポジウム
我々のアプローチ XML文書 メモリ 文字列照合アルゴリズム <person> <name> <first> Makiko </first> <last> Tanaka </last> </name> </person> プログラム XML文書 2001年度冬のLAシンポジウム
利点 • 巨大なXML文書や大量の文書群を一括に処理 • 複数の質問を同時に処理 処理が高速 XML文書 少ないメモリで可 様々な応用 木構造 2001年度冬のLAシンポジウム
文字列照合問題 パタン matching Pattern matching is one of the most fundamental operations in string processing. Recently, a new trend for accelerating pattern matching has emerged: Speeding up pattern matching by text compression. From the traditional criteria for data compression, i.e., compression ratio and compression/decompression time, adaptive dictionary methods such as the Lempel-Ziv family are often preferred. However, such methods cannot speed up the pattern matching since an extra work is needed to keep track of compression mechanism. テキスト Knuth-Morris-Pratt (1974) Boyer-Moore (1977) Aho-Corasick (1975) Shift-Or (1992) 2001年度冬のLAシンポジウム
Aho-Corasick(AC)照合機械 パタン集合:={other, <mother>} o t h e r other 0 1 2 3 4 5 任意の文字 < m o t h e r > 14 6 7 8 9 10 11 12 13 other <mother> goto遷移 failure遷移 2001年度冬のLAシンポジウム
誤った検出 問題点 • タグ名の一部分とマッチする <body> <h1>あのTVCM</h1> <p> <mother> mother </mother> mを取ったらother、 <other> 他人 </other> です. </p> </body> 2001年度冬のLAシンポジウム
< 以外の文字 < > > 以外の文字 < 以外の文字 o t h e r other 14 0 1 2 3 4 5 < < > m o t h e r > 15 6 7 8 9 10 11 12 13 <mother> > 以外の文字 解決策 2001年度冬のLAシンポジウム
< 以外の文字 < > 14 15 0 > 以外の文字 < 以外の文字 o t h e r other 14 0 1 2 3 4 5 < < > m o t h e r > 15 6 7 8 9 10 11 12 13 <mother> > 以外の文字 PMM構築方法 2001年度冬のLAシンポジウム
<mother> <mother nature=“tender”> <mother nature=“hard”> ・・・ < 以外の文字 < 以外の文字 o t h e r o t h e r > 以外の文字 other 14 0 1 2 3 4 5 14 0 1 2 3 4 5 other 16 > < < < > < > m o t h e r m o t h e r > 15 ] 15 6 7 8 9 10 11 12 13 > 6 7 8 9 10 11 12 13 <mother> <mother> > 以外の文字 > 以外の文字 属性の取り扱い 同じタグ <mother> 2001年度冬のLAシンポジウム
パスを考慮した照合 苗字が「Tanaka」の人を探したい! <person><name><last>がTanaka (Xpathだと,要素 //person/name/last/ が「Tanaka」) 2001年度冬のLAシンポジウム
スタック 0 (<last>,2) <person> 以外のタグ <person> <person> (<name>,1) 1 (<person>,0) (<xml>,0) <name> 2 14 0 1 2 3 4 5 o t h e r <last> 3 < 以外の文字 15 < other 6 7 8 9 10 11 12 13 < > m o t h e r > <mother> > 以外の文字 アイデア ={<person>,</person>,<name>,</name>,<last>,</last>,…}={Tanaka} 2001年度冬のLAシンポジウム
実験結果 • Sgrep(J. Jaakkola and P. Kilpeläinen)との比較 CPU時間(秒) テキスト:110MB(英文テキスト) CPU : Celelon 366MHz メモリ : 128MB OS : Kondara/MNU Linux 2.1 RC2 2001年度冬のLAシンポジウム
まとめ • XML文書に対する文字列照合処理 • 誤検出しない効率的な照合機械の構築 • パスを考慮したアルゴリズム • Sgrepに比べ3倍以上高速 • 今後の課題 • 複数文字列を一度に置換するアルゴリズムの開発[3] • XML文書を圧縮して処理を高速化[6] 2001年度冬のLAシンポジウム