n-Gram/2L: A Space and Time Efficient Two-Level n-Gram Inverted Index Structure

n-gram/2L: 공간 및 시간 효율적인 2단계 n-gram 역색인 구조

  • 김민수 (한국과학기술원 전산학과) ;
  • 황규영 (한국과학기술원 전산학과) ;
  • 이재길 (한국과학기술원 전산학과) ;
  • 이민재 ((주)네오위즈 연구소)
  • Published : 2006.02.01

Abstract

The n-gram inverted index has two major advantages: language-neutral and error-tolerant. Due to these advantages, it has been widely used in information retrieval or in similar sequence matching for DNA and Protein databases. Nevertheless, the n-gram inverted index also has drawbacks: the size tends to be very large, and the performance of queries tends to be bad. In this paper, we propose the two-level n-gram inverted index (simply, the n-gram/2L index) that significantly reduces the size and improves the query performance while preserving the advantages of the n-gram inverted index. The proposed index eliminates the redundancy of the position information that exists in the n-gram inverted index. The proposed index is constructed in two steps: 1) extracting subsequences of length m from documents and 2) extracting n-grams from those subsequences. We formally prove that this two-step construction is identical to the relational normalization process that removes the redundancy caused by a non-trivial multivalued dependency. The n-gram/2L index has excellent properties: 1) it significantly reduces the size and improves the Performance compared with the n-gram inverted index with these improvements becoming more marked as the database size gets larger; 2) the query processing time increases only very slightly as the query length gets longer. Experimental results using databases of 1 GBytes show that the size of the n-gram/2L index is reduced by up to 1.9${\~}$2.7 times and, at the same time, the query performance is improved by up to 13.1 times compared with those of the n-gram inverted index.

n-gram 기반 역색인 구조는 언어 중립적이고 에러 허용적인 장점들로 인해 일부 아시아권 언어에 대한 정보 검색이나 단백질과 DNA의 sequence의 근사 문자열 매칭에 유용하게 사용되고 있다. 그러나, n-gram 기반의 역색인 구조는 색인의 크기가 크고 질의 처리 시간이 오래 걸린다는 단점들을 가지고 있다. 이에 본 논문에서는 n-gram 기반 역색인의 장점을 그대로 유지하면서 색인의 크기를 줄이고 질의 처리 성능을 향상시킨 2단계 n-gram 역색인(간단히 n-gram/2L 역색인이라 부른다)을 제안한다. n-gram/2L 역색인은 n-gram 기반 역색인에 존재하던 위치 정보의 중복을 제거한다. 이를 위해 문서로부터 길이 m의 m-subsequence들을 추출하고, 그 m-subsequence들로부터 n-gram을 추출하여 2단계로 역색인을 구성한다. 이러한 2단계 구성 방법은 이론적으로 의미 있는 다치 종속성이 존재하는 릴레이션을 정규화하여 중복을 제거하는 것과 동일하며, 이를 본문에서 정형적으로 증명한다. n-gram/2L 역색인은 데이타의 크기가 커질 수록 n-gram 역색인에 비해 색인 크기가 줄어들며 질의 처리 성능이 향상되고, 질의 문자열의 길이가 길어져도 질의 처리 시간이 거의 증가하지 않는 좋은 특성을 가진다. 1GByte 크기의 데이타에 대한 실험을 통하여, n-gram/2L 역색인은 n-gram 기반 역색인에 비해 최대 1.9${\~}$2.7배 더 작은 크기를 가지면서, 동시에 질의 처리 성능은 3${\~}$18 범위의 길이를 가지는 질의들에 대해 최대 13.1배 향상됨을 보였다.

Keywords

References

  1. Ricardo Baeza-Yates and Berthier Ribeiro-Neto, Modern Information Retrieval, ACM Press, 1999
  2. Hugh E. Williams and Justin Zobel, 'Indexing and Retrieval for Genomic Databases,' IEEE Trans. on Knowledge and Data Engineering, Vol. 14, No. 1, pp, 63-78, Jan./Feb. 2002 https://doi.org/10.1109/69.979973
  3. Gonzalo Navarro, 'A Guided Tour to Approximate String Matching,' ACM Computing Surveys, Vol. 33, No. 1, pp. 31-88, Mar. 2001 https://doi.org/10.1145/375360.375365
  4. I. Witten, A. Moffat, and T. Bell, Managing Gigabytes: Compressing and Indexing Documents and Images, Morgan Kaufmann Publishers, Los Altos, California, 2nd ed., 1999
  5. James Mayfield and Paul McNamee, 'Single N-gram Stemming,' In Proc. Int'l Conf. on Information Retrieval, ACM SIGIR, Toronto, Canada, pp. 415-416, July/Aug. 2003 https://doi.org/10.1145/860435.860528
  6. Ethan Miller, Dan Shen, Junli Liu, and Charles Nicholas, 'Performance and Scalability of a Large-Scale N-gram Based Information Retrieval System,' Journal of Digital Information 1(5), pp. 1-25, Jan. 2000
  7. Alistair Moffat and Justin Zobel, 'Self-indexing inverted files for fast text retrieval,' ACM Trans. on Information Systems, Vol. 14, No. 4, pp. 349-379, Oct. 1996 https://doi.org/10.1145/237496.237497
  8. Falk Scholer, Hugh E. Williams, John Yiannis and Justin Zobel, 'Compression of Inverted Indexes for Fast Query Evaluation,' In Proc. Int'l Conf. on Information Retrieval, ACM SIGIR, Tampere, Finland, pp. 222-229, Aug. 2002 https://doi.org/10.1145/564376.564416
  9. Joon Ho Lee and Jeong Soo Ahn, 'Using n-Grams for Korean Text Retrieval,' In Proc. Int'l Conf. on Information Retrieval, ACM SIGIR, Zurich, Switzerland, pp. 216-224, 1996 https://doi.org/10.1145/243199.243269
  10. Kyu-Young Whang, Min-Jae Lee, Jae-Gil Lee, Min-soo Kim, and Wook-Shin Han, 'Odysseus-a High-Performance ORDBMS Tightly-Coupled with IR Features,' In Proc. the 21th IEEE Int'l Conf. on Data Engineering(ICDE), Tokyo, Japan, Apr. 2005 https://doi.org/10.1109/ICDE.2005.95
  11. Jonathan D. Cohen, 'Recursive Hashing Functions for n-Grams,' ACM Trans. on Information Systems, Vol. 15, No. 3, pp. 291-320, July 1997 https://doi.org/10.1145/256163.256168
  12. Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems, Addison Wesley, 4th ed., 2003
  13. Abraham Silberschatz, Henry F. Korth, and S. Sudarshan, Database Systems Concepts, McGraw-Hill, 4th ed., 2001
  14. Jeffery D. Ullman, Principles of Database and Knowledge-Base Systems Vol. I, Computer Science Press, USA, 1988
  15. Raghu Ramakrishnan, Database Management Systems, McGraw-Hill, 1998
  16. Hugh E. Williams, 'Genomic Information Retrieval,' In Proc. the 14th Australasian Database Conferences, 2003
  17. Karen Kukich, 'Techniques for Automatically Correcting Words in Text,' ACM Computing Surveys, Vol. 24, No. 4, pp. 377-439, Dec. 1992 https://doi.org/10.1145/146370.146380