Giter Club home page Giter Club logo

authorship-anonymization's Introduction

Authorship Anonymization through Differetial Privacy

This is the source code of our paper:

H. Bo, S. H. H. Ding, B. C. M. Fung, and F. Iqbal. ER-AE: Differentially private text generation for authorship anonymization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 3997-4007, online, June 2021. Association for Computational Linguistics.

Requirements:

# Python 3.6
# Tensorflow 1.9.0 resource: https://pypi.tuna.tsinghua.edu.cn/simple/tensorflow/
$ pip3 install <path>\tensorflow-1.9.0-cp36-cp36-win_amd64.whl
$ pip3 install sklearn scipy nltk

In model.py, get_ramdom_k_embed function is to generate random k tokens for loss calculation, embed_loss_fn is to calculate embedding loss value, predict_dp_two_sets is to generate differentially private text through two-set exponential mechanism.

Sample traing data:

my_dict.json

{
    "i": 0,
    "you": 1
}

id2w.txt

i
you

yelp.txt

1 sample training sentence

Disclaimer: Part of the tensorflow autoencoder code refers to the repo: https://github.com/bohaohan/finch. It's originally folked from zhedongzheng/tensorflow-nlp but that part of the code has been deleted in the original repository.

authorship-anonymization's People

Contributors

bcmfung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.