mihalykiss commited on
Commit
470f102
Β·
1 Parent(s): a1caa8f
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -67,11 +67,11 @@ def classify_text(text):
67
 
68
  if human_prob > ai_total_prob:
69
  result_message = (
70
- f"βœ… - The text is <span class='highlight-human'>**{human_prob:.2f}%** likely <b>Human written</b>.</span>"
71
  )
72
  else:
73
  result_message = (
74
- f"πŸ€– - The text is <span class='highlight-ai'>**{ai_total_prob:.2f}%** likely <b>AI generated</b>.</span>\n\n"
75
  f"**Identified AI Model:** {ai_argmax_model}"
76
  )
77
 
@@ -92,13 +92,10 @@ This tool uses the <b>ModernBERT</b> model to identify whether a given text was
92
  <div style="line-height: 1.8;">
93
  βœ… <b>Human Verification:</b> Human-written content is clearly marked.<br>
94
  πŸ” <b>Model Detection:</b> Can identify content from over 40 AI models.<br>
95
- πŸ“ˆ <b>Accuracy:</b> Works best with longer texts for improved precision.
96
- </div>
97
-
98
- <br>
99
  πŸ“„ <b>Read more:</b> Our method is detailed in our paper:
100
  <a href="https://aclanthology.org/2025.genaidetect-1.15/" target="_blank" style="color: #007bff; text-decoration: none;"><b>LINK</b></a>.
101
-
102
  <br>
103
 
104
  Paste your text below to analyze its origin.
@@ -115,7 +112,7 @@ AI_texts = [
115
  Human_texts = [
116
  "The present book is intended as a text in basic mathematics. As such, it can have multiple use: for a one-year course in the high schools during the third or fourth year (if possible the third, so that calculus can be taken during the fourth year); for a complementary reference in earlier high school grades (elementary algebra and geometry are covered); for a one-semester course at the college level, to review or to get a firm foundation in the basic mathematics necessary to go ahead in calculus, linear algebra, or other topics. Years ago, the colleges used to give courses in β€œ college algebra” and other subjects which should have been covered in high school. More recently, such courses have been thought unnecessary, but some experiences I have had show that they are just as necessary as ever. What is happening is that thecolleges are getting a wide variety of students from high schools, ranging from exceedingly well-prepared ones who have had a good first course in calculus, down to very poorly prepared ones. T",
117
  "Fats are rich in energy, build body cells, support brain development of infants, help body processes, and facilitate the absorption and use of fat-soluble vitamins A, D, E, and K. The major component of lipids is glycerol and fatty acids. According to chemical properties, fatty acids can be divided into saturated and unsaturated fatty acids. Generally lipids containing saturated fatty acids are solid at room temperature and include animal fats (butter, lard, tallow, ghee) and tropical oils (palm,coconut, palm kernel). Saturated fats increase the risk of heart disease."
118
- ]
119
 
120
  iface = gr.Blocks(css="""
121
  @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
 
67
 
68
  if human_prob > ai_total_prob:
69
  result_message = (
70
+ f"**The text is** <span class='highlight-human'>**{human_prob:.2f}%** likely <b>Human written</b>.</span>"
71
  )
72
  else:
73
  result_message = (
74
+ f"**The text is** <span class='highlight-ai'>**{ai_total_prob:.2f}%** likely <b>AI generated</b>.</span>\n\n"
75
  f"**Identified AI Model:** {ai_argmax_model}"
76
  )
77
 
 
92
  <div style="line-height: 1.8;">
93
  βœ… <b>Human Verification:</b> Human-written content is clearly marked.<br>
94
  πŸ” <b>Model Detection:</b> Can identify content from over 40 AI models.<br>
95
+ πŸ“ˆ <b>Accuracy:</b> Works best with longer texts.
 
 
 
96
  πŸ“„ <b>Read more:</b> Our method is detailed in our paper:
97
  <a href="https://aclanthology.org/2025.genaidetect-1.15/" target="_blank" style="color: #007bff; text-decoration: none;"><b>LINK</b></a>.
98
+ </div>
99
  <br>
100
 
101
  Paste your text below to analyze its origin.
 
112
  Human_texts = [
113
  "The present book is intended as a text in basic mathematics. As such, it can have multiple use: for a one-year course in the high schools during the third or fourth year (if possible the third, so that calculus can be taken during the fourth year); for a complementary reference in earlier high school grades (elementary algebra and geometry are covered); for a one-semester course at the college level, to review or to get a firm foundation in the basic mathematics necessary to go ahead in calculus, linear algebra, or other topics. Years ago, the colleges used to give courses in β€œ college algebra” and other subjects which should have been covered in high school. More recently, such courses have been thought unnecessary, but some experiences I have had show that they are just as necessary as ever. What is happening is that thecolleges are getting a wide variety of students from high schools, ranging from exceedingly well-prepared ones who have had a good first course in calculus, down to very poorly prepared ones. T",
114
  "Fats are rich in energy, build body cells, support brain development of infants, help body processes, and facilitate the absorption and use of fat-soluble vitamins A, D, E, and K. The major component of lipids is glycerol and fatty acids. According to chemical properties, fatty acids can be divided into saturated and unsaturated fatty acids. Generally lipids containing saturated fatty acids are solid at room temperature and include animal fats (butter, lard, tallow, ghee) and tropical oils (palm,coconut, palm kernel). Saturated fats increase the risk of heart disease."
115
+ "BERT, which stands for Bidirectional Encoder Representations from Transformers, is a deep learning model introduced by Google in 2018 to help machines understand the complex nuances of human language. Thanks to its Transformer-based architecture, it can grasp the deeper meaning and context of words in the text. This makes BERT especially effective at tasks like text classification, translation, question answering, and language inference."]
116
 
117
  iface = gr.Blocks(css="""
118
  @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');