def __init__(self, *args, **kwargs): super(TestDialogueManager, self).__init__(*args, **kwargs) opts = MockOpt() opts.nsp_data_dir = TTAD_BERT_DATA_DIR opts.ground_truth_data_dir = GROUND_TRUTH_DATA_DIR opts.nsp_models_dir = TTAD_MODEL_DIR opts.no_ground_truth = False self.agent = FakeAgent(opts)
def __init__(self, *args, **kwargs): super(TestDialogueManager, self).__init__(*args, **kwargs) opts = MockOpt() opts.nsp_data_dir = TTAD_BERT_DATA_DIR opts.ground_truth_data_dir = GROUND_TRUTH_DATA_DIR opts.nsp_models_dir = TTAD_MODEL_DIR opts.no_ground_truth = False self.agent = FakeAgent(opts) self.ground_truth_actions = {} print("fetching data from ground truth, from directory: %r" % (opts.ground_truth_data_dir)) if not opts.no_ground_truth: if os.path.isdir(opts.ground_truth_data_dir): dataset = opts.ground_truth_data_dir + "datasets/high_pri_commands.txt" with open(dataset) as f: for line in f.readlines(): text, logical_form = line.strip().split("|") clean_text = text.strip('"').lower() self.ground_truth_actions[clean_text] = json.loads( logical_form)
def setUp(self): opts = MockOpt() opts.ground_truth_data_dir = GROUND_TRUTH_DATA_DIR opts.no_ground_truth = False super().setUp(agent_opts=opts)