Skip to main content
QUICK REVIEW

[Paper Review] Towards Automatic Comparison of Data Privacy Documents: A Preliminary Experiment on GDPR-like Laws

Kornraphop Kawintiranon, Yaguang Liu|arXiv (Cornell University)|May 21, 2021
Topic ModelingComputer Science13 references5 citations
TL;DR

This paper proposes an NLP-based approach to automatically compare GDPR-like data privacy laws using BERT embeddings and cosine similarity to measure document similarity. It demonstrates that BERT outperforms TF-IDF and word embeddings in identifying similar recitals and articles between GDPR and Brazil’s LGPD, achieving 70% accuracy at the recital level and 70% at the article level, with publicly released data and code for further research.

ABSTRACT

General Data Protection Regulation (GDPR) becomes a standard law for data protection in many countries. Currently, twelve countries adopt the regulation and establish their GDPR-like regulation. However, to evaluate the differences and similarities of these GDPR-like regulations is time-consuming and needs a lot of manual effort from legal experts. Moreover, GDPR-like regulations from different countries are written in their languages leading to a more difficult task since legal experts who know both languages are essential. In this paper, we investigate a simple natural language processing (NLP) approach to tackle the problem. We first extract chunks of information from GDPR-like documents and form structured data from natural language. Next, we use NLP methods to compare documents to measure their similarity. Finally, we manually label a small set of data to evaluate our approach. The empirical result shows that the BERT model with cosine similarity outperforms other baselines. Our data and code are publicly available.

Motivation & Objective

  • To address the time-consuming and expert-dependent task of comparing GDPR-like data privacy laws across countries.
  • To develop an automated, NLP-driven approach for measuring similarity between legal documents in different languages.
  • To evaluate the performance of various NLP models—especially BERT—on legal document similarity in the context of data privacy regulations.
  • To release a structured dataset and codebase to support future research in legal NLP and cross-jurisdictional privacy law comparison.

Proposed method

  • Extracted legal content from GDPR and LGPD into structured units: recitals, articles, sections, and chapters.
  • Transformed natural language text into vector representations using pre-trained BERT, TF-IDF, word embeddings (GloVe), and Siamese BERT models.
  • Computed document similarity using cosine similarity between embedded representations of legal text pairs.
  • Conducted manual labeling of 10 article pairs across 10 legal topics to create a small gold-standard evaluation set.
  • Evaluated model performance using HIT@1 (top-1 accuracy) on both recital and article levels.
  • Released the annotated dataset and code at https://github.com/kornosk/GDPR-similarity-comparison for reproducibility and further research.

Experimental results

Research questions

  • RQ1Can NLP techniques effectively measure semantic similarity between GDPR-like data privacy laws from different countries?
  • RQ2How do pre-trained language models like BERT compare to traditional methods such as TF-IDF and word embeddings in legal document similarity tasks?
  • RQ3Does the performance of similarity models vary between short recitals and longer articles in legal texts?
  • RQ4To what extent can BERT-based models generalize across legal documents written in different languages, such as English and Portuguese?

Key findings

  • BERT achieved the highest accuracy at 70% on both recital and article levels, outperforming TF-IDF (60% and 50%) and word embeddings (20% and 50%) in the comparison task.
  • Siamese BERT performed poorly, likely due to its training on general text pairs, which led to overfitting on common legal terms like 'must' and 'should'.
  • TF-IDF showed moderate performance, consistent with prior literature, but was outperformed by deep learning-based models.
  • The results suggest that BERT's contextual understanding of legal language provides a significant advantage over non-contextual embeddings and frequency-based methods.
  • Performance was more stable and consistent at the article level, indicating that longer texts allow models to better capture semantic meaning.
  • The study confirms that pre-trained transformer models like BERT are well-suited for legal document similarity tasks, especially when fine-tuned on domain-specific content.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.