yasserrmd commited on
Commit
43b9fdd
·
verified ·
1 Parent(s): 5fd33a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -34,8 +34,13 @@ def check_plagiarism(text):
34
 
35
  # Use SynthID's bayesian detector to check for AI generation likelihood
36
  try:
37
- is_ai_generated = detector_bayesian.is_generated(tokens['input_ids'], logits_processor, threshold=0.5)
38
- if is_ai_generated:
 
 
 
 
 
39
  return "Flagged as AI-generated content (Academic Integrity Warning)."
40
  else:
41
  return "Content appears to be human-generated."
 
34
 
35
  # Use SynthID's bayesian detector to check for AI generation likelihood
36
  try:
37
+ # Assuming the logits processor can be used to score watermarked content
38
+ logits_scores = logits_processor(tokens['input_ids'])
39
+
40
+ # Simple threshold: assuming logits indicate watermark presence
41
+ is_watermarked = logits_scores.mean().item() > 0.5
42
+
43
+ if is_watermarked:
44
  return "Flagged as AI-generated content (Academic Integrity Warning)."
45
  else:
46
  return "Content appears to be human-generated."