From c807b3ae7bd18fd35895226a6ffcc183cf537f45 Mon Sep 17 00:00:00 2001 From: jamster3000 <148760154+Jamster3000@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:29:11 +0000 Subject: [PATCH] Update Joan.py --- Joan.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Joan.py b/Joan.py index b8c9edc..c7855db 100644 --- a/Joan.py +++ b/Joan.py @@ -58,7 +58,24 @@ def wraper(*args, **kwargs): class models(): @log_execution_time - def process_input(user_input, vectorizer, classifier, er_vectorizer, er_classifier): + def process_input(user_input, vectorizer, classifier, er_vectorizer, er_classifier): + """ + process_input + -------------- + Processes the user's input, cleaning it, and using various different functions to determine how to respond accurately. If no appropiate response is found, then it relised on the big guns function, which uses external online A.I. sources, such as a small and fast Mistral model or wolfram alpha. + + Parameters + -------------- + - user_input (str): The user's input to process + - vectorizer + - classifier + - er_vectorizer + - er_classifier + + Returns + ------------- + None: This procedure doesn't return a value. + """ with open('data/expected context.txt', 'r') as f: context = f.read() @@ -217,4 +234,4 @@ def find_matched_keywords(user_input, vectorizer, threshold=0.7): if process == 'reload data': #if the bot learns from wolfram alpha then it returns 'reload data' for it load the data model in again (takes around 1.5 seconds) vectorizer, classifier, er_vectorizer, er_classifier = models.preprocess_data() -###for any code that is temp search for *** \ No newline at end of file +###for any code that is temp search for ***