1 / 22

Java ソフトウェア部品検索システムのための索引付け手法の提案と実装

Java ソフトウェア部品検索システムのための索引付け手法の提案と実装. 大阪大学基礎工学情報科学科 井上研究室 梶田 泰伸. 研究背景. Java ソフトウェア部品検索システム SPARS-J を開発 検索語に対して全文検索を行い,検索語と関連した部品(クラス、インターフェイス)のソースコードを提供 あらかじめソースコードに対し 索引付け を行い、 索引語 をデータベースに登録   →検索語と一致する索引語を検索 用語 索引語 : 文書の内容を特徴付ける単語 索引付け : 文書中から索引語を抽出する処理.

idra
Download Presentation

Java ソフトウェア部品検索システムのための索引付け手法の提案と実装

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Javaソフトウェア部品検索システムのための索引付け手法の提案と実装Javaソフトウェア部品検索システムのための索引付け手法の提案と実装 大阪大学基礎工学情報科学科 井上研究室 梶田 泰伸

  2. 研究背景 • Javaソフトウェア部品検索システムSPARS-Jを開発 • 検索語に対して全文検索を行い,検索語と関連した部品(クラス、インターフェイス)のソースコードを提供 • あらかじめソースコードに対し索引付けを行い、索引語をデータベースに登録   →検索語と一致する索引語を検索 • 用語 • 索引語 : 文書の内容を特徴付ける単語 • 索引付け : 文書中から索引語を抽出する処理 2004/2/26 特別研究発表会

  3. static boolean safetyCheck(int row){ for (int j=1; j<column; j++) if (board[j] == row) return false ; } return true ; } 現状の問題点 • 全ての語を抽出しそのまま索引語としている • 複合語“safetyCheck”が存在 • 検索語“safety”や“check”にマッチしない • この部品は検索されない • 検索漏れ • 不要語が存在 • データベース容量の無駄 2004/2/26 特別研究発表会

  4. 索引語の拡張 不要語の除去 研究の目的 • Javaソースコードの特性を生かした索引付け手法を提案する • 検索漏れを減らすため • 適合部品: • データベースの容量の増加を抑えるため • 検索語が出現する部品 • 検索語が、語形変化して出現する部品 2004/2/26 特別研究発表会

  5. 提案手法の概要 • ソースコードはプログラム部とコメント部に分かれる • プログラム部:文法はプログラム言語に依存 → Java • コメント部:文法は自然言語に依存 → 英語 • 不要語の除去 1.プログラム部、コメント部 2.プログラム部 • 索引語の拡張 3.コメント部 2004/2/26 特別研究発表会

  6. 不要語の除去(プログラム部、コメント部) • 不要語とは • その語が他の多くの部品に存在し、出現した部品を絞り込むのに役に立たない語 2004/2/26 特別研究発表会

  7. 索引付けの例(不要後の除去:プログラム部、コメント部)索引付けの例(不要後の除去:プログラム部、コメント部) • 以下の不要語の除去 sample case roomNumber column string1 string2 saftyCheck row column board row method checks argument /* This is a sample case. */ class roomNumber { static int column = 10, a0, a1; static char string1, string2; static boolean saftyCheck ( int row ){ for ( int j = 1; j < column; j++){ if ( board[ j ] == row ) return false; } return true; } // This method checks 1 argument. } This is a sample case class roomNumber static int column a0 a1 static char string1 string2 static boolean saftyCheck int row for int j j column j if board j row return false return true This method checks argument This is sample case class roomNumber static int column static char string1 string2 static boolean saftyCheck int row for int column if board row return false return true This method checks argument /* This is a sample case. */ class roomNumber { static int column = 10, a0, a1; static char string1, string2; static boolean saftyCheck ( int row ){ for ( int j = 1; j < column; j++){ if ( board[ j ] == row ) return false; } return true; } // This method checks 1 argument. } C: This is sample case roomNumber column string1 string2 saftyCheck row column board row This method checks argument This is sample case roomNumber column string1 string2 saftyCheck row column board row This method checks argument This is a sample case class roomNumber static int column 10 a0 a1 static char string1 string2 static boolean saftyCheck int row for int j 1 j column j if board j row return false return true This method checks 1 argument This is a sample case class roomNumber static int column a0 a1 static char string1 string2 static boolean saftyCheck int row for int j j columnj if board j row return false return true This method checks argument This is sample case class roomNumber staticint column static char string1 string2 static boolean saftyCheck int row for int column if board row return false return true This method checks argument This is a sample case class roomNumber static int column 10 a0 a1 static char string1 string2 static boolean saftyCheck int row for int j 1 j column j if board j row return false return true This method checks 1 argument • 記号 • 記号 • 数字のみの語 • 数字のみの語 • 1文字の語 • 1文字の語 • 予約語 • 予約語 • 不要な品詞の語 • 不要な品詞の語 C: 2004/2/26 特別研究発表会

  8. 索引語の拡張(プログラム部) • 複合語の切り分け • Javaでは、複合している単語の始まりは大文字で書き、残りは小文字で書く慣例 • 小文字から大文字になる箇所で切り分ける       • 大文字から小文字になる箇所の1つ前の文字で切り分ける • “$”、”_” でも切り分け • 省略語を本来の形にする • 省略語リストを作成(現在70語程度) • 語の最後が数字なら数字を除去する tmp temporary err error 新たに索引語とする readInputFile add ID Key addIDKey add IDKey addID IDKey getProcessID 2004/2/26 特別研究発表会

  9. 索引付けの例(索引語の拡張:プログラム部)索引付けの例(索引語の拡張:プログラム部) • プログラム部の索引語の拡張 sample case roomNumber room Number column string1 string2 safety Check safetyCheck row column board row method checks argument sample case roomNumber room Number column string string1 string2string safety Check safetyCheck row column board row method checks argument sample case roomNumber column string1 string2 safetyCheck row column board row method checks argument sample case roomNumber column string1 string2 safetyCheck row column board row method checks argument sample case roomNumber room Number column stringstring1 string2string safety Check safetyCheck row column board row method checks argument sample case roomNumberroom Number column string1 string2 safety ChecksafetyCheck row column board row method checks argument sample case roomNumber room Number column string1 string2 safety Check safetyCheck row column board row method checks argument C: • 複合語の切り分け • 複合語の切り分け • 省略語の復元 • 省略語の復元 • 末尾の数字を除去 • 末尾の数字を除去 C: 2004/2/26 特別研究発表会

  10. 索引語の拡張(コメント部) • 複合語の切り分け • 原形でない語は、原形も索引語とする • 形態素解析ツール TreeTagger を利用 • 入力された単語を解析して、その単語の品詞情報と原形を出力 • 例:“She saw men”を入力すると She PP she sawVVD see menNNS man • 品詞情報は、不要語の除去に利用 品詞情報 原形 2004/2/26 特別研究発表会

  11. 索引付けの例(索引語の拡張:コメント部) • コメント部の索引語の拡張 sample case roomNumber room Number column string string1 string2string safety Check safetyCheck row column board row method checks argument sample case roomNumber room Number column string string1 string2string safety Check safetyCheck row column board row method checks argument sample case roomNumber room Number column string string1 string2string safety Check safetyCheck row column board row check method checks argument C: sample case roomNumber room Number column string string1 string2string safety Check safetyCheck row column board row check method checks argument • 複合語の切り分け • 原形でない語を原形に戻す • 原形でない語を原形に戻す 索引語として 登録 C: データベース 2004/2/26 特別研究発表会

  12. 検索された部品中の適合部品の数 全部品の中の適合部品の数 • 再現率= 評価 • 検索漏れをどの程度減らすことができるか • 検索漏れの少なさを示す尺度 • 5種類の検索語で検索 • 手法適用前と手法適用後で再現率を比較 • データベース容量の増加はどの程度抑えられるか • 5種類のソースコード群に対してデータベースを作成 • 不要語除去前と不要語除去後でサイズ(KB)を比較 2004/2/26 特別研究発表会

  13. 再現率 K1 K2 K3 K4 K5 検索語 再現率の変化 • Netscape DevEdgeで公開されているソースコード261ファイル(部品数281)を対象 • 全ての検索語おいて再現率が上昇 • 複合語の切り分けが完全でなかった • “scrollbar” が “bar” で検索されない 2004/2/26 特別研究発表会

  14. データベース容量の変化 -17.2% -25.3% -18.2% -22.1% -20.7% 平均 -20.7% • 部品数に関わらず、データベース容量の増加が約20%抑えられた 2004/2/26 特別研究発表会

  15. まとめと今後の課題 • Javaソフトウェア部品検索システムのための索引付けを提案した • 索引語を拡張することにより、検索漏れを減らすことができた • 不要語を除去することにより、索引語拡張の際のデータベース容量の増加が約20%抑えられた • 今後の課題 • 複合語のより完全な切り分け • コメント部が日本語である場合の提案手法の適用 • 他のプログラム言語への提案手法の適用 2004/2/26 特別研究発表会

  16. 発表終了 2004/2/26 特別研究発表会

  17. 補足:5種類の検索キー 2004/2/26 特別研究発表会

  18. 補足:各手法の検索結果の比較 2004/2/26 特別研究発表会

  19. 補足:各手法のデータベース容量の変化 2004/2/26 特別研究発表会

  20. 補足:各手法の索引語総数の変化 2004/2/26 特別研究発表会

  21. 補足:各手法の処理時間の変化 2004/2/26 特別研究発表会

  22. 補足:処理の流れ ・拡張した索引語 を登録 ・不要語除去 抽出した語 4 5 Word DB プログラム部 ・字句解析 JAVA ソース コード ・索引語として登録 コメント部 3 4 5 1 ・コメント部の語 抽出 ・不要語 除去 ・拡張した 索引語を登録 ・不要な品詞    の語を除去 索引品詞 リスト ・参照 ・形態素解析 コメント部 の語 品詞原形 参照表 2 2004/2/26 特別研究発表会

More Related