Exemple #1
0
    ]:
        print("Lara : Good bye see you soon ;)")
        break
    #get ansewers from lara bot
    bot_input = lara.get_response(question)

    if (bot_input.text == "I am sorry, but I do not understand."):
        print("Lara :", bot_input.text)
        print(
            "Lara: Could you please suggest a response for your question here")

        proposition = input("Your proposition :")
        new_response = Statement(proposition, in_response_to=question)
        new_response.search_text = lara.storage.tagger.get_bigram_pair_string(
            proposition.lower())
        new_response.conversation = str('training')
        new_response.search_in_response_to = lara.storage.tagger.get_bigram_pair_string(
            question.lower())
        lara.learn_response(new_response)
        #conn = sqlite3.connect("db.sqlite3")
        """
        Once we have a Connection object, we can then create a Cursor object. 
        Cursors allow us to execute SQL queries against a database.
        
        """
        #df = pd.read_sql_query("select * from statement;", conn)
        #print(df.shape)

        #df.loc[len(df)] = [len(df)+1, question,question,"training","",question,proposition, ""]
        #df["conversation"].loc[df.in_response_to == question] = "training"
        #df["search_in_response_to"].loc[df.in_response_to == question] = question