sashtech commited on
Commit
2389531
·
verified ·
1 Parent(s): 73bd89d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -9,6 +9,11 @@ from nltk.corpus import wordnet
9
  # Initialize the English text classification pipeline for AI detection
10
  pipeline_en = pipeline(task="text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta")
11
 
 
 
 
 
 
12
  # Ensure necessary NLTK data is downloaded for Humanifier
13
  nltk.download('wordnet')
14
  nltk.download('omw-1.4')
 
9
  # Initialize the English text classification pipeline for AI detection
10
  pipeline_en = pipeline(task="text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta")
11
 
12
+ # Function to predict the label and score for English text (AI Detection)
13
+ def predict_en(text):
14
+ res = pipeline_en(text)[0]
15
+ return res['label'], res['score']
16
+
17
  # Ensure necessary NLTK data is downloaded for Humanifier
18
  nltk.download('wordnet')
19
  nltk.download('omw-1.4')