Skip to content

Commit

Permalink
Update Joan.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamster3000 authored Nov 23, 2024
1 parent 8e03952 commit c807b3a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Joan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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 ***
###for any code that is temp search for ***

0 comments on commit c807b3a

Please sign in to comment.