def setUp(self): unittest.TestCase.setUp(self) with open("src/test/resources/test_workspaces/skill-Customer-Care-Sample.json", "r") \ as skill_file: workspace_data, workspace_vocabulary = \ skills_util.extract_workspace_data(json.load(skill_file)) self.workspace_df = pd.DataFrame(workspace_data)
def test_extract_workspace_data(self): skill_json = json.load(self.skill_file) workspace_data, workspace_vocabulary = skills_util.extract_workspace_data( skill_json) workspace_df = pd.DataFrame(workspace_data) self.assertNotEqual(workspace_data, None, "Extract workspace failed") self.assertEqual(len(workspace_df["intent"].unique()), 9, "Extract workspace failed")
def setUp(self): unittest.TestCase.setUp(self) test_skill_file = "src/test/resources/test_workspaces/skill-Customer-Care-Sample.json" with open(test_skill_file, "r") as skill_file: workspace_data, workspace_vocabulary = skills_util.extract_workspace_data( json.load(skill_file)) self.workspace_df = pd.DataFrame(workspace_data) self.test_data = pd.DataFrame( {'utterance': ['Boston is the capital city of massachusetts ', 'Boston Celtics is a famous NBA team', 'new york is a big city in the east coast'], 'intent': ['boston', 'boston', 'nyc']})
def setUp(self): unittest.TestCase.setUp(self) test_skill_file = "src/test/resources/test_workspaces/skill-Customer-Care-Sample.json" with open(test_skill_file, "r") as skill_file: workspace_data, workspace_vocabulary = skills_util.extract_workspace_data( json.load(skill_file)) self.workspace_df = pd.DataFrame(workspace_data) self.mock_test_result = pd.DataFrame( {'correct_intent':['intent1', 'intent2'], 'entities':[ [{'entity' : 'entity1', 'confidence':1}, {'entity' : 'entity2', 'confidence':1}], [{'entity' : 'entity1', 'confidence':.5}]] })
def setUp(self): unittest.TestCase.setUp(self) with open( "src/test/resources/test_workspaces/skill-Customer-Care-Sample.json", "r") as skill_file: workspace_data, workspace_vocabulary = \ skills_util.extract_workspace_data(json.load(skill_file)) self.workspace_df = pd.DataFrame(workspace_data) self.train_set_pd = pd.DataFrame({ 'utterance': ['boston is close to new york'], 'intent': ['Boston_New_York'] }) self.test_set_pd = pd.DataFrame({ 'utterance': [ 'both boston and new york are on east coast', 'boston is close to new york' ], 'intent': ['Boston_New_York', 'Boston_New_York'] })