Share your repls and programming experiences

← Back to all posts
Text AI (Chat Bot)
ArnabChakrabor1 (3)

A mini chat bot to help with depression or mixed feelings.

https://repl.it/@ArnabChakrabor1/TEXTAIFINAL

Comments
hotnewtop
[deleted]

Hello,
shouldn't you replace the colons by question marks ?

[deleted]

The problem with this progam is that in the "if"s are too precise conditions.

joe_simop_8 (1)

@joshfreeman: Two ways to circumvent the problem listed above, one, create more possibilities for the if conditions with synonyms, so if you were to have the response be 'happy' maybe have the same if condition for the word 'good'.

Another way would to be create a more dynamic chatbot with lists of words that have good and bad connotations. So say the good_word_list = ['happy', 'content, 'good'] and the bad_word_list=['angry', 'mad', 'sad']. Every time the user responds, based off the words in the string returned, you can search for those words in the strings and make an appropriate response on whether they are 'good' or 'bad'. A thing you need to be careful of are words that reverse the meaning of the response, like if the user responded with 'not good'. Then you would need to reverse the response even though it had the word 'good' in it.

I hope this helped!