lukalabs / cakechat

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

Emotion Condition vs. Emotion detection #44

Closed tiimoS closed 5 years ago

tiimoS commented 5 years ago

From what I can make out in the code (get_response in cakechat.api.response), you are using the input emotion category (that the user can set - {joy, anger, sadness etc.}) to condition the response. So, do I understand correctly that you are actually not detecting any emotion from the user text input but rather hardwire the emotion in the response to the emotion input category, no matter what the user's emotion in the input text is?

Looks like you are multiplying the emotion condition (from the input) with the condition ids that you gathered from the tokenized user text. What do these condition ids actually relate to?

condition_ids = transform_conditions_to_ids([emotion] * condition_ids_num, _cakechat_model.condition_to_index,
                                                condition_ids_num)

Thanks in advance for the clarifications 👍

nicolas-ivanov commented 5 years ago

So, do I understand correctly that you are actually not detecting any emotion from the user text input but rather hardwire the emotion in the response to the emotion input category, no matter what the user's emotion in the input text is?

Yes, that's correct.

Looks like you are multiplying the emotion condition (from the input) with the condition ids that you gathered from the tokenized user text. What do these condition ids actually relate to?

I see that this piece of code is written poorly, since the condition_ids_num can be simply replaced with 1. Thanks for pointing this out, will be fixed in future release to the following:

condition_ids = transform_conditions_to_ids([emotion], _cakechat_model.condition_to_index, n_dialogs=1)

Explanation of the current code: condition_ids_num equals to the number of contexts to be processed in the same batch, i.e. it is a batch_size. Since the api function get_response processes only one dialog context at a time, condition_ids_num always equals to 1. If get_response function had to process a batch of contexts with the same emotion used for conditioning, the current code would make sense.

tiimoS commented 5 years ago

great, thanks a lot for the super quick feedback!

nicolas-ivanov commented 5 years ago

You are welcome!

On Thu, Feb 7, 2019, 08:35 Timo Spring <notifications@github.com wrote:

great, thanks a lot for the super quick feedback!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/lukalabs/cakechat/issues/44#issuecomment-461501285, or mute the thread https://github.com/notifications/unsubscribe-auth/ACKuFgt62lzNuXMMqXCu8TmZmpO_YtpCks5vLFXEgaJpZM4aaKG6 .