jithinm commited on
Commit
5807321
·
verified ·
1 Parent(s): fcffd12
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline(
5
+ "text-classification",
6
+ model="Hello-SimpleAI/chatgpt-detector-roberta-chinese"
7
+ )
8
+
9
+ def detect_ai(text):
10
+ result = classifier(text)
11
+ return result[0]
12
+
13
+ demo = gr.Interface(
14
+ fn=detect_ai,
15
+ inputs=gr.Textbox(lines=5, placeholder="Enter text here..."),
16
+ outputs="text",
17
+ title="ChatGPT Text Detector"
18
+ )
19
+
20
+ demo.launch()