Abstract
Social media platforms generate vast amounts of unstructured textual data that are valuable for research but pose significant privacy risks. Traditional anonymization techniques like k-anonymity are designed for structured databases and cannot be directly applied to raw text. This paper introduces a privacy-preserving middleware that bridges this gap. By utilizing a custom Natural Language Processing (NLP) pipeline to extract quasi-identifiers from tweets, the proposed system enables the application of formal anonymization models to unstructured data, ensuring user privacy without compromising analytical utility.
Introduction
Data privacy in structured environments, such as medical records, is well-supported by established models like k-anonymity and l-diversity. However, social media data is predominantly unstructured. A single tweet—for example, "My teacher who lived in Corktown died of cancer yesterday at age 65"—contains multiple "Quasi-Identifiers" (QIs) such as location, occupation, and age. When combined with external datasets, these snippets can lead to re-identification.
Existing privacy methods often rely on simple redaction, which can strip away critical context, or binary classification, which lacks the granularity needed for nuanced data analysis. There is a clear need for a system that can handle the complexities of natural language while providing robust privacy guarantees.
System Architecture
The authors propose a four-stage middleware architecture designed to transform raw social media feeds into privacy-protected datasets.
- Twitter Data Publisher: This component serves as the entry point, fetching raw tweets via the Twitter API.
- Privacy Attribute Extractor: At the heart of the system is an NLP component that identifies specific privacy attributes. The authors implemented a Decision Tree-based tagger that utilizes orthographic features (capitalization, numeric checks), syntactic features (Part-of-Speech tags), gazetteers (Named Entity Recognition via spaCy), and affix features.
- Privacy Attribute Sanitizer: Once attributes are tagged (e.g., identifying "65" as an age QI), the system applies structured sanitization techniques such as generalization (converting "65" to "60-70"), union (expanding locations to broader regions), swapping, and suppression.
- Utility Evaluator: To balance privacy and data usefulness, the system calculates the Discernibility Metric (DM) and Loss Metric (LM).
Data and Methodology
A key contribution of this work is the creation of a new corpus consisting of 3,000 tweets, manually annotated by experts for privacy attributes. This dataset includes tags for Direct Identifiers (DI), Quasi-Identifiers (QI) like age and region, and Sensitive Attributes (SA) such as health conditions.
The workflow follows a "Text-to-Structured-to-Text" approach. By extracting QIs into a temporary structured format, the system can apply formal k-anonymity algorithms before rebuilding the sanitized sentence. This preserves the grammatical context while masking the specific identity of the user.
Results and Discussion
The Privacy Attribute Extractor achieved an overall accuracy of 0.92 and a macro-average F1 score of 0.74, demonstrating its effectiveness in identifying sensitive terms within noisy social media text.
The experimental results showed that the middleware could successfully produce a "4-anonymized" dataset, where every record is indistinguishable from at least three others based on its quasi-identifiers. In a test run of 1,000 tweets, only 7.1% to 7.7% of terms required sanitization, leaving over 92% of the original text intact for research purposes. This granular control allows for much higher data utility compared to traditional "scrubbing" methods.
Conclusion and Future Work
This research demonstrates a viable path for applying formal privacy models to unstructured social media data. While the current system uses a Decision Tree classifier, future iterations could benefit from more advanced sequence tagging models like Transformers or LSTMs. Additionally, expanding the scope of identifiable attributes and improving the naturalness of the reconstructed text remain key areas for future development.
Summary updated