a61996ae5406ddfee4ac65ab647ebe858fc16260,beginner_source/chatbot_tutorial.py,,evaluateInput,#,1286
Before Change
// Normalize sentence
input_sentence = normalizeString(input_sentence)
// Evaluate sentence
if beam_size == 1:
output_words = evaluate(encoder, decoder, voc, input_sentence, beam_size)
output_sentence = " ".join(output_words)
print("bot:", output_sentence)
else:
output_words_list = evaluate(encoder, decoder, voc, input_sentence, beam_size)
for output_words, score in output_words_list:
output_sentence = " ".join(output_words)
print("{:.3f} < {}".format(score, output_sentence))
except KeyError:
print("Error: Encountered unknown word.")
After Change
// Evaluate sentence
output_words = evaluate(encoder, decoder, searcher, voc, input_sentence)
// Format and print response sentence
output_words[:] = [x for x in output_words if not (x == "EOS" or x == "PAD")]
print("Bot:", " ".join(output_words))
except KeyError:
print("Error: Encountered unknown word.")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: pytorch/tutorials
Commit Name: a61996ae5406ddfee4ac65ab647ebe858fc16260
Time: 2018-09-17
Author: matthewinkawhich@gmail.com
File Name: beginner_source/chatbot_tutorial.py
Class Name:
Method Name: evaluateInput
Project Name: masa-su/pixyz
Commit Name: f293a29e908ad289a042cc8e906b131d4f9281ce
Time: 2019-05-26
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: pixyz/distributions/poe.py
Class Name: ProductOfNormal
Method Name: prob_factorized_text
Project Name: pytorch/tutorials
Commit Name: 69d978ed497856d05730c05564597e604713f5c4
Time: 2018-09-16
Author: minkawhich@fb.com
File Name: beginner_source/chatbot_tutorial.py
Class Name:
Method Name: evaluateInput