Example #1
0
def main():
    chat_bot = ChatBot()

    while True:
        word_phrase = SpeechWorker.get()

        #test
        word_phrase = input()
        if word_phrase is None:
            pass
        else:
            print(word_phrase)
            response = chat_bot.run(input=word_phrase)
            print(response)
            response_select(response=response[Responses.accurate])
def main():
    parser = argparse.ArgumentParser()

    parser.add_argument("-experiment_dir",
                        default="experiments/exp_9",
                        type=str,
                        required=False,
                        help="The output data dir")
    parser.add_argument(
        "-old_model_dir",
        default="run_6",
        type=str,
        required=False,
        help="filename of saved model. say None to train new model")
    parser.add_argument(
        "-old_model_name",
        default="model_3000.bin",
        type=str,
        required=False,
        help="filename of saved model. say None to train new model")
    parser.add_argument(
        "-save_filename",
        #default="chatbot_history/history_e9_r6_3700",
        default="chatbot_history/history_5",
        type=str,
        required=False,
        help="filename of saved model. say None to train new model")

    # for the beam search
    parser.add_argument("-beam_size",
                        default=6,
                        type=int,
                        required=False,
                        help="4 the beam search")
    parser.add_argument("-n_best",
                        default=6,
                        type=int,
                        required=False,
                        help="4 the beam search")
    parser.add_argument(
        "-choose_best",
        default=False,
        type=bool,
        required=False,
        help="weather or not to chose the highest ranked response")

    # device
    parser.add_argument("-device",
                        default="cpu",
                        type=str,
                        required=False,
                        help="cuda, cpu")

    parser.add_argument(
        "-token",
        default="773295820:AAFF5_lCi4FdWCLd8YRbBJ9AeH2MzZWhhpw",
        type=str,
        required=False,
        help="token for telegram chatbot")

    args = parser.parse_args()

    chatbot = ChatBot(args)
    chatbot.run()
Example #3
0
from chatbot import ChatBot
import config

chatbot = ChatBot()

import plugins.public
plugins.public.register(chatbot)

try:
    import plugins.private
    plugins.private.register(chatbot)
except ImportError as exception:
    chatbot.logger.log("ImportError: " + exception.msg)

chatbot.run(config)
Example #4
0
from chatbot import ChatBot
import config

chatbot = ChatBot()

import plugins.public
plugins.public.register(chatbot)

try:
	import plugins.private
	plugins.private.register(chatbot)
except ImportError as exception:
	chatbot.logger.log("ImportError: " + exception.msg)

chatbot.run(config)