0
Need help on this. Iâm a beginner and I donât know how to do this.
Iâm trying to make a prototype AI based on what I know on Python (which is next to nothing, if Iâm being honest) and I have no idea how to print a string based on a specific user input.
5 Respostas
+ 3
Then you should first get started with the basics at:
https://www.sololearn.com/learn/courses/JUMP_LINK__&&__python__&&__JUMP_LINK-introduction
Then move to intermediate, then to developer.
Making a real AI is hard but after learning basics - you can make some simple chatbots with using dictionaries or if-else trees
+ 1
Hi! you probably meant something like that?
user_input = input()
# this input will be saved as a data type - string
print(user_input)
+ 1
Are you referring to f-string? Or a more complex like AI chatbot: when a user type something, it will output a response based on user input? I believe you need API for this.
0
Not really.
I wasnât clear, I guess.
I meant more along the lines of if a specifc input() command was entered, it would print a specific line of code.
0
Neural intents? The most common thing I can think
But I guess you are mentioning something like:
If asked this -> print this
Then I guess the prototype you are referring to is rule-based AI
It's quite simple if you used if-else but smart people will use dictionary like structure to perform the task
Let's say:
Hello -> Hey there
Or
Hi -> Hey there
Sometimes it can also result 'Hi dude', 'Hello user', etc... something like that
So what you can do is create a dictionary with a tuple as ID and values as list
Where ID has those string which can be the possible input or maybe the part of input in the string and at the end we can access any random string from the list which is the value of that particular input style.
If you meant this then it's a rule-based AI which was used before Neural intents and the current AI
It's limitations are like using programming languages i.e. you cannot use normal human language or rephrase any specific sentence cause it's not able to understand the language itself.