Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Chunk Teacher] Allow multi-turn #2805

Merged
merged 3 commits into from
Jul 7, 2020
Merged

[Chunk Teacher] Allow multi-turn #2805

merged 3 commits into from
Jul 7, 2020

Conversation

emilydinan
Copy link
Contributor

Patch description
Some changes to Chunk Teacher:

  • allow for multi-turn conversation
  • allow for ambiguous output from load_chunk
  • allow the data split to depend on other arguments in opt instead of just datatype

@github-actions
Copy link

github-actions bot commented Jul 1, 2020

Your PR contains a change to a task. Please paste the results of the following command into a comment:

python tests/datatests/test_new_tasks.py

Copy link
Contributor

@stephenroller stephenroller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a breaking change, can we discuss alternatives?

@@ -2021,6 +2024,7 @@
self._enqueue_request()

self.episode_done = True
self.last_queue_output = None

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn’t you just use self.opt?

queue_output = self.samples.get()
if queue_output is None:
return None
if self.episode_done:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer this private I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? I actually didn't add this varialbe, I believe it's something used by FixedDialogTeacher

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could just make this self._episode_done since this teacher doesn't actually use the self.episode_done from FixedDialogTeacher right? or does it?

@@ -151,7 +153,7 @@ def load_from_chunk(self, chunk_idx: int) -> List[Tuple[str, str]]:

return output

def create_message(self, queue_output: Tuple[str, ...]) -> 'Message':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChunkOutput?

@emilydinan emilydinan requested a review from klshuster July 6, 2020 17:49
Copy link
Contributor

@klshuster klshuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

queue_output = self.samples.get()
if queue_output is None:
return None
if self.episode_done:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could just make this self._episode_done since this teacher doesn't actually use the self.episode_done from FixedDialogTeacher right? or does it?

@@ -575,7 +577,7 @@ def load_from_chunk(self, chunk_idx: int):
output.append((text, resp))
return output

def create_message(self, sample_item):
def create_message(self, sample_item, entry_idx=0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd probably be nice to have a MultiturnChunkyTeacher as well in the integration tests 😄

@klshuster
Copy link
Contributor

Or, perhaps @stephenroller knows better (I have personally never used ChunkTeacher in the past so perhaps do not appreciate if this indeed breaks things)

@emilydinan
Copy link
Contributor Author

I've tested all of the tasks publicly and internally with these changes... I have a PR in internal that's ready to land once this lands. I'll make episode_done private and land

@emilydinan emilydinan merged commit 3d0489c into master Jul 7, 2020
@emilydinan emilydinan deleted the chunkyfixes branch July 7, 2020 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants