rusen commited on
Commit
5f2acbf
·
1 Parent(s): b36d5c8
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,7 @@ chatgpt_roberta_detector = pipeline("text-classification", model="Models/fine_tu
9
 
10
  def classify_text(text):
11
  # Get predictions from each model
12
- roberta_base_pred = roberta_base_detector(text)[0]['label']
13
  chatgpt_lli_hc3_pred = chatgpt_lli_hc3_detector(text)[0]['label']
14
  chatgpt_roberta_pred = chatgpt_roberta_detector(text)[0]['label']
15
 
@@ -23,14 +23,14 @@ def classify_text(text):
23
 
24
  # Determine final decision based on majority
25
  if votes["AI"] > votes["Human"]:
26
- return roberta_base_pred
27
  else:
28
- return roberta_base_pred
29
 
30
  # Create Gradio Interface
31
  iface = gr.Interface(
32
  fn=classify_text,
33
- inputs=gr.Textbox(lines=2, placeholder="Enter a sentence to classify..."), # Corrected this line
34
  outputs="text"
35
  )
36
 
 
9
 
10
  def classify_text(text):
11
  # Get predictions from each model
12
+ roberta_base_pred = 1 if roberta_base_detector(text)[0]['label'] == "Fake" else: 0
13
  chatgpt_lli_hc3_pred = chatgpt_lli_hc3_detector(text)[0]['label']
14
  chatgpt_roberta_pred = chatgpt_roberta_detector(text)[0]['label']
15
 
 
23
 
24
  # Determine final decision based on majority
25
  if votes["AI"] > votes["Human"]:
26
+ return chatgpt_lli_hc3_pred
27
  else:
28
+ return chatgpt_lli_hc3_pred
29
 
30
  # Create Gradio Interface
31
  iface = gr.Interface(
32
  fn=classify_text,
33
+ inputs=gr.Textbox(lines=2, placeholder="Enter a sentence to classify..."),
34
  outputs="text"
35
  )
36