ombhojane commited on
Commit
b3a3de6
·
1 Parent(s): 9a91da8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -41
app.py CHANGED
@@ -20,23 +20,7 @@ headers = {
20
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
21
  }
22
 
23
- #################### Load the banner image ##########
24
- # Fetch the image from the URL
25
- banner_image_request = requests.get("https://jaifar.net/ADS/banner.jpg", headers=headers)
26
 
27
- # Save the downloaded content
28
- banner_image_path = "banner.jpg"
29
- with open(banner_image_path, "wb") as f:
30
- f.write(banner_image_request.content)
31
-
32
-
33
- # Open the image
34
- banner_image = Image.open(banner_image_path)
35
-
36
- # Display the image using streamlit
37
- st.image(banner_image, caption='', use_column_width=True)
38
-
39
- ################ end loading banner image ##################
40
 
41
  def get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction):
42
  author_map = {
@@ -94,7 +78,7 @@ if not os.path.exists('my_authorship_model'):
94
  st.write(f"Failed to download or extract the model: {e}")
95
  exit(1)
96
  else:
97
- st.write("Version: 1.0")
98
 
99
 
100
  # Download the required files
@@ -380,28 +364,19 @@ if press_me_button:
380
 
381
 
382
  # Using expander to make FAQ sections
383
- st.subheader("Frequently Asked Questions (FAQ)")
384
 
385
  # Small Description
386
  with st.expander("What is this project about?"):
387
  st.write("""
388
- This project is part of an MSc in Data Analytics at the University of Portsmouth.
389
- Developed by Jaifar Al Shizawi, it aims to identify whether a text is written by
390
- a human or a specific Large Language Model (LLM) like ChatGPT-3, ChatGPT-4, Google Bard, or HuggingChat.
391
- For inquiries, contact [[email protected]](mailto:[email protected]).
392
- Supervised by Dr. Mohamed Bader.
393
- """)
394
 
395
- # Aim and Objectives
396
- with st.expander("Aim and Objectives"):
397
- st.write("""
398
- The project aims to help staff at the University of Portsmouth distinguish between
399
- student-written artifacts and those generated by LLMs. It focuses on text feature extraction, model testing,
400
- and implementing a user-friendly dashboard among other objectives.
401
  """)
 
402
 
403
  # System Details
404
- with st.expander("How does the system work?"):
405
  st.write("""
406
  The system is trained using deep learning model on a dataset of 140,546 paragraphs, varying in length from 10 to 1090 words.
407
  It achieves an accuracy of 0.9964 with a validation loss of 0.094.
@@ -422,15 +397,5 @@ with st.expander("How does the system work?"):
422
  # Display the image using streamlit
423
  st.image(accuracy_image, caption='Best Accuracy', use_column_width=True)
424
 
425
- # Data Storage Information
426
- with st.expander("Does the system store my data?"):
427
- st.write("No, the system does not collect or store any user input data.")
428
-
429
- # Use-case Limitation
430
- with st.expander("Can I use this as evidence?"):
431
- st.write("""
432
- No, this system is a Proof of Concept (POC) and should not be used as evidence against students or similar entities.
433
- """)
434
-
435
 
436
 
 
20
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
21
  }
22
 
 
 
 
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  def get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction):
26
  author_map = {
 
78
  st.write(f"Failed to download or extract the model: {e}")
79
  exit(1)
80
  else:
81
+ st.write("AI Text Detection")
82
 
83
 
84
  # Download the required files
 
364
 
365
 
366
  # Using expander to make FAQ sections
367
+ st.subheader("More about AI Text Detector Project :")
368
 
369
  # Small Description
370
  with st.expander("What is this project about?"):
371
  st.write("""
372
+ This AI Text Detector tells whether a text is written by a Human or a specific Large Language Model (LLM) like ChatGPT-3, ChatGPT-4, Google Bard, or HuggingChat.
373
+ Ridge, Extra trees and CNN are the machine learning algorithms have been used to create this AI Text Detector.
 
 
 
 
374
 
 
 
 
 
 
 
375
  """)
376
+
377
 
378
  # System Details
379
+ with st.expander("How does the AI Text Detector work?"):
380
  st.write("""
381
  The system is trained using deep learning model on a dataset of 140,546 paragraphs, varying in length from 10 to 1090 words.
382
  It achieves an accuracy of 0.9964 with a validation loss of 0.094.
 
397
  # Display the image using streamlit
398
  st.image(accuracy_image, caption='Best Accuracy', use_column_width=True)
399
 
 
 
 
 
 
 
 
 
 
 
400
 
401