From 2e12028a169df9d96818c43fa9122d891453d835 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 1 Apr 2023 15:14:47 +0200 Subject: [PATCH] Removed test code --- code/toxicity.py | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/code/toxicity.py b/code/toxicity.py index 87e6232..ec304ef 100644 --- a/code/toxicity.py +++ b/code/toxicity.py @@ -124,33 +124,4 @@ def get_toxicity(message: str): float(response["attributeScores"]["INSULT"]["summaryScore"]["value"]), float(response["attributeScores"]["PROFANITY"]["summaryScore"]["value"]), float(response["attributeScores"]["THREAT"]["summaryScore"]["value"]), - ] - - -# test part -def test(): - print("Testing toxicity.py...") - print("Hello world:") - result = get_toxicity("Hello world") - try: - print( - f"TOXICITY: {result[0]}; SEVERE_TOXICITY: {result[1]}; IDENTITY ATTACK: {result[2]}; INSULT: {result[3]}; PROFANITY: {result[4]}; THREAT: {result[5]}; SEXUALLY EXPLICIT: {result[6]}; FLIRTATION: {result[7]}; OBSCENE: {result[8]}; SPAM: {result[9]}" - ) - except: - print( - f"TOXICITY: {result[0]}; SEVERE_TOXICITY: {result[1]}; IDENTITY ATTACK: {result[2]}; INSULT: {result[3]}; PROFANITY: {result[4]}; THREAT: {result[5]}" - ) - print("HELLO WORLD GET ABSOLUTELY BUY MY NEW MERCH OMGGGGGGG:") - result = get_toxicity("HELLO WORLD GET ABSOLUTELY BUY MY NEW MERCH OMGGGGGGG") - try: - print( - f"TOXICITY: {result[0]}; SEVERE_TOXICITY: {result[1]}; IDENTITY ATTACK: {result[2]}; INSULT: {result[3]}; PROFANITY: {result[4]}; THREAT: {result[5]}; SEXUALLY EXPLICIT: {result[6]}; FLIRTATION: {result[7]}; OBSCENE: {result[8]}; SPAM: {result[9]}" - ) - except: - print( - f"TOXICITY: {result[0]}; SEVERE_TOXICITY: {result[1]}; IDENTITY ATTACK: {result[2]}; INSULT: {result[3]}; PROFANITY: {result[4]}; THREAT: {result[5]}" - ) - - -# uncomment the following line to test the code -# test() + ] \ No newline at end of file