I have a method I am using currently which employs the use of lists in order for your AI to talk to people. This method is simple and cleans up your code so you have less if()then Statements.
Here it is
# This is a file other than main.py. Any file you wish to name it tho. UserI_Checks = ['hello', 'what is your name?', 'who made you?'] AI_Responses = ['Hi!', 'My name is Ultimate AI.', 'I was made by @PCL.'] # And now in the main.py file from [Your File] import UserI_Checks, AI_Responses UserI = str.lower(input(": ")) if UserI in UserI_Checks: print(AI_Respones[UserI_Checks.index(UserI)]) else: print("Hmmm? I don't understand that, what does that mean?") [Your Neural Network Here]
Now for a quick explaination, There are two lists one for each object
UserI_Checks which contains a list of UIser Inputs you wish for the AI to watch for, and
AI_Responses which are the responses the AI will use when the User Input calls it. Now make sure that you are putting the User input and the desired response in the same index as eachother!
I hope you use this!
Nice try kid...
But you failed, this is not artificial intelligence.
Learn more Python, better luck next time!
@PCL Yea good that he has been banned, and this is artificial intelligence because it learns based off of user input, thats pretty intelligent If I say so myself. Mega Applause all for you. Keep learning, everyday you will get better, ignore the hate, and learn from supporters like me! KEEP CODING!!!!
@timmy_i_chen Really? For being "unhelpful"? You called this a "neural network", when it's clearly not even close. Have you ever seen one before? It looks something like this:
def init(self, x, y):
self.input = x
self.weights1 = np.random.rand(self.input.shape,4)
self.weights2 = np.random.rand(4,1)
self.y = y
self.output = np.zeros(self.y.shape)
def feedforward(self): self.layer1 = sigmoid(np.dot(self.input, self.weights1)) self.output = sigmoid(np.dot(self.layer1, self.weights2))
He is not the only one who says that. Your program simply saves literally whatever you type in it, so I also disagree about this "neural network" your class made thinking it was.
Not to rain on anybody's parade, but this isn't really A.I, or a neural network...
I sure hope I'm not considered being "mean" for stating a fact. It's a cool project, and I'm glad you and your class could make it.