NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Similarity Driven Approximation for Text Analytics

Guangyan Hu, Yongfeng Zhang, Sandro Rigo, Thu D. NguyenarXiv 2019

TL;DR

This paper introduces EmApprox, a framework that speeds up text analytics by approximating query results. It achieves this by using a novel index built from NLP-derived document and word vectors to intelligently sample data subsets most relevant to a query, leading to significant speedups with manageable accuracy trade-offs.

What Problem Does This Paper Address?

Enterprises are drowning in text data and need to extract insights for decision-making. However, processing these massive datasets with sophisticated analytical tools is computationally expensive. This problem is compounded when needing to run diverse query types (like counting occurrences, finding relevant documents, or making recommendations) as each might require specialized indices. EmApprox aims to solve this by providing a unified, approximate approach to speed up a broad range of text analytics queries without needing multiple, specialized indices.

Methods

EmApprox's core innovation lies in its similarity-driven sampling strategy. It first builds a general-purpose index by training a natural language processing (NLP) model, specifically the Paragraph Vector (PV-DBOW) model, to generate compressed vector representations for words and document subcollections. This index acts as a guide during query processing.

When a query arrives, EmApprox computes a query vector and then uses the index to determine the similarity between the query and each document subcollection. Crucially, instead of random sampling, EmApprox prioritizes sampling subcollections that are most similar to the query. The probability of selecting a subcollection is proportional to its similarity to the query. This targeted sampling allows EmApprox to achieve good approximations with significantly less data. To further enhance efficiency, it uses Locality-Sensitive Hashing (LSH) to compress the real-valued vectors into lightweight bit vectors, speeding up similarity computations and reducing storage.

Datasets

The paper uses three datasets for evaluation:

  • Wikipedia: A snapshot of approximately 5 million Wikipedia articles. Used for aggregation and distributed information retrieval (DIR) queries.
  • Common Crawl (CCNews): Approximately 22 million news articles. Used for aggregation and DIR queries.
  • Amazon Reviews: Approximately 142 million user-product interactions. Used for recommendation queries.

The authors note that these datasets are representative of real-world text analytics scenarios.

Key Insights and Ideas

  • Similarity is Key to Efficient Approximation: The central idea is that for many text queries, you don't need to scan the entire dataset. By intelligently focusing on data segments that are semantically similar to the query, you can achieve good approximations with far less computation.
  • A Unified Index for Diverse Queries: EmApprox demonstrates that a single, NLP-based index can effectively guide approximate processing for fundamentally different query types like aggregation, information retrieval, and recommendation. This contrasts with traditional approaches that might require separate indices for each.
  • NLP Embeddings as a Powerful Indexing Tool: Leveraging learned word and document embeddings (like PV-DBOW) provides a rich semantic representation that can be used to compute meaningful similarities, which is crucial for the similarity-driven sampling strategy.
  • LSH for Scalability: Compressing these learned embeddings using LSH is vital for making the index manageable and computations efficient on large-scale datasets, without sacrificing significant precision.

Key Results

EmApprox demonstrated significant improvements over simple random clustered sampling (SRCS) and precise execution:

  • Aggregation Queries: EmApprox achieved much better accuracy than random sampling. For phrase occurrence queries, sampling at 10% led to an average speedup of almost 10x, with estimated relative errors less than 22% for 90% of queries.
  • Distributed Information Retrieval (DIR): While EmApprox achieved higher recall and precision than SRCS, the nature of finding specific items in large datasets limited the achievable speedups. Even at a 75% sampling rate, EmApprox achieved an average speedup of only 1.3x, with recall of 0.89 and P@10 of 0.78.
  • Recommendation Queries: EmApprox outperformed SRCS, offering speedups of over 3x with a 12.5% degradation of P@10 at 25% sampling. The benefits were more pronounced when dealing with a large number of users.
  • Trade-off: Users can tune the sampling rate to balance speed and accuracy, with EmApprox consistently showing better accuracy for a given sampling rate compared to random sampling.

Limitations and Future Work

  • Model Drift: The PV-DBOW model needs to be retrained if the text data set is updated or changes over time, requiring the index to be rebuilt.
  • Unseen Words: The current framework assumes queries do not contain words outside the vocabulary learned during index building.
  • DIR Limitations: For DIR queries, where the goal is to find specific items, approximation is inherently more challenging, and EmApprox's speedups are more modest compared to aggregation or recommendation.
  • Future Work: The authors suggest extending EmApprox to other data types (visual, time series) and exploring its use in more complex scenarios like sentiment analysis or advanced recommendation systems. They also plan to investigate model-based recommendation algorithms and other data sources.

Summary updated

BibTeX
@misc{hu2019similarity,
  author = {Guangyan Hu and Yongfeng Zhang and Sandro Rigo and Thu D. Nguyen},
  title = {{Similarity Driven Approximation for Text Analytics}},
  year = {2019},
  eprint = {1910.07144},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.07144},
}
Figure