Share your repls and programming experiences

← Back to all posts
EDITH 3.0 | I need help to train her so can people help out here
christiant (1)

All you have to do is talk to her and she will try to answer you based on what she knows, if she doesn't know how to respond she will ask you to tell her how to respond.

I want her to just learn basic conversations, nothing advanced pretty basic honestly.

This took about a month to make since there are like 3 different versions, I tried using SQL, Trello, and Google Sheets. Each one of these got very complicated so I ended up using text files lol.

This is my first attempt at some form of Machine Learning all though this is extremely basic, tips from experienced pythoners would be appreciated greatly. I'm using .txt files to help store things that she learns.

Thanks for helping(if you help)

Please Upvote so people can see this and help me out.

Comments
hotnewtop
CodeLongAndPros (1596)

Also, there is the chatterbot lib, if you don’t want to make yours from scratch.

JoeyLent (20)

You should use .json files instead of .txt files. JSON files are basically Python dictionaries. For example, the json file where the responses are stored could look like this:

{
  "Hello": "Hey there!",
  "How are you?": "I'm doing good!"
  "Tell me a joke": 1
}

The 1 can be used a code for the program, telling it to tell the user a joke.
As @CodeLongAndPros mentioned, parsing (reading and understanding) the text will be a problem. Chat bots are a really difficult thing to program, and so far you have done a good job! I wish you good luck on this chat bot!

Although this may make the code a bit more complex, it will make reading data easier.
Resources:
https://www.w3schools.com/python/python_dictionaries.asp
https://www.w3schools.com/python/python_json.asp

christiant (1)

@JoeyLent Hey thanks for replying, this post was a year ago! Crazy, sorry it took so long to answer but I have definitely upped my python game, I am now working on a discord bot and I use JSON as the storage method.

JoeyLent (20)

@christiant Awesome! That's really nice to hear. It really is crazy thinking that this was a year ago. Anyways, I wish you the best of luck with your discord bot!

christiant (1)

@JoeyLent Haha I keep coming back late! Thank you for wishing me luck, and I wish you luck as well in your future!

CodeLongAndPros (1596)

This is really cool, but I have one comment.
Due to your checking of the text, you can have nonsense be a valid statement