Pibiri G. E., Venturini R.
Algorithm engineering Scalability n-grams Management and Accounting Information Systems satellite values Kneser-Ney language models Information Retrieval (cs.IR) Databases (cs.DB) FOS: Computer and information sciences Computer Science - Information Retrieval Computer Science - Databases Computer Science Applications Efficiency General Business
Two fundamental problems concern the handling of large n-gram language models: indexing, that is, compressing the n-grams and associated satellite values without compromising their retrieval speed, and estimation, that is, computing the probability distribution of the n-grams extracted from a large textual source. Performing these two tasks efficiently is vital for several applications in the fields of Information Retrieval, Natural Language Processing, and Machine Learning, such as auto-completion in search engines and machine translation. Regarding the problem of indexing, we describe compressed, exact, and lossless data structures that simultaneously achieve high space reductions and no time degradation with respect to the state-of-the-art solutions and related software packages. In particular, we present a compressed trie data structure in which each word of an n-gram following a context of fixed length k, that is, its preceding k words, is encoded as an integer whose value is proportional to the number of words that follow such context. Since the number of words following a given context is typically very small in natural languages, we lower the space of representation to compression levels that were never achieved before, allowing the indexing of billions of strings. Despite the significant savings in space, our technique introduces a negligible penalty at query time. Specifically, the most space-efficient competitors in the literature, which are both quantized and lossy, do not take less than our trie data structure and are up to 5 times slower. Conversely, our trie is as fast as the fastest competitor but also retains an advantage of up to 65% in absolute space. Regarding the problem of estimation, we present a novel algorithm for estimating modified Kneser-Ney language models that have emerged as the de-facto choice for language modeling in both academia and industry thanks to their relatively low perplexity performance. Estimating such models from large textual sources poses the challenge of devising algorithms that make a parsimonious use of the disk. The state-of-the-art algorithm uses three sorting steps in external memory: we show an improved construction that requires only one sorting step by exploiting the properties of the extracted n-gram strings. With an extensive experimental analysis performed on billions of n-grams, we show an average improvement of 4.5 times on the total runtime of the previous approach.
Source: ACM transactions on information systems 37 (2019). doi:10.1145/3302913
Publisher: Association for Computing Machinery,, New York, NY , Stati Uniti d'America
@article{oai:it.cnr:prodotti:402785, title = {Handling massive n-gram datasets efficiently}, author = {Pibiri G. E. and Venturini R.}, publisher = {Association for Computing Machinery,, New York, NY , Stati Uniti d'America}, doi = {10.1145/3302913 and 10.48550/arxiv.1806.09447 and 10.5281/zenodo.3257994 and 10.5281/zenodo.3257995}, journal = {ACM transactions on information systems}, volume = {37}, year = {2019} }
10.1145/3302913
10.48550/arxiv.1806.09447
10.5281/zenodo.3257994
10.5281/zenodo.3257995
arXiv.org e-Print Archive
ACM Transactions on Information Systems
dl.acm.org