lukalabs / cakechat

CakeChat: Emotional Generative Dialog System
Apache License 2.0
1.7k stars 935 forks source link

Would I need to make a lot of changes to the algorithms to introduce two conditions in each dataset sentence ? #17

Closed stickyburn closed 6 years ago

stickyburn commented 6 years ago

Hey guys, I am trying to put two conditions on each line so that the bot can reply on bit more specific topics than just the single user condition behind them. Would this require a massive change in the files or can I just feed more conditions on each dataset and change the condition values in config.py etc? I changed EMOTIONS_TYPES = create_namedtuple_instance() from config.py; and MAX_CONDITIONS_NUM = $ from prepare_index_files. What else would I have to change to have more than one condition? This is more of a technical discussion rather than an issue. Thanks!

nikitos9000 commented 6 years ago

Yes, in the current implementation, it's a bit sophisticated to use more than one condition input per dataset sample, because it's hardcoded almost everywhere to a single conditional label.

There are two ways to archive multi-conditioned model:

  1. Find every mention of 'condition' in names of variables, and duplicate it to have condition_1 and condition_2
  2. Somehow encode multiple conditions into a single one, i.e. — if you want to provide 'topic' and 'emotion' at the same time, you can combine it into a single 'topic_emotion' condition like 'music_joyful' and 'sport_sad', construct 'index_to_condition' by yourself with desired IDs, and then adopt the code in https://github.com/lukalabs/cakechat/blob/master/cakechat/dialog_model/model.py#L169 to map a single topic_emotion ID from index_to_condition file to multiple input conditional embeddings.