File size: 416 Bytes
5807321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d4af55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="Hello-SimpleAI/chatgpt-detector-roberta-chinese"
)

def detect_ai(text):
    result = classifier(text)
    return result[0]

demo = gr.Interface(
    fn=detect_ai,
    inputs=gr.Textbox(lines=5, placeholder="Enter text here..."),
    outputs="text",
    title="ChatGPT Text Detector"
)

demo.launch()