return appropriate number of examples for dealnodeal teacher
@@ -64,8 +64,18 @@ class NegotiationTeacher(Teacher):
self.reset()
+ def num_examples(self):
+ # 1 example for every expected learner text response (YOU), and 1
+ # example for the expected learner final negotiation output values
+ num_exs = 0
+ dialogues = [self._split_dialogue(get_tag(episode.strip().split(), DIALOGUE_TAG))
+ for episode in self.episodes]
+ num_exs = sum(len([d for d in dialogue if YOU_TOKEN in d]) + 1
+ for dialogue in dialogues)
+ return num_exs
+
def __len__(self):
- return len(self.episodes)
+ return self.num_examples()
def reset(self):
super().reset()
