rationalsolver
commited on
Commit
•
8903b7b
1
Parent(s):
137590f
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,17 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Load the model pipeline
|
2 |
+
detector = pipeline("text-classification", model="openai-community/roberta-large-openai-detector")
|
3 |
|
4 |
+
# Define a function for detection
|
5 |
+
def detect_ai_content(text):
|
6 |
+
result = detector(text)
|
7 |
+
return result
|
8 |
+
|
9 |
+
# Create a Gradio interface
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=detect_ai_content,
|
12 |
+
inputs="text",
|
13 |
+
outputs="json",
|
14 |
+
title="AI Content Detector"
|
15 |
+
)
|
16 |
+
|
17 |
+
iface.launch()
|