-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ConversationTeacher parent class changed #4256
Conversation
parlai/core/teachers.py
Outdated
@@ -1611,12 +1611,12 @@ def setup_data(self, datafile): | |||
yield act, next_episode_new | |||
|
|||
|
|||
class ConversationTeacher(FixedDialogTeacher): | |||
class ConversationTeacher(ParlAIDialogTeacher): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might need to be DialogTeacher, not ParlAIDialogTeacher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes DialogTeacher
preferable to ParlAIDialogTeacher
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParlAI DT should be assuming a particular format. It might be that we successfully override everything but really we shouldn't.
815ac82
to
22d21c7
Compare
* remove unnecessary run scripts * udpate readmes
…rlAI into conv-teacher * 'conv-teacher' of https://github.com/facebookresearch/ParlAI: reformat ConversationTeacher parent class changed
@stephenroller I changed the base class to |
@@ -1719,27 +1704,24 @@ def _setup_data(self, path): | |||
if self.label_turns in ['firstspeaker', 'both']: | |||
eps = self._get_ep_from_turns(turns[::2], turns[1::2]) | |||
if eps: | |||
self.episodes.append(eps) | |||
self.num_exs += len(eps) | |||
for example, example_begins in self._return_episode_examples(eps): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
|
||
# train on even turns as labels (turns w/ second speaker) | ||
if self.label_turns in ['secondspeaker', 'both']: | ||
eps = self._get_ep_from_turns(turns[1::2], turns[2::2]) | ||
if eps: | ||
self.episodes.append(eps) | ||
self.num_exs += len(eps) | ||
for example, example_begins in self._return_episode_examples(eps): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Patch description
Changed
ConversationTeacher
's parent class toParlAIDialogTeacher
.Testing steps
1- Standard teacher tests in ParlAI that rely on
ConversationTeacher
.2-
parlai dd
some internal classes that use this teacher