def handlecommand(self, user, command): global flag if any(word in command for word in jsonData["model_sel_words"]) or any( word in command for word in jsonData["analysis_words"]): flag = 0 return "Please upload the dataset along with your query" elif "know" in command.lower() and "from" in command.lower(): list = KeywordExtraction.keywordExtraction1( command, "Sheet1", "Sheet2", "Sheet3") list.append("onlyfunction") flag = 0 return list elif "know" in command.lower(): list = KeywordExtraction.keywordExtraction(command, "Sheet1") list.append("onlylibrary") #list=mocking_infrastructure.mock_keyword_extraction(command) #print (list) flag = 0 return list #elif any(word in command for word in jsonData["model_sel_words"]): # return "Please give the csv file that you want to analyze or want a suggestion about" elif "Pssst" in command.lower(): flag = 0 return "error" elif "no" in command.lower(): flag = 0 return "Sorry about that :(" elif "yes" in command.lower(): flag = 0 return "Thankyou for the feedback" elif flag == 2: model_Selection = modelSelection.modelSelInteraction(path, command) flag = 0 #model_Selection=mocking_infrastructure.mockbestModel(path,command) return model_Selection elif flag == 1: analysis_file = analysis.analysisInteraction(path, command) flag = 0 #analysis_file=mocking_infrastructure.mock_analysis_interaction(path,command) return analysis_file elif flag == 0: return "Sorry I did not get you"
def test_analysis_result_cat(self): self.assertIsNotNone( analysis.analysisInteraction( "/home/CSC510-23/Code/Datasets/Crime1.csv", "Category"))
def test_analysis_result_num(self): self.assertIsNotNone( analysis.analysisInteraction( "/home/CSC510-23/Code/Datasets/Wine.csv", "Class"))
def test_analysis_target_num(self): self.assertEqual( analysis.analysisInteraction( "/home/CSC510-23/Code/Datasets/Wine.csv", "Hululu"), wrngColEx)
def test_analysis_numerical(self): analysis.analysisInteraction("/home/CSC510-23/Code/Datasets/Wine.csv", "Class") count_cat = contentCheck_numerical() self.assertEquals(count_cat, parameter_count_numerical)
def test_analysis_categorical(self): analysis.analysisInteraction( "/home/CSC510-23/Code/Datasets/Crime1.csv", "Category") count_cat = contentCheck_categorical() self.assertEquals(count_cat, parameter_count_categorical)
def test_analysis_result_num(self): self.assertIsNotNone( analysis.analysisInteraction("Datasets/Wine.csv", "Class"))
def test_analysis_target_cat(self): self.assertEqual( analysis.analysisInteraction("Datasets/Crime1.csv", "Hululu"), wrngColEx)