Simple and fast corpus obfuscation based on character permutation (not sufficient for adversarial servers, but just enough for our purpose and faster than Homomorphic Encryption/ML)
Project description
corpustools and corpfuscator
This approach allows to train character level embeddings on an obfuscated corpus, ie. corpus where the character substitutions are "secret". This may not be robust on an adversarial server, but helps keep training data reasonably private. Also, it makes reverse engineering of the trained embedding model slightly more complex. The overhead to obfuscate input data for the embedding model is minimal.
install
pip install git+https://github.com/namsor/corpfuscator
corpustools usage
corpustools 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf.txt' --gen_key --max_lines 10000000 --key_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_key.json' --key_name namsorv3_proto0 --flair_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_key_flair'
corpustools 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf.txt' --obfuscate --key_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_key.json' --output_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_obf.txt'
corpustools 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_obf.txt' --deobfuscate --key_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_key.json' --output_file 'C:/Sync/namsor Dropbox/NamSorV3/2_Prototyping/CAIRNN_Flair/full_corpus/corpus_full_untagged_shuf_deobf.txt'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file corpfuscator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: corpfuscator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16823e0068c8a37629d795ced8acb88538a0a3e3a05e86eaea2e671bb7b3e532
|
|
| MD5 |
b03dd42bbd2790677c89fcbdec21dd38
|
|
| BLAKE2b-256 |
129e006f26eed910beaf0a09fbbdf5def2b7ed6bbe467dd7488020b2c4fa98ef
|