Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,85 +1,96 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
```
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
```bash
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: DPST Replication
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- local-differential-privacy
|
| 7 |
+
- text-rewriting
|
| 8 |
+
- nlp
|
| 9 |
+
- replication
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# DPST Replication
|
| 13 |
+
|
| 14 |
+
Replication package for the EMNLP 2025 paper:
|
| 15 |
+
|
| 16 |
+
> **Leveraging Semantic Triples for Private Document Generation with Local Differential Privacy Guarantees**
|
| 17 |
+
> Stephen Meisenbacher, Maulik Chevli, Florian Matthes
|
| 18 |
+
> [https://aclanthology.org/2025.emnlp-main.455/](https://aclanthology.org/2025.emnlp-main.455/)
|
| 19 |
+
|
| 20 |
+
All credit goes to the original authors. This repository provides a replication environment for running the method, based on the official released code: https://github.com/sjmeis/DPST.
|
| 21 |
+
|
| 22 |
+
```bibtex
|
| 23 |
+
@inproceedings{meisenbacher-etal-2025-leveraging,
|
| 24 |
+
title = "Leveraging Semantic Triples for Private Document Generation with Local Differential Privacy Guarantees",
|
| 25 |
+
author = "Meisenbacher, Stephen and Chevli, Maulik and Matthes, Florian",
|
| 26 |
+
booktitle = "Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing",
|
| 27 |
+
month = nov,
|
| 28 |
+
year = "2025",
|
| 29 |
+
address = "Suzhou, China",
|
| 30 |
+
publisher = "Association for Computational Linguistics",
|
| 31 |
+
url = "https://aclanthology.org/2025.emnlp-main.455/",
|
| 32 |
+
doi = "10.18653/v1/2025.emnlp-main.455",
|
| 33 |
+
pages = "8976--8992",
|
| 34 |
+
}
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Setup
|
| 38 |
+
|
| 39 |
+
**1. Clone this repository**
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
git clone https://huggingface.co/datasets/weijunl/dpst-replication
|
| 43 |
+
cd dpst-replication
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
**2. Download and extract the Weaviate triple database**
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
tar -xzf weaviate-data.tar.gz
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
**3. Create conda environment**
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
conda create -n dpst python=3.10
|
| 56 |
+
conda activate dpst
|
| 57 |
+
|
| 58 |
+
pip install numpy pandas tqdm torch
|
| 59 |
+
pip install transformers==4.52.4 datasets sentence-transformers==2.2.2
|
| 60 |
+
pip install nltk einops datasketch
|
| 61 |
+
pip install stanford-openie
|
| 62 |
+
# install weaviate-client AFTER stanford-openie (protobuf conflict workaround)
|
| 63 |
+
pip install weaviate-client==4.11.1
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
**4. Start Weaviate (first time only — creates the container)**
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
docker run -d --name weaviate -p 8080:8080 -p 50051:50051 \
|
| 70 |
+
-v ./weaviate-data:/var/lib/weaviate \
|
| 71 |
+
-e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
|
| 72 |
+
-e PERSISTENCE_DATA_PATH=/var/lib/weaviate \
|
| 73 |
+
-e DEFAULT_VECTORIZER_MODULE=none \
|
| 74 |
+
cr.weaviate.io/semitechnologies/weaviate:1.26.4
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
After the first time, `run_dpst.sh` will automatically start the existing container if it is not running.
|
| 78 |
+
|
| 79 |
+
## Usage
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
conda activate dpst
|
| 83 |
+
bash run_dpst.sh <mode> <epsilon> [input_file] [output_file]
|
| 84 |
+
|
| 85 |
+
mode : 50k | 100k | 200k
|
| 86 |
+
epsilon : privacy budget (e.g. 0.1, 1.0, 10.0)
|
| 87 |
+
input : path to a text file (one sentence per line); omit for demo texts
|
| 88 |
+
output : path to save privatized output; omit to print to stdout
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Example:
|
| 92 |
+
```bash
|
| 93 |
+
bash run_dpst.sh 200k 1.0 input.txt output.txt
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
A HuggingFace token is required for the generation model (Llama-3.2); `run_dpst.sh` will prompt for it at runtime.
|