charlesapochi commited on
Commit
56c1c60
·
1 Parent(s): 37ab146

initial commit

Browse files
README.md CHANGED
@@ -1,13 +1,4 @@
1
- ---
2
- title: Plagiarism Detection Llm
3
- emoji: 👁
4
- colorFrom: blue
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 4.41.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ To run demo locally on gradio: python app.py (Make aure to install all dependencies and packages)
2
+
3
+ To test app on huggiigface: https://huggingface.co/spaces/charlesapochi/plagiarism-detection-llm
 
 
 
 
 
 
 
 
4
 
 
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
app.py CHANGED
@@ -83,9 +83,11 @@ def run_gradio(args, model=None, device=None, tokenizer=None):
83
  def update_algorithm(session_state, value):
84
  if value == "advance":
85
  session_state.run_extended = True
 
86
  elif value == "basic":
87
  session_state.run_extended = False
88
- return session_state,
 
89
 
90
 
91
  algorithm.change(update_algorithm,inputs=[session_args, algorithm], outputs=[session_args])
@@ -227,7 +229,8 @@ def analyze(input_text, args, device=None, tokenizer=None):
227
  return output, args
228
 
229
  if __name__ == "__main__":
230
- args = get_default_args()
 
231
  # args = process_args(args)
232
  input_text = get_default_prompt()
233
  args.default_prompt = input_text
 
83
  def update_algorithm(session_state, value):
84
  if value == "advance":
85
  session_state.run_extended = True
86
+ # args.run_extended = True
87
  elif value == "basic":
88
  session_state.run_extended = False
89
+ # args.run_extended = False
90
+ return session_state
91
 
92
 
93
  algorithm.change(update_algorithm,inputs=[session_args, algorithm], outputs=[session_args])
 
229
  return output, args
230
 
231
  if __name__ == "__main__":
232
+ args = parse_args()
233
+ # args = get_default_args()
234
  # args = process_args(args)
235
  input_text = get_default_prompt()
236
  args.default_prompt = input_text
components/__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/components/__pycache__/utils.cpython-310.pyc and b/components/__pycache__/utils.cpython-310.pyc differ
 
components/utils.py CHANGED
@@ -187,6 +187,12 @@ def parse_args():
187
  default=False,
188
  help="Skip the model loading to debug the interface.",
189
  )
 
 
 
 
 
 
190
  parser.add_argument(
191
  "--seed_separately",
192
  type=str2bool,
@@ -199,6 +205,12 @@ def parse_args():
199
  default=False,
200
  help="Whether to run model in float16 precsion.",
201
  )
 
 
 
 
 
 
202
  args = parser.parse_args()
203
  return args
204
 
 
187
  default=False,
188
  help="Skip the model loading to debug the interface.",
189
  )
190
+ parser.add_argument(
191
+ "--ignore_repeated_ngrams",
192
+ type=str2bool,
193
+ default=False,
194
+ help="Ignore repeated ngrams.",
195
+ )
196
  parser.add_argument(
197
  "--seed_separately",
198
  type=str2bool,
 
205
  default=False,
206
  help="Whether to run model in float16 precsion.",
207
  )
208
+ parser.add_argument(
209
+ "--run_extended",
210
+ type=str2bool,
211
+ default=False,
212
+ help="Whether to run basic or advance algorithm.",
213
+ )
214
  args = parser.parse_args()
215
  return args
216
 
experiments/results/detailed_results.json ADDED
The diff for this file is too large to render. See raw diff
 
experiments/results/summary_metrics.json ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "sst2": {
3
+ "train": {
4
+ "accuracy_without_watermark": 0.49,
5
+ "accuracy_with_watermark": 0.56,
6
+ "f1_without_watermark": 0.5714285714285714,
7
+ "f1_with_watermark": 0.56
8
+ },
9
+ "validation": {
10
+ "accuracy_without_watermark": 0.44,
11
+ "accuracy_with_watermark": 0.51,
12
+ "f1_without_watermark": 0.44,
13
+ "f1_with_watermark": 0.5882352941176471
14
+ }
15
+ },
16
+ "cola": {
17
+ "train": {
18
+ "matthews_corr_without_watermark": -0.09611547479941228,
19
+ "matthews_corr_with_watermark": 0.11224602755526586
20
+ },
21
+ "validation": {
22
+ "matthews_corr_without_watermark": 0.2683870161053685,
23
+ "matthews_corr_with_watermark": 0.031219527052723135
24
+ }
25
+ },
26
+ "mrpc": {
27
+ "train": {
28
+ "accuracy_without_watermark": 0.53,
29
+ "accuracy_with_watermark": 0.44,
30
+ "f1_without_watermark": 0.6758620689655173,
31
+ "f1_with_watermark": 0.5882352941176471
32
+ },
33
+ "validation": {
34
+ "accuracy_without_watermark": 0.59,
35
+ "accuracy_with_watermark": 0.57,
36
+ "f1_without_watermark": 0.7210884353741497,
37
+ "f1_with_watermark": 0.6993006993006993
38
+ }
39
+ },
40
+ "qqp": {
41
+ "train": {
42
+ "accuracy_without_watermark": 0.53,
43
+ "accuracy_with_watermark": 0.51,
44
+ "f1_without_watermark": 0.38961038961038963,
45
+ "f1_with_watermark": 0.19672131147540983
46
+ },
47
+ "validation": {
48
+ "accuracy_without_watermark": 0.54,
49
+ "accuracy_with_watermark": 0.59,
50
+ "f1_without_watermark": 0.23333333333333334,
51
+ "f1_with_watermark": 0.22641509433962265
52
+ }
53
+ },
54
+ "stsb": {
55
+ "train": {
56
+ "pearson_corr_without_watermark": NaN,
57
+ "pearson_corr_with_watermark": -0.3385932975390179,
58
+ "spearman_corr_without_watermark": NaN,
59
+ "spearman_corr_with_watermark": -0.3389426353569145
60
+ },
61
+ "validation": {
62
+ "pearson_corr_without_watermark": 0.01675197019312319,
63
+ "pearson_corr_with_watermark": -0.0999659022196252,
64
+ "spearman_corr_without_watermark": -0.041560976173932014,
65
+ "spearman_corr_with_watermark": -0.07632988977600694
66
+ }
67
+ },
68
+ "mnli": {
69
+ "train": {
70
+ "accuracy_without_watermark": 0.47,
71
+ "accuracy_with_watermark": 0.37,
72
+ "f1_without_watermark": 0.39293604945778854,
73
+ "f1_with_watermark": 0.24262017885423737
74
+ },
75
+ "validation": {
76
+ "accuracy_without_watermark": 0.37,
77
+ "accuracy_with_watermark": 0.35,
78
+ "f1_without_watermark": 0.26940892298948566,
79
+ "f1_with_watermark": 0.25000682333033103
80
+ }
81
+ },
82
+ "qnli": {
83
+ "train": {
84
+ "accuracy_without_watermark": 0.56,
85
+ "accuracy_with_watermark": 0.54,
86
+ "f1_without_watermark": 0.5280995280995281,
87
+ "f1_with_watermark": 0.4875222816399287
88
+ },
89
+ "validation": {
90
+ "accuracy_without_watermark": 0.57,
91
+ "accuracy_with_watermark": 0.49,
92
+ "f1_without_watermark": 0.5501621508525996,
93
+ "f1_with_watermark": 0.4498975299320462
94
+ }
95
+ },
96
+ "rte": {
97
+ "train": {
98
+ "accuracy_without_watermark": 0.53,
99
+ "accuracy_with_watermark": 0.49,
100
+ "f1_without_watermark": 0.5123975516132379,
101
+ "f1_with_watermark": 0.4357782940590773
102
+ },
103
+ "validation": {
104
+ "accuracy_without_watermark": 0.53,
105
+ "accuracy_with_watermark": 0.55,
106
+ "f1_without_watermark": 0.5123975516132379,
107
+ "f1_with_watermark": 0.4950061721467849
108
+ }
109
+ },
110
+ "wnli": {
111
+ "train": {
112
+ "accuracy_without_watermark": 0.44,
113
+ "accuracy_with_watermark": 0.52,
114
+ "f1_without_watermark": 0.43977591036414565,
115
+ "f1_with_watermark": 0.5198079231692677
116
+ },
117
+ "validation": {
118
+ "accuracy_without_watermark": 0.4788732394366197,
119
+ "accuracy_with_watermark": 0.49295774647887325,
120
+ "f1_without_watermark": 0.47845940043676793,
121
+ "f1_with_watermark": 0.49043062200956933
122
+ }
123
+ }
124
+ }
experiments/watermark_experiment.ipynb ADDED
The diff for this file is too large to render. See raw diff