One-Pass, One-Hash n-Gram Statistics Estimation
Daniel Lemire, Owen Kaser
Abstract
In multimedia, text or bioinformatics databases, applications query sequences of n consecutive symbols called n-grams. Estimating the number of distinct n-grams is a view-size estimation problem. While view sizes can be estimated by sampling under statistical assumptions, we desire an unassuming algorithm with universally valid accuracy bounds. Most related work has focused on repeatedly hashing the data, which is prohibitive for large data sources. We prove that a one-pass one-hash algorithm is sufficient for accurate estimates if the hashing is sufficiently independent. To reduce costs further, we investigate recursive random hashing algorithms and show that they are sufficiently independent in practice. We compare our running times with exact counts using suffix arrays and show that, while we use hardly any storage, we are an order of magnitude faster. The approach further is extended to a one-pass/one-hash computation of n-gram entropy and iceberg counts. The experiments use a large collection of English text from the Gutenberg Project as well as synthetic data.
Create a lesson
Related papers
Intelligent Edge Computing
Kalgi Gandhi, Minal Bhise
GRBench: A Comprehensive Benchmark Evaluation for Graph-relational Data Management
Zepeng Liu, Xinxin Huang, Xuanming Liu et al.
Strengthening LargeRDFBench for Interoperable Federated SPARQL Evaluation
Bryan-Elliott Tam, Muhammad Saleem, Ruben Taelman
Detecting DBMS Bugs by Constructing Equivalent Representations of Intermediate Query Results
Xiaoxu Niu, Gong Chen, Jinfu Chen et al.
ELASTIC: Trajectory-Based Synchronization of Event and Tracking Data in Soccer
Hyunsung Kim, Hoyoung Choi, Kunhee Lee et al.
Demystifying and Improving Lazy Promotion in Cache Eviction
Qinghan Chen, Muhammad Haekal Muhyidin Al-Araby, Ziyue Qiu et al.