Privacy at Scale: Introducing the P riva S eer Corpus of Web Privacy Policies (2021)

Abstract: Organisations disclose their privacy practices by posting privacy policies on their websites. Even though internet users often care about their digital privacy, they usually do not read privacy policies, since understanding them requires a significant investment of time and effort. Natural language processing has been used to create experimental tools to interpret privacy policies, but there has been a lack of large privacy policy corpora to facilitate the creation of large-scale semi-supervised and unsupervised models to interpret and simplify privacy policies. Thus, we present the PrivaSeer Corpus of 1,005,380 English language website privacy policies collected from the web. The number of unique websites represented in PrivaSeer is about ten times larger than the next largest public collection of web privacy policies, and it surpasses the aggregate of unique websites represented in all other publicly available privacy policy corpora combined. We describe a corpus creation pipeline with stages that include a web crawler, language detection, document classification, duplicate and near-duplicate removal, and content extraction. We employ an unsupervised topic modelling approach to investigate the contents of policy documents in the corpus and discuss the distribution of topics in privacy policies at web scale. We further investigate the relationship between privacy policy domain PageRanks and text features of the privacy policies. Finally, we use the corpus to pretrain PrivBERT, a transformer-based privacy policy language model, and obtain state of the art results on the data practice classification and question answering tasks.

## introduction a privacy policy is a legal document that an organisation uses to disclose how they collect, analyze, share, and protect users' personal information. legal jurisdictions around the world require organisations to make their privacy policies readily available to their users, and laws such as general data protection regulation (gdpr) and california consumer privacy act (ccpa) place specific expectations upon privacy policies. however, although many internet users have concerns about their privacy @xcite , most fail to understand privacy policies @xcite . studies show that privacy policies require a considerable investment in time to read @xcite and estimate that it would require approximately 200 hours to read all the privacy policies that an average person would come across every year @xcite . natural language processing (nlp) provides an opportunity to automate the extraction of salient details from privacy policies, thereby reducing human effort and enabling the creation of tools for internet users to understand and control their online privacy. existing research has achieved some success using expert annotated corpora of a few hundred or a few thousand privacy policies @xcite @xcite , but issues of accuracy, scalability and generalization remain. more importantly, annotations in the privacy policy domain are expensive. privacy policies are difficult to understand and many tasks such as privacy practice classification @xcite , privacy question answering @xcite , vague sentence detection @xcite , and detection of compliance issues @xcite require skilled legal experts to annotate the dataset. in contrast, approaches involving large amounts of unlabeled privacy policies remain relatively unexplored. modern robust language models, such as transformer-based architectures, benefit from increasingly large training sets. these models can be used on downstream tasks @xcite to improve performance. results have shown that in-domain fine tuning of such pre-trained language models have produced a significant boost in performance on many tasks @xcite in a variety of domains, suggesting a need for a larger collection of privacy policies to enable similar results in the privacy domain. to satisfy the need for a much larger corpus of privacy policies, we introduce the privaseer corpus of 1,005,380 english language website privacy policies. the number of unique websites represented in privaseer is about ten times larger than the next largest public collection of web privacy policies @xcite , and it surpasses the aggregate of unique websites represented in all other publicly available web privacy policy corpora combined. we describe the corpus creation pipeline, with stages including a web crawler, language detection, document classification, duplicate and nearduplication removal, and content extraction. we then analyse the lengths and top level distribution of the privacy policies in the corpus and use topic modelling to explore the component topics. subsequently, we pretrain privbert, a transformerbased language model, using the corpus and evaluate it on data practice classification and question answering tasks. we release the corpus, a search engine for the corpus @xcite , the document collection pipeline, and a language model to support further research in the privacy domain. foot_0 ## related work prior collections of privacy policy corpora have led to progress in privacy research. @xcite released the opp-115 corpus, a dataset of 115 privacy policies with manual annotations of 23k fine-grained data practices, and they created a baseline for classifying privacy policy text into one of ten categories. the corpus was used to train models to extract opt-out choices from privacy policies @xcite , to automatically identify policies on websites and find compliance issues @xcite , and to classify privacy practices and answer privacy related non-factoid questions @xcite . other corpora similar to opp-115 corpus have enabled research on privacy practices. the priva-cyqa corpus contains 1,750 questions and expertannotated answers for the privacy question answering task @xcite . similarly, @xcite constructed the first corpus of human-annotated vague words and sentences in privacy policies and studied automatic vagueness detection. @xcite presented a dataset and developed a model to automatically identify and label opt-out choices offered in privacy policies. similarly, @xcite released a set of over 400k urls to android app privacy policy pages collected by crawling the google play store. @xcite collected privacy policies from around 130,000 websites from over two decades and analysed the evolution of the online privacy landscape. finally, nokhbeh zaeem and barber (2021) collected a corpus of around 100k privacy policies using the domains from dmoz, a website which maintained categories of websites on the internet. prior work in privacy and human-computer interaction establishes the motivation for studying these documents. although most internet users are concerned about privacy @xcite , @xcite reports that a significant number do not make the effort to read privacy notices because they perceive them to be too time-consuming or too complicated @xcite . responding to the opaqueness of these document, @xcite introduced methods to ease the design of privacy notices and their integration, and @xcite designed and tested a "privacy nutrition label" approach to present privacy information visually. suggestions to improve the presentation of privacy information, have not been adopted by many organisations. apple has begun displaying privacy labels in its app stores having collected the information from app developers; however, concise privacy information for websites remains an open problem. ## document collection to build the privaseer corpus, we create a pipeline concentrating on focused crawling @xcite ; @xcite of privacy policy documents. we used common crawl, foot_1 described below, to gather seed urls to privacy policies on the web. we filtered the common crawl urls to gather a set of possible links to web site privacy policies. we then crawled the filtered set to obtain candidate privacy policy documents. the complete pipeline from the common crawl url dump to the gold standard privacy policy corpus is in figure 1 . the common crawl foundation has been releasing large monthly internet web crawls along with their web graphs since 2008. monthly crawl archives provide a "snapshot of the web" by including re-crawls of popular domains and crawls of new domains. we downloaded the url dump of the may 2019 archive. 3 common crawl reports that the archive contains 2.65 billion web pages or 220 tb of uncompressed content which were crawled between 19th and 27th of may, 2019. we applied a selection criteria on the downloaded url dump to filter the urls of likely privacy policy pages. due to legal requirements, organizations typically include a link to their privacy policy in the footer of the website landing page commonly with the names privacy policy, privacy notice, and data protection. we selected those urls which had the word "privacy" or the words "data" and "protection" from the common crawl url archive. we were able to extract 3.9 million urls that fit this selection criterion. informal experiments suggested that this selection of keywords was optimal for retrieving the most privacy policies with as few false positives as possible. to find the accuracy of this technique, we manually examined 115 english language website landing pages and their privacy policy urls from the opp-115 corpus @xcite since it was built to cover the diverse distribution of privacy policies on the web, in terms of website popularity and sector of commerce. we found that out of 115 websites, 4 websites did not have their privacy policy links either on the landing page or one hop from the landing page and 5 other websites did not satisfy our url selection criteria. thus, our crawling technique would cover about 92.17% ± 6.51% of english privacy policies on the web with a 95% confidence interval. we crawled the 3.9 million selected urls using scrapy foot_3 for about 48 hours between the 4th and 10th of august 2019, for a few hours each day. 3.2 million urls were successfully crawled, henceforth referred to as candidate privacy policies, while 0.4 million led to error pages and 0.3 million urls were discarded as duplicates. ## corpus analysis the privaseer corpus consists of 1,005,380 privacy policies from 995,475 different web domains. privacy policies in this corpus have a mean word length of about 1,871 words and range between a minimum of 143 words and a maximum of 16,980 words. the corpus contains policies from over 800 different top level domains (tlds). .com, .org, and .net make up a major share of the corpus covering 63%, 5% and 3% respectively. country-level domains like .uk, .au, .ca and .du show the geographic variety of the sources of the corpus covering 12%, 4%, and 2% respectively. the distribution of popular tlds (.com, .org, .net) roughly matches internet tld trends suggesting that the corpus contains a random sample of internet web domains. moreover, commoncrawl release statistics estimating the representativeness of monthly crawls which support the claim that monthly crawl archives and in turn the privaseer corpus are a representative sample of the web. in addition to monthly crawl dumps, common crawl releases web graphs with pageranks of the domains in a crawl. the pagerank values were calculated from the web graph using the gauss-seidel algorithm @xcite . pagerank values can be used as a substitute for popularity where higher values suggest more popular domains. readability. readability of a text can be defined as the ease of understanding or comprehension due to the style of writing @xcite . along with length, readability plays a role in internet users' decisions to either read or ignore a privacy policy @xcite . while prior studies on readability have shown that privacy policies are difficult to understand for the average internet user, they were conducted using small samples of policies and therefore may not be representative of the larger internet @xcite . while there are a variety of readability metrics, we calculated the readability of the policies in the corpus using the flesh-kincaid grade level (fkg) metric for comparison with prior literature and since it is the the most widely used metric. the fkg metric presents the readability score as a u.s. grade level. we obtained a mean fkg score of 14.87 and a standard deviation of 4.8. this score can be interpreted as an average of 14.87 years of education in the u.s. (roughly two years of college education) is required to understand a privacy policy. in contrast, @xcite found that the mean fkg score is 13.6 when they conducted an analysis of readability of privacy policies using 50k documents. topic modelling. topic modelling is an unsupervised machine learning method that extracts the most probable distribution of words into topics through an iterative process @xcite . we used topic modelling to explore the distribution of themes of text in our corpus. topic modelling using a large corpus such as privaseer helps investigate the themes present in privacy policies at web scale and also enables the comparison of themes that occur in the rapidly evolving online privacy landscape. we used latent dirichlet allocation (lda), as our approach to topic modelling @xcite . since lda works well when each in-put document deals with a single topic, we divided each privacy policy into its constituent paragraphs @xcite , tokenized the paragraphs using a regex character matching tokenizer and lemmatized the individual words using nltk's wordnet lemmatizer. we experimented with topics sizes of 7, 8, 9, 10, 11, 13 and 15. we manually evaluated the topic clusters by inspecting the words that most represented the topics. we noted that the cohesiveness of the topics decreased as the number of topics increased. we chose a topic size of 9, since larger topic sizes produced markedly less coherent topics. for each topic, we identified a corresponding entry from the opp-115 annotation scheme @xcite , which was created by legal experts to label the contents of privacy policies. while wilson et al. ( 2016 ) followed a bottom-up approach and identified different categories from analysis of data practices in privacy policies, we followed a top-down approach and applied topic modelling to the corpus in order to extract common themes for paragraphs. the categories identified in the opp-115 corpus can be found in we found that two lda topics contained vocabulary corresponding with the opp-115 category first party collection/use, one dealing with purpose and information type collected and the other dealing with collection method. two lda topics corresponded with the opp-115 category third party sharing and collection, one detailing the action of collection, and one explaining its purpose and effects(advertising and analytics). one of the lda topics exclusively comprised of vocabulary related to cookies which could be related to both first party or third party data collection techniques. the opp-115 categories privacy contact information, data security and policy change appeared as separate topics while a topic corresponding to the opp-115 category international and specific audiences appeared to be primarily related to european audiences and gdpr. it is likely that the divergence between opp-115 categories and lda topics comes from a difference in approaches: the opp-115 categories represent themes that privacy experts expected to find in privacy policies, which diverge from the actual distribution of themes in this text genre. figure 2 shows the percentage of privacy policies in the corpus that contain each topic. from the figure we see that information regarding the type and purpose of data collected by first and third party sources are the most common topics. about 77% of policies contain language regarding third parties. this is consistent with prior research on third party data collection @xcite . in contrast, language regarding advertising and analytics appears in only 38% of policies in the corpus. topics corresponding to data security, policy change and contact information also occur in a majority of privacy policies. language corresponding to the gdpr and european audiences appears in 55% of policies. a study of the distribution of privacy policy topics on the web is important since they inform us about realworld trends and the need for resource allocation to enforce of privacy regulations. figure 3 shows how the number of topics in privacy policies vary with respect to the pagerank value. the whiskers in the plot represent the 95% confidence interval of the means of the number of topics in the privacy policies in each pagerank value bin. the pagerank values were binned with a constant value of 0.25 such that each bin had at least 1k privacy policies. the plot suggests that more popular domains (as given by pagerank value) tend to address a greater number of topics in their privacy policies. this behaviour is consistent with manual inspection and is likely due to a larger and more diverse user base as well as the greater levels of regulatory scrutiny that accompany it in the case of more popular domains. for example, popular organisations tend to be multinational thereby requiring to address privacy laws from multiple jurisdictions such as gdpr from the european union and ccpa from the united states. we found a similar pattern between privacy policy length and pagerank value thereby further supporting our claim that the more popular domain privacy policies tend to address a greater number of topics. in addition we found that readability and pager-ank follow a similar pattern where privacy policies of more popular domains (as given by pagerank values) tend to be slightly more difficult to read. ## privbert in order to address the requirement of a language model for the privacy domain, we created privbert. bert is a contextualized word representation model that is pretrained using bidirectional transformers @xcite . it was pretrained on the masked language modelling and the next sentence prediction tasks and has been shown to achieve state of the art results in many nlp tasks. roberta improved upon the results achieved by bert by making improvements to the training technique @xcite . we pretrain privbert starting with the pretrained roberta base model (12 layers, 768 hidden size, 12 attention heads, 110m parameters). roberta was trained on corpora of books, news articles, wikipedia and social media comments and works well as a general purpose language model. privacy policies written in legalese differ significantly in language when compared to the corpora used to train bert and its variants, thereby prompting the need for a separate pretrained language model. prior literature has shown that in-domain language models such as scibert @xcite and biobert @xcite perform significantly better on tasks in their respective domains. we use the byte pair encoding tokenization technique utilized in roberta and retain its cased vocabulary. we did not create a new vocabulary since the two vocabularies are not significantly different and any out-of-vocabulary words can be represented and tuned for the privacy domain using the byte pair encoding vocabulary of roberta. we preprocessed the privacy policy documents to create sequences of a maximum length of 512 tokens. inputs significantly shorter than the maximum length occasionally occurred since we did not create sequences that crossed document boundaries. we trained privbert using dynamic masked language modelling @xcite for 50k steps with a batch size of 512 using the gradient accumulation technique on two nvidia titan rtx for 8 days with a peak learning rate of 8e-5. other hyperparameters were set similar to roberta. finetuning privbert. we evaluated the performance of privbert on two tasks: (i) data practice classification (ii) answer sentences selection. for the data practice classification task, we leveraged the opp-115 corpus introduced by @xcite . the opp-115 corpus contains manual annotations of 23k fine-grained data practices on 115 privacy policies annotated by legal experts. to the best of our knowledge, this is the most detailed and widely used dataset of annotated privacy policies in the research community. the opp-115 corpus contains paragraph-sized segments annotated according to one or more of the twelve coarsegrained categories of data practices. we fine-tuned privbert on the opp-115 corpus to predict the coarse-grained categories of data practices. we divided the corpus in the ratio 3:1:1 for training, validation and testing respectively. since each segment in the corpus could belong to more than one category and there are twelve categories in total, we treated the problem as a multi-class, multi-label classification problem. after manually tuning hyperparameters, we trained the model with a dropout of 0.15 and a learning rate of 2.5e-5. for the question answering task, we leveraged the privacyqa corpus @xcite . privacyqa consists of 1,750 questions about the contents of privacy policies from 35 privacy documents. while crowdworkers were asked to come up with privacy related questions based on public information about an application from the google play store, legal experts were recruited to identify relevant evidence within respective privacy policies that answered the question asked by the crowdworkers. the goal of the question answering task is to identify a set sentences in the privacy policy that has information relevant to the question. @xcite divided the corpus into 1,350 questions for training and validation and 400 questions for testing where each question in the test set is annotated by at least three experts. we fine-tuned privbert on the training set as a binary classification task on each question-answer sentence pair to identify if the sentence is evidence for the question or not. we trained the model with a dropout of 0.2 and a learning rate of 3e-6 with the positive and negative classes weighted in the ratio 8:1 during training. we used sentence level f1 as the evaluation metric as described by @xcite , where precision and recall are calculated by measuring the overlap between the predicted sentences and gold standard sentences. ## conclusion we created the privaseer corpus which is the first large scale corpus of contemporary website privacy policies and consists of just over 1 million documents. we designed a novel pipeline to build the corpus, which included web crawling, language detection, document classification, duplicate removal, document cross verification, content extraction, and near duplicate removal. topic modelling showed the distribution of themes of privacy practices in policies, corresponding to the expectations of legal experts in some ways, but differing in others. the positive relationship between pagerank of a domain and the number of topics covered in its policy indicates that more popular domains have a slightly greater coverage of these topics. we hypothesize that this is because more popular domains tend to have a larger and more diverse user base prompting the privacy policies to address laws from various jurisdictions. prior research on the readability based on small corpora of privacy policies had found that they were generally hard to understand for the average internet user. our large scale analysis using the flesch-kincaid readability metric was consistent with prior findings. we found that on average about 14.87 years or roughly about two years of u.s. college education was required to understand a privacy policy. we pretrained privbert a language model for the privacy domain based on roberta. we evaluated privbert on the data practice classification and the question answering tasks and achieved state of the art results. we believe that the privaseer corpus will help advance research techniques to automate the extraction of salient details from privacy policies. privbert will help improve results on various tasks in the privacy domain and help build stable and reliable privacy preserving technology. this should benefit internet users, regulators, and researchers in many ways.