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

Normalized all convai2 teachers #3509

Merged
merged 3 commits into from
Mar 18, 2021
Merged

Normalized all convai2 teachers #3509

merged 3 commits into from
Mar 18, 2021

Conversation

jxmsML
Copy link
Contributor

@jxmsML jxmsML commented Mar 10, 2021

Patch description
Add variants of convai2 teacher

  • Normalize all convai2 teachers (None, Both, Self, Their)
  • Add --your-persona-first: whether to prepend your persona first or their persona (which matter if context_truncate is smaller than the persona length); default is true (consistent with the original BothTeacher)
  • Add --max-num-turns: first max_num_turns per episode to show if persona is increasingly/decreasingly important. default is -1 meaning no truncation.
  • Add TheirTeacher: only prepend partner's persona

Testing steps
CI
parlai dd -t convai2:NormalizedBoth

- - - NEW EPISODE: convai2:NormalizedBoth - - -
your persona: My mom is my best friend.
your persona: I have four sisters.
your persona: I believe that mermaids are real.
your persona: I love iced tea.
partner's persona: I wish I could live forever.
partner's persona: I only date people taller than me.
partner's persona: I really like technology.
partner's persona: I like free diving.
Hi, how are you doing today?
   I am spending time with my 4 sisters what are you up to
Wow, four sisters. Just watching game of thrones.
   That is a good show I watch that while drinking iced tea
I agree. What do you do for a living?
   I'm a researcher I'm researching the fact that mermaids are real
23:07:28 | loaded 17878 episodes with a total of 131438 examples
parlai dd -t convai2:NormalizedBoth --your-persona-first False -ne 20  --max-num-turns 1

- - - NEW EPISODE: convai2:NormalizedBoth - - -
partner's persona: I went to school for fashion design and did nothing with it.
partner's persona: I'ven t had to work a day in my life.
partner's persona: I don t know why my sister in law dislikes me.
partner's persona: I think I need botox soon.
your persona: I watch a lot of tv.
your persona: I live alone.
your persona: I enjoy fishing.
your persona: I work on cars for a living.
Hello, tell me about you.
   Hi, I am a mechanic who lives alone... How about you?
- - - NEW EPISODE: convai2:NormalizedBoth - - -
partner's persona: I really like watching star trek.
partner's persona: I like eating pretzels.
partner's persona: My favorite band is vnv nation.
partner's persona: I work for the railroad.
your persona: I like to hunt.
your persona: Both my parents were teachers.
your persona: I had two cats growing up.
your persona: I have two children.
your persona: I like to donate time at the local animal shelter.
Hey whats going on? How are you?
   Not much, just seen both my children off to school, you?
20:59:34 | loaded 17878 episodes with a total of 17878 examples
parlai dd -t convai2:NormalizedTheir --max-num-turns -1
- - - NEW EPISODE: convai2:NormalizedTheir - - -
partner's persona: I wish I could live forever.
partner's persona: I only date people taller than me.
partner's persona: I really like technology.
partner's persona: I like free diving.
Hi, how are you doing today?
   I am spending time with my 4 sisters what are you up to
Wow, four sisters. Just watching game of thrones.
   That is a good show I watch that while drinking iced tea
I agree. What do you do for a living?
   I'm a researcher I'm researching the fact that mermaids are real
21:02:46 | loaded 17878 episodes with a total of 131438 examples

Other information

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.

Would be a cool use for mutators

@jxmsML jxmsML force-pushed the normalizedconvai2 branch from b8fa2e2 to 5787711 Compare March 12, 2021 20:44
@jxmsML jxmsML force-pushed the normalizedconvai2 branch from 5787711 to 889572b Compare March 12, 2021 20:47
@jxmsML
Copy link
Contributor Author

jxmsML commented Mar 12, 2021

Would be a cool use for mutators

what do you mean @stephenroller

@stephenroller
Copy link
Contributor

I mean you're doing the same transformation on multiple datasets. That's fine and easy here, but it's also the use case of mutators exactly.

@jxmsML jxmsML requested a review from stephenroller March 12, 2021 21:50
@jxmsML
Copy link
Contributor Author

jxmsML commented Mar 12, 2021

I mean you're doing the same transformation on multiple datasets. That's fine and easy here, but it's also the use case of mutators exactly.

yea. The main thing I want to mutate here is the positions of your persona + their persona, but I also find it very specific in this case that as far as I know it only applies to this convai2 teacher?

@stephenroller
Copy link
Contributor

The normalization part (punctuation/casing) is pretty agnostic. Anyway this is all fine, I'm just trying to encourage thinking about the new tool in the toolbox.

@jxmsML jxmsML merged commit ac7d2ee into master Mar 18, 2021
@jxmsML jxmsML deleted the normalizedconvai2 branch March 18, 2021 21:12
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.

3 participants