Journal article Open Access

# Handling Massive N-Gram Datasets Efficiently

Ermanno Pibiri, Giulio; Venturini, Rossano

### JSON Export

{
"files": [
{
"self": "https://zenodo.org/api/files/166b5c91-53ef-4b4d-8777-26f6a8330fa3/Handling%20Massive%20N-Gram%20Datasets%20Efficiently.pdf"
},
"bucket": "166b5c91-53ef-4b4d-8777-26f6a8330fa3",
"key": "Handling Massive N-Gram Datasets Efficiently.pdf",
"type": "pdf",
"size": 3012678
}
],
"owners": [
48887
],
"doi": "10.5281/zenodo.3257995",
"stats": {
"unique_views": 26.0,
"views": 26.0,
"version_views": 26.0,
"version_unique_views": 26.0,
"volume": 126532476.0,
"version_volume": 126532476.0
},
"doi": "https://doi.org/10.5281/zenodo.3257995",
"conceptdoi": "https://doi.org/10.5281/zenodo.3257994",
"bucket": "https://zenodo.org/api/files/166b5c91-53ef-4b4d-8777-26f6a8330fa3",
"html": "https://zenodo.org/record/3257995",
"latest_html": "https://zenodo.org/record/3257995",
"latest": "https://zenodo.org/api/records/3257995"
},
"conceptdoi": "10.5281/zenodo.3257994",
"created": "2019-06-27T07:59:23.006989+00:00",
"updated": "2020-01-20T15:26:04.754528+00:00",
"conceptrecid": "3257994",
"revision": 5,
"id": 3257995,
"access_right_category": "success",
"doi": "10.5281/zenodo.3257995",
"version": "1.0 | Final",
"language": "eng",
"title": "Handling Massive N-Gram Datasets Efficiently",
"id": "CC-BY-4.0"
},
"related_identifiers": [
{
"scheme": "doi",
"identifier": "10.5281/zenodo.3257994",
"relation": "isVersionOf"
}
],
"relations": {
"version": [
{
"count": 1,
"index": 0,
"parent": {
"pid_type": "recid",
"pid_value": "3257994"
},
"is_last": true,
"last_child": {
"pid_type": "recid",
"pid_value": "3257995"
}
}
]
},
"communities": [
{
"id": "bigdatagrapes"
}
],
"grants": [
{
"code": "780751",
"self": "https://zenodo.org/api/grants/10.13039/501100000780::780751"
},
"title": "Big Data to Enable Global Disruption of the Grapevine-powered Industries",
"acronym": "BigDataGrapes",
"program": "H2020",
"funder": {
"doi": "10.13039/501100000780",
"acronyms": [],
"name": "European Commission",
"self": "https://zenodo.org/api/funders/10.13039/501100000780"
}
}
}
],
"keywords": [
"satellite values; Kneser-Ney language models; n-grams"
],
"publication_date": "2018-06-25",
"creators": [
{
"orcid": "0000-0003-0724-7092",
"affiliation": "CNR",
"name": "Ermanno Pibiri, Giulio"
},
{
"orcid": "0000-0002-9830-3936",
"affiliation": "CNR",
"name": "Venturini, Rossano"
}
],
"access_right": "open",
"resource_type": {
"subtype": "article",
"type": "publication",
"title": "Journal article"
},
"description": "<p>This paper deals with the two fundamental problems concerning the handling of large n-gram language models: indexing, that is compressing the n-gram strings and associated satellite data without compromising their retrieval speed; and estimation, that is computing the probability distribution of the strings from a large textual source. Performing these two tasks efficiently is fundamental 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.</p>\n\n<p>Regarding the problem of indexing, we describe compressed, exact and lossless data structures that achieve, at the same time, high space reductions and no time degradation with respect to state-of-the-art solutions and related software packages. In particular, we present a compressed trie data structure in which each word following a context of fixed length k, i.e., 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. Despite the significant savings in space, our technique introduces a negligible penalty at query time. Compared to the state-of-the-art proposals, our data structures outperform all of them for space usage, without compromising their time performance. More precisely, the most space-efficient proposals in the literature, that are both quantized and lossy, are not smaller than our trie data structure and up to 5 times slower. Conversely, we are as fast as the fastest competitor, but also retain an advantage of up to 65% in absolute space.</p>\n\n<p>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-theart algorithm uses three sorting steps in external memory: we show an improved construction that requires only one sorting step thanks to 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 running time of the state-of-the-art approach.</p>"
}
}
26
42
views