COREQQA - A COmpliance REQuirements Understanding using Question Answering Tool

Sallam Abualhaija, Chetan Arora, Lionel C. BriandESEC/SIGSOFT FSE 2022

Sure, here's a blog-style summary of the COREQQA paper:

TL;DR

This paper introduces COREQQA, a novel tool that leverages advanced Question Answering (QA) techniques to help requirements engineers quickly understand complex compliance regulations within legal documents. By allowing engineers to ask natural language questions, COREQQA automatically identifies and highlights relevant text passages, significantly reducing the time and effort required for compliance analysis.

What Problem Does This Paper Address?

In today's increasingly regulated world, software systems must adhere to a growing number of compliance requirements, such as data protection laws like GDPR. Requirements engineers (REs) are tasked with ensuring these systems meet these obligations. However, legal documents are often lengthy, dense, and filled with complex language, making it incredibly challenging and time-consuming for REs to manually sift through them to find the specific information needed to define compliance requirements. This manual process is not only inefficient but also prone to errors, potentially leading to non-compliance and its associated legal and financial repercussions.

Methods

COREQQA employs a multi-stage approach to tackle this challenge:

  1. Text Preprocessing and Partitioning: Legal documents are first processed using standard NLP techniques like tokenization and sentence splitting. To manage the input size for underlying QA models, documents are then partitioned into "context spans" of a maximum of 512 tokens. This is done by splitting paragraphs and iteratively checking their size to maintain coherence.
  2. Relevant Context Retrieval: This is a key innovation. Instead of assuming the answer's location, COREQQA first identifies the most relevant context spans. It uses a BERT cross-encoder (BCE) model to compute the semantic similarity between the user's natural language question and each context span. The span with the highest similarity score (based on its sentences) is considered most relevant. The system then ranks these spans and selects the top-N most relevant ones.
  3. Answer Extraction: The top-N relevant context spans and the original question are then fed into a pre-trained QA model (specifically, RoBERTa-QA). This model extracts potential answers from these spans and highlights them.
  4. Final Output Representation: The tool presents the results to the requirements engineer as a Microsoft Word document, including the top-N context spans, the highlighted answers, and a confidence score for each answer.

Datasets

The paper describes an evaluation conducted on four legal documents:

  • GDPR (General Data Protection Regulation) (EU) 2016/679: A European privacy law.
  • Directive (EU) 2019/770: Regulating the supply of digital content or services.
  • Directive (EU) 2019/771: Concerning the sale of goods.
  • Luxembourg Law of 25 March 2020: Related to electronic data retrieval for bank accounts.

Question-answer pairs for evaluation were identified by two domain experts: one in legal informatics and another in requirements engineering. The paper does not mention training a new dataset but rather leverages existing pre-trained language models.

Key Insights and Ideas

  • Bridging the RE-Legal Gap: COREQQA effectively bridges the gap between the natural language understanding capabilities of modern NLP models and the complex, domain-specific language of legal texts, making compliance information accessible to non-legal experts.
  • Beyond Simple QA: The two-step process of first retrieving relevant context spans before extracting answers is crucial. This addresses the practical limitation that REs don't know where in a long document the answer might be.
  • Handling Discontiguous Information: The tool's ability to identify multiple relevant context spans (even from different sections) is vital for capturing a complete understanding of a compliance requirement, which might be spread across a document.
  • Efficiency Gains: The core idea is that even with the overhead of reviewing multiple context spans, COREQQA is significantly more efficient than manual document traversal.

Key Results

  • The BERT cross-encoder (BCE) was found to be significantly more accurate than TF-IDF for context span retrieval.
  • ROBERTa-QA was the most accurate among the evaluated QA models (BERT, ALBERT, ELECTRA) for answer extraction, correctly extracting answers for 97% of questions.
  • COREQQA successfully retrieved the correct context span for 100 out of 107 questions within the top-5 spans.
  • The tool can answer a question from a document with an average of 620 sentences in approximately 34 seconds.
  • The evaluation identified that generic questions and those with composite conditions were more challenging for the tool.

Limitations and Future Work

  • Limitations: The paper notes that generic questions (e.g., defining a legal concept) and questions with complex conditions were more difficult for COREQQA to answer accurately. This is attributed to the ambiguity and multiple instances of such concepts within legal texts.
  • Future Work: The authors plan to conduct a user study to assess the practical usefulness of COREQQA for requirements engineers.

Summary updated

BibTeX
@inproceedings{abualhaija2022coreqqa,
  author = {Sallam Abualhaija and Chetan Arora and Lionel C. Briand},
  title = {{COREQQA - A COmpliance REQuirements Understanding using Question Answering Tool}},
  booktitle = {ESEC/SIGSOFT FSE},
  year = {2022},
}
Figure