With more than 100 million German speakers worldwide, there are many use cases for redacting personal data from German text, including compliance with the GDPR in Germany and elsewhere. With many privacy-preserving de-identification solutions being optimized for English, you might expect that transferring the same approaches to its close linguistic relative, German, would be simple. In reality, however, redaction in German comes with its own unique set of problems, which in turn complicate compliance with the GDPR when the data concerned are in German. Read on to learn why de-identification of Personally Identifiable Information (PII) in German is more challenging than you might have guessed and how this can affect GDPR compliance.
Compounding
Perhaps one of the most salient grammatical features of German is the language’s inventory of what linguists refer to as compounds: words composed of several shorter stem morphemes, or word-parts that each have meaning on their own. Compounds exist in English, too: words like sunflower (sun + flower) or notebook (note + book). In German, compounds are even more common and can be the size of something that might correspond to a whole phrase in English – for example, Verbesserungsvorschlag, meaning ‘suggestion for improvement’:
Verbesserungs – Vorschlag
‘improvement’ ‘suggestion’
The prevalence and extent of compounding in German presents an issue for transformer-based approaches that are optimized around using whitespace to recognize the boundaries of a word. How can an AI model recognize a word that is “hidden” inside another word? Consider the following German compounds:
– gesamtschweizerischen (‘all of Switzerland’)
– englischsprachig (‘English-speaking’)
– Professorengehalt (‘income of a professor’)
Each example contains quasi-identifiable information as well as generic material. A solid PII redaction system needs to be able to distinguish which information is identifying and redact only the identifying entities, in order to comply with the GDPR and German data protection regulations, while still producing a readable and useful redacted output.
Inflection & Derivation
On top of its extensive use of complex word-formation via compounding, German has a rich and complex morphological system which has long been recognized as an obstacle for traditional Named Entity Recognition (NER) systems, tools which are essential to Germany data privacy, including GDPR compliance.
It has been noted, for instance, that one significant challenge to NER detection, and thus to German data privacy efforts, is the ubiquity of morphologically-derived words in German. Derivation is a word-formation process that changes a base word’s part of speech through the addition of affixes, or word-parts that attach to stem morphemes. An example of a German word derived in this way is lutherischen (‘Lutheran’), which is composed of the proper name [Martin] Luther with the added suffix –ischen (Klimek et al. 2017). The difficulty for entity detection becomes even more apparent in the case of so-called zero derivation, by which the same word may belong to different parts of speech and have multiple meanings with no changes in surface form. For example, the word Birnbaum may be either a common noun meaning ‘pear tree’ or an individual’s surname. When encountering a string like Birnbaum, an NER system must be able to infer from the surrounding linguistic context that only the latter is PII, or otherwise fail to comply with the GDPR in Germany. One study notes that three of four NER systems were unable to distinguish between such homonyms “with an odd-ratio of up to 13.7” (Helmers 2013).
Another challenge for PII detection in German, and hence complying with the GDPR when the data is German, is the language’s extensive morphological inflection system through which word-parts provide grammatical meaning to a word. Limiting the conversation exclusively to nouns, this system includes four cases (nominative, accusative, dative, genitive) which indicate a noun’s syntactic function in a sentence, three grammatical genders (feminine, masculine, neuter) which are distinct from what we understand as social gender, and a two-way number distinction (singular, plural). Taken together, this means that a given noun could assume several distinct forms, depending on its syntactic position in a sentence and the entity(ies) that the term is used to refer to. This diversity of forms makes a regex-based solution both impractical and inadequate, but is a challenge even for AI systems.
Whether a word has been formed via derivation, inflection, or both, it’s natural to assume that the more complex a word is, the more challenging it will be for NER detection. This assumption has found empirical support in studies such as that of Klimek et al. (2017), who found that entities missed by the NER system (false negatives) were 8x more likely to be morphologically complex than properly redacted entities (true positives).
To further complicate the landscape of German data privacy, the inflectional morphology occurring on German nouns is not restricted to nouns, but is matched on other words occurring within a noun phrase, such as adjectives and articles. In particular, the gender features expressed on these words may reveal information about an individual if they are not redacted or otherwise neutralized. As shown in the examples below, unlike in English, the German articles and adjectives vary, matching the gender of the following noun. Under certain circumstances, this information could be considered personally identifiable under the GDPR.
Der Doktor sah die junge Frau.
The doctor saw the young woman.
Der Doktor sah den jungen Mann.
The doctor saw the young man.
Orthography
Another factor that creates problems when dealing with German data protection in text form is orthography, or accepted conventions around letters and spelling.
In English, aside from at the beginning of a sentence, capitalization is mostly restricted to proper nouns (i.e., nouns that are specific instead of generic). Capitalization, therefore, is a useful clue when looking to identify named entities in English. In German, by contrast, all nouns are capitalized, whether proper or common. For example, when both die Türkei (‘Turkey’) and der Löffel (‘the spoon’) are capitalized, capitalization isn’t such a useful clue for determining which terms refers to a named entity.
Another German specialty is the usage of an extra four ‘special’ characters in addition to the 26 ‘basic’ letters of the Roman alphabet: three vowels with an accented umlaut above them (ä, ö, ü), and the ‘sharp s’ (ß). When typing with a restricted character set, there are alternate spellings for these characters (ae, oe, ue, and ss). Even with the full character set at your disposal, whether a word is spelled with ‘ß’ or ‘ss’ depends on whether the vowel that comes before the letter is long or short itself. This can also vary among different dialects and individual writers, just to add a bit of spice to the mixture.
There have also been changes to German spelling conventions over time. The governments of several German-speaking European countries agreed to a collection of spelling reforms in 1996. What followed was a decade of controversy, compromises, and even legal challenges. While things have mostly settled down on this front, this still means that, in many cases, the spelling of the same word may vary across datasets, depending on the year (or location) of writing. This orthographic variation adds a layer of complexity for an NER detection system. Differences in spelling that seem minor to a human reader may result in words being split up quite differently by an NER tokenizer. The table below shows three examples where alternate spellings result in variable tokenization of the words.
Old German spelling |
New German spelling |
Schiffahrtskapitän |
Schifffahrtskapitän |
---|---|
Ballettänzer |
Balletttänzer |
Streßtherapie |
Stresstherapie |
This is where technology can help. However, as we have explained above, the German language poses challenges even for powerful machine-learning tools. Consequently, if you consider acquiring technology to help with PII identification and redaction, you must pay attention to whether it has been optimized for the languages you will encounter in your dataset. If, on the other hand, you wish to build a solution yourself, be sure to add linguistic pitfalls to the list of difficulties you expect to face when trying to achieve high accuracy for PII identification.
Private AI has the necessary in-house expertise to train our data modules in many different languages. So far, it’s 49 and counting. To see the tech in action, try our web demo, or request an API key to try it yourself on your own data.