def __init__(self): global base_filename self.pin_setup() self.pin_both() self.model = model.NMT() self.model.setup_for_interactive() self.voice = v.VoiceOut() self.sr = sr.VoiceGoogleSR() self.words_name = ['chatbot', 'mutter', 'robot'] self.words_start = [ 'start', 'talk', 'answer', 'reply', 'hello', 'hi', 'okay' ] self.words_stop = ['stop', 'exit', 'quit', 'quiet', 'silence'] self.words_start += self.words_name self.count_max = 15 self.first_run = True self.blacklist = [ #"i don't know", #"i do not know" ] self.voice.beep_out() self.voice.speech_out(speech_start) self.time_total = 5 self.time_allowed = 3.5 if mode == 'sequential': self.time_allowed = 100
def __init__(self): global base_filename self.model = model.NMT() self.model.setup_for_interactive() self.voice = v.VoiceOut() self.sr = sr.VoiceGoogleSR() self.words_name = ['chatbot', 'mutter', 'robot'] self.words_start = [ 'start', 'talk', 'answer', 'reply', 'hello', 'hi', 'okay' ] self.words_stop = ['stop', 'exit', 'quit', 'quiet', 'silence'] self.words_start += self.words_name self.count_max = 15 self.first_run = True self.blacklist = [ #"i don't know", #"i do not know" ] self.voice.beep_out()