def __init__(self, opt, shared=None):
"""Initialize the class accordint to given parameters in opt."""
# store datatype
self.datatype_strict = opt['datatype'].split(':')[0]
opt['datafile'] = _path(opt)
# store identifier for the teacher in the dialog
self.id = 'insults_teacher'
self.answer_candidates = ['Non-insult', "Insult"]
random_state = random.getstate()
random.seed(opt.get('teacher_random_seed'))
self.random_state = random.getstate()
random.setstate(random_state)
super().__init__(opt, shared)
if shared:
self.observations = shared['observations']
self.labels = shared['labels']
else:
self.observations = []
self.labels = []
评论列表
文章目录