Custom Chat Bot

This is my custom chat bot! To chat with it, press space and enter your message. It does run off of preset inputs and outputs, but it's a lot more complicated than that may make it seem. Here's how it works (Might not be in perfect order as I originally made this in Scratch and moved it here, and it's been 2 years since I originally made it):

  • All the Inputs and Outputs of the chat bot are shuffled, will be important for future steps, but the correlated Inputs and Outputs stick together as they only make sense together
  • Punctuation is removed from the message, allowing words to be easily detected
  • All words in the message are checked to see if they are a synonym, and if they are they are changed to the original synonym. Ex: "Hello, how are you?" is turned into "Hi, how are you?", where "Howdy, hello, sup" and other common greetings are changed into "Hi"
  • The message sent by the user is then compared in word similarity to every Input provided, comparing how many words in the Input are the same as words in the list of Inputs. This allows for two messages, like "Hello, how are you?" and "Hey there, how are you doing?" to be similar to each other and letting the algorithm to compare them
    • After every Input in the list is scanned, the most similar one will have it's associated output reply to the user
    • The mixing up of the Inputs and Outputs allows for different responses for equally similar messages. When scanning for similarity, if two items have the same similarity level, the first one will be the one sent back to the user. If you type "What's your favorite letter?", that is not a possibility of an Input. So, the two possible ones, "What's your favorite number?" and "What's your favorite color?" will have an equal similarity, and by shuffling them around it will pick a different one almost every time, as the first one found is sent out, so it is not as repetitive.
  • If no Input in the list has a high enough similarity to the provided Input, then a random message of a list will be sent back, including "Sorry, I don't understand that.", and "Hmm, okay." as predetermined 'error' messages

This code is pretty old and I now know more things that could improve the efficiency of this, or to make it better, like using Word2vec. Note that this was originally made before Chat-GPT was a thing, and I transferred it from Scratch to here because I thought I could improve it's efficiency, which I did by a lot with Snap!'s unique features.

https://snap.berkeley.edu/snap/snap.html#present:Username=bruh9000&ProjectName=Chatbot%20Test%206&editMode&noRun

just saying "you" says "what did i do"

Ohhhh yeah, real smart.
ReallySmartAIChatbot

lol

I said youre mean.

Yes, this is a demo. In order to have the chatbot communicate clearly you need to provide it with inputs and outputs. The point of the algorithm is to allow it to understand similarities between messages.

Yes, this is a demo. In order to have the chatbot communicate clearly you need to provide it with inputs and outputs. The point of the algorithm is to allow it to understand similarities between messages.

I custom coded in messages for regular dialogue, and math problems aren't programmed into it since I would have to code every math problem into it. If you want something to do math for you, go to my other project:

https://snap.berkeley.edu/snap/snap.html#present:Username=bruh9000&ProjectName=Math%20Solver

  • Do note that you need to only enter the problem in this project, not any words

Yes, this is a demo. In order to have the chatbot communicate clearly you need to provide it with inputs and outputs. The point of the algorithm is to allow it to understand similarities between messages. It doesn't have enough things for it to correctly answer every question, this is just a demonstration of what it is capible of.

I custom coded in messages for regular dialogue, and math problems aren't programmed into it since I would have to code every math problem into it. If you want something to do math for you, go to my other project:

https://snap.berkeley.edu/snap/snap.html#present:Username=bruh9000&ProjectName=Math%20Solver

  • Do note that you need to only enter the problem in this project, not any words

Yes, this is a demo. In order to have the chatbot communicate clearly you need to provide it with inputs and outputs. The point of the algorithm is to allow it to understand similarities between messages. It doesn't have enough things for it to correctly answer every question, this is just a demonstration of what it is capible of.

ok, I like the project

Ohhhhh yeah I learns alright.
AUNI2
^ Basically me telling the AI what this Gen-Z Acronym means ^

AUNI 21
^ Me seeing if the AI learned ^

I never said it learns. It doesn't learn at all.

That last one made me laugh

This is pretty cool! I wonder if I could make something similar with reinforcement learning that’s actually an ai

I definitely could on second thought

It isn’t an AI if it never learns, but I guess you never said it was. ¯\_(ツ)_/¯

Actually even if it doesn’t learn it can still be kind of An ai, it would just be a snapshot of the ai that never gets changed, it can still be from an ai so it’s kinda still an ai

Reinforcement learning is like a really basic ai that learns based on a human verifying if the output is what they wanted or is getting closer to what they want

AI stands for artificial intelligence. A system can be called AI without there being any sort of intelligence involved. See:

Yes but I mean a “traditional ai” that learns based on users and has a “brain”
This is not exactly what you would think of an ai being

Mine would be trained by seeing how close a word is to what the user was expecting, then if incorrect the ai changes it’s brain until it is correct