Natural Language Interface for Queries on Databases with Sensitive Information
The analysis of large datasets poses significant challenges for users unfamiliar with structured query languages such as SQL or Cypher. These users, often from fields like social sciences or law enforcement, require intuitive and secure access to complex databases. Additionally, datasets in domains such as criminal justice, healthcare, and education often contain sensitive information, necessitating robust privacy protections. To address these challenges, we propose a privacy-preserving natural language interface for querying graph databases. Our framework integrates Optical Character Recognition (OCR) techniques to extract structured data from scanned and unstructured documents, storing it in a Neo4j graph database to efficiently model entity relationships. To facilitate user interaction, we leverage a Large Language Model (LLM)-powered query translation module that converts natural language queries into Cypher, eliminating the need for technical expertise. To enhance privacy, our framework pseudonymizes sensitive entities using entity masking before query translation, ensuring that personally identifiable information within the user queries is never exposed to the LLM. Additionally, the Neo4j database is entirely separated from the LLM, meaning that the LLM only has access to the database schema and not any stored data. This ensures that query processing occurs in a controlled, authenticated environment, mitigating risks of data leakage. We also enforce schema-aware query translation, which significantly improves accuracy by guiding the LLM with structured database constraints. We evaluate our system using real-world criminal records and the publicly available Text2Cypher dataset, demonstrating high logical and execution accuracy. Computational performance analysis shows that our privacy mechanisms introduce only minimal latency overhead (<tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\sim 5-8 \%$</tex>), making them suitable for real-time applications. Our results confirm that this framework effectively balances accessibility, accuracy, and privacy, making it applicable to sensitive domains where secure, user-friendly data retrieval is essential.
Authors
- Suli Adeniye
- Faisal Alatawi (ORCID: https://orcid.org/0000-0003-0723-5016)
- Arunabha Sen (ORCID: https://orcid.org/0000-0002-5795-3465)
Institutions
- Arizona State University (US)
Publication Details
- Published
- 2025-06-24
- DOI
- https://doi.org/10.1109/icad65464.2025.11114052
- Primary Topic
- Advanced Database Systems and Queries
- Type
- article
- Field-Weighted Citation Impact
- 0.00