Answers.Body: <p>What you want to do is you have some character like hulk, thor, caption America, iron man, etc. and you want to Train a response generator for each character like for thor on his dataset, for hulf on his dataset etc... and then you wanted to make a conversation. If I Understood you well then.</p>
  <ul>
  <li><p>You can fine-tune GPT-2 small or GPT-2 Medium using your Dataset for each character. <a href="https://github.com/microsoft/DialoGPT" rel="nofollow noreferrer">Reference for Finetune</a></p>
  </li>
  <li><p>You can decode using simple nucleus sampling at each time step. Use greedy nucleus sampling multiple times in parallel to generate multiple responses. You can generate 30 such responses and also use the last 3-5 dialogue turn as a context or Short term memory. <a href="https://github.com/JRC1995/Chatbot/blob/master/Generator/generator.py" rel="nofollow noreferrer">Decoder reference</a></p>
  </li>
  <li><p>To Choose the best response out of all generated responses(30 responses as an example). you can use cosine similarity between generated responses and query + last 3-5 dialogue turn.</p>
  <pre><code>def cosine_similarity_nd(embd1, embd2):
  numerator = np.multiply(embd1, embd2)
  numerator = np.sum(numerator, axis=1)
  eucli_norm_1 = np.sqrt(np.sum(np.power(embd1, 2), axis=1))
  eucli_norm_2 = np.sqrt(np.sum(np.power(embd2, 2), axis=1))
  denominator = np.multiply(eucli_norm_1, eucli_norm_2)
  denominator = denominator + 1e-10  # remove zeros
  cosine_similarity = np.divide(numerator, denominator)
  return cosine_similarity.reshape((-1))
  </code></pre>
  </li>
  <li><p>Or you can train a reverse model for either all character or mix all character dialogue and use this model to calculate loss of all responses with your query. <a href="https://convaisharables.blob.core.windows.net/lsp/multiref/small_reverse.pkl" rel="nofollow noreferrer">Reference reverse model</a></p>
  </li>
  <li><p>Or you can Combine result of cosine and reverse model to find response out of all the responses.</p>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-21T07:54:12.877Z
Answers.LastActivityDate: 2020-06-21T07:54:12.877Z
Answers.UserDisplayName: Hiren Namera
Answers.Body: <p>Define features that describe C1 and C2 (like their ids) and add these features to inputs of your model. Thus your only model will be able to generate the next line for any pair of (C1, C2).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-18T07:33:07.660Z
Answers.LastActivityDate: 2020-06-18T07:33:07.660Z
Answers.UserDisplayName: oleg.mosalov
Body: <p>I'm in the middle of a project in which I want to generate a TV series script (characters answering to each other, scene by scene) using SOTA models, and I need some guidance to simplify my architecture.</p>
  <p>My current intuition is as follows: for a given character <em>C1</em>, I have pairs of sentences from the original scripts where <em>C1</em> answers other characters, for example, <em>C2</em> (<em>C2</em>-&gt;<em>C1</em>). These are used to fine-tune a data-driven chatbot. At inference time, the different chatbots simply answer each other, and, hopefully, the conversation will have some sense.</p>
  <p>This is however unpractical and will be kind of a mess with many characters, especially if I use heavy models.</p>
  <p>Is there an architecture out there that could be used for conversational purposes, which could be trained only once with the whole dataset while separating the different characters?</p>
  <p>I'm open to any ideas!</p>
  
Tags: <neural-networks><training><chat-bots><generative-model>
Title: How to combine several chatbots into one?
UserDisplayName: Ugohihi
ThreadText: # How to combine several chatbots into one?
  
  (Asked by: username_0 on 2020-06-17)
  
  I'm in the middle of a project in which I want to generate a TV series script (characters answering to each other, scene by scene) using SOTA models, and I need some guidance to simplify my architecture.
  
  My current intuition is as follows: for a given character *C1*, I have pairs of sentences from the original scripts where *C1* answers other characters, for example, *C2* (*C2*->*C1*). These are used to fine-tune a data-driven chatbot. At inference time, the different chatbots simply answer each other, and, hopefully, the conversation will have some sense.
  
  This is however unpractical and will be kind of a mess with many characters, especially if I use heavy models.
  
  Is there an architecture out there that could be used for conversational purposes, which could be trained only once with the whole dataset while separating the different characters?
  
  I'm open to any ideas!
  
  **Tags:** neural-networks, training, chat-bots, generative-model
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-06-21. Score: 0 | Accepted answer
  
  What you want to do is you have some character like hulk, thor, caption America, iron man, etc. and you want to Train a response generator for each character like for thor on his dataset, for hulf on his dataset etc... and then you wanted to make a conversation. If I Understood you well then.
  
  You can fine-tune GPT-2 small or GPT-2 Medium using your Dataset for each character. Reference for Finetune
  
  You can decode using simple nucleus sampling at each time step. Use greedy nucleus sampling multiple times in parallel to generate multiple responses. You can generate 30 such responses and also use the last 3-5 dialogue turn as a context or Short term memory. Decoder reference
  
  To Choose the best response out of all generated responses(30 responses as an example). you can use cosine similarity between generated responses and query + last 3-5 dialogue turn.
  def cosine_similarity_nd(embd1, embd2):
  numerator = np.multiply(embd1, embd2)
  numerator = np.sum(numerator, axis=1)
  eucli_norm_1 = np.sqrt(np.sum(np.power(embd1, 2), axis=1))
  eucli_norm_2 = np.sqrt(np.sum(np.power(embd2, 2), axis=1))
  denominator = np.multiply(eucli_norm_1, eucli_norm_2)
  denominator = denominator + 1e-10  # remove zeros
  cosine_similarity = np.divide(numerator, denominator)
  return cosine_similarity.reshape((-1))
  
  
  Or you can train a reverse model for either all character or mix all character dialogue and use this model to calculate loss of all responses with your query. Reference reverse model
  
  Or you can Combine result of cosine and reverse model to find response out of all the responses.
  
  
  ---
  
  ### Answer by username_2 on 2020-06-18. Score: 0
  
  Define features that describe C1 and C2 (like their ids) and add these features to inputs of your model. Thus your only model will be able to generate the next line for any pair of (C1, C2).
  
  
  ---
  
  