From 91e5d7af7b10d88249e5e190d74fc21edc251f9d Mon Sep 17 00:00:00 2001 From: Cornelius Paardekooper <67299665+Cornelius2121@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:36:29 +1100 Subject: [PATCH 1/3] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bda9c5..ae041f4 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,7 @@ print(response) ### Output -{"output" : "The classifier considers the text to be very unlikely AI-generated.", -"Confidence score" : 96.15870427207666} +{'Class': 'very unlikely', 'AI-Generated Probability': 3.4583769381404563} ``` From 05d10dd30ce207e4d328bb2611287d8d6569c364 Mon Sep 17 00:00:00 2001 From: Cornelius Paardekooper <67299665+Cornelius2121@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:43:10 +1100 Subject: [PATCH 2/3] Checks Text Length Adds check for text length to ensure that the length is over 1000 characters. Adds check for a failed web request and prompts for checked bearer token. --- detector/detector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/detector/detector.py b/detector/detector.py index 0c6b2ed..ab1b697 100644 --- a/detector/detector.py +++ b/detector/detector.py @@ -27,6 +27,8 @@ def __init__(self, token): self.class_max = [10, 45, 90, 98, 99] def detect(self, text, all_probs=False): + if len(text) < 1000: + return "Check prompt, Length of sentence it should be more than 1,000 characters" data = { 'prompt': text + "».\n<|disc_score|>", 'max_tokens': 1, @@ -56,4 +58,5 @@ def detect(self, text, all_probs=False): if all_probs: return probs, top_prob return top_prob - return "Check prompt, Length of sentence it should be more than 1,000 characters" + elif response.status_code != 200: + return "Web request was not successful. Please check your bearer token and try again." From 7b858708e55b76350ccdfa76d0a47088bebbb634 Mon Sep 17 00:00:00 2001 From: Cornelius Paardekooper <67299665+Cornelius2121@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:44:41 +1100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae041f4..f797627 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Here is an example ## TO-DO - Add all classes labels (total 5 classes from openai) ✅ -- add verifier to check if the sentence is 1000 characters long +- add verifier to check if the sentence is 1000 characters long ✅ - automatically detect token from user_name, password