weijunl commited on
Commit
913194f
·
verified ·
1 Parent(s): 0887481

Upload run_dpst.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. run_dpst.py +2 -3
run_dpst.py CHANGED
@@ -30,8 +30,7 @@ def main():
30
  texts = [line.strip() for line in f if line.strip()]
31
  else:
32
  texts = [
33
- "Perfect matched part at even better price.: The part fit my BMW perfect and the price was great. Thank you!",
34
- "Fast response, quick delivery, product as advertised! Great Seller: Fast response, quick delivery, product as advertised! Great Seller",
35
  "Enjoyed the experience!: I thoroughly enjoyed the experience of creating my own photo album and adding my own narratives. I now have 6 of the Crewe photo books and I am really proud of them. The price is competitive and delivery and quality excellent. Will definitely use again (can’t wait!) and would highly recommend the service to anyone. Well done Jessops"
36
  ]
37
  print("No input file provided. Using demo texts:")
@@ -42,7 +41,7 @@ def main():
42
  dpst_instance = DPST.DPST(mode=args.mode, hf_token=args.token, model_checkpoint=args.model)
43
 
44
  print(f"Running privatization with epsilon={args.epsilon}, DP={not args.no_dp}...")
45
- private_texts = dpst_instance.privatize(texts, epsilon=args.epsilon, DP=(not args.no_dp))
46
 
47
  print("\n" + "="*80)
48
  print("RESULTS")
 
30
  texts = [line.strip() for line in f if line.strip()]
31
  else:
32
  texts = [
33
+ "ok so in one weird moment 2 years ago i was angry, it caused an arousal, and then a weird bad thought popped into my head about harming the person making me angry. Back then i didnt have the ocd theme that causes such things, i just was like ugh no! why did i even have this thought?! and just ignored it (guess its called the ol ́good days!) i didnt get stuck in it, (...) is it like my mind throwing something random and all? or did my mind just crash because of the different kinds of feelings that were mixed together weirdly",
 
34
  "Enjoyed the experience!: I thoroughly enjoyed the experience of creating my own photo album and adding my own narratives. I now have 6 of the Crewe photo books and I am really proud of them. The price is competitive and delivery and quality excellent. Will definitely use again (can’t wait!) and would highly recommend the service to anyone. Well done Jessops"
35
  ]
36
  print("No input file provided. Using demo texts:")
 
41
  dpst_instance = DPST.DPST(mode=args.mode, hf_token=args.token, model_checkpoint=args.model)
42
 
43
  print(f"Running privatization with epsilon={args.epsilon}, DP={not args.no_dp}...")
44
+ private_texts = dpst_instance.privatize(texts, epsilon=args.epsilon, DP=(not args.no_dp), verbose=True)
45
 
46
  print("\n" + "="*80)
47
  print("RESULTS")