jay123jay commited on
Commit
c871ed1
·
verified ·
1 Parent(s): 0878190

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -9,11 +9,12 @@ def detect_text(text):
9
  if not text.strip():
10
  return {}
11
 
12
- # Run the model on the input text
13
  results = classifier(text)
14
 
15
- # Access the first item in the nested list: results
16
- return {res['label']: res['score'] for res in results}
 
 
17
 
18
  class_intro_html = "<center><h2>Text Origin & LLM Attribution Detector</h2></center>"
19
 
 
9
  if not text.strip():
10
  return {}
11
 
 
12
  results = classifier(text)
13
 
14
+ # Use [ 0 ] to extract the dictionary from the nested list
15
+ inner_results = results[ 0 ]
16
+
17
+ return {res['label']: res['score'] for res in inner_results}
18
 
19
  class_intro_html = "<center><h2>Text Origin & LLM Attribution Detector</h2></center>"
20