With artificial intelligence chatbot (automatic learning type), you can teach the robot knowledge and then ask questions about the taught knowledge or the knowledge she already knows.
There is too little knowledge in the current knowledge base. Please follow the instructions for use, teach first and ask later. Do not ask directly.
No libraries or library functions are called, and it is written from the bottom to the top.
The robot writes its own program to answer questions: in the stored procedure AnswerSingle (single sentence question and answer), dynamic SQL is used to assemble different program fragments into programs according to different situations and then execute them. In the variable think, you can see what program the robot has written for itself.
Beautiful animated interactive interface with multiple modes to choose from.
5.0, fixes security vulnerabilities.
It was not safe before. Users could directly view and download the configuration file in ini format through the website address, and the configuration file contained the account password.
Now that the configuration file has been written in pure PHP, the PHP program of the configuration file cannot be viewed through the URL (the account password cannot be seen). Even if the configuration file is downloaded, the PHP program is not displayed (the account and password are not displayed), only the HTML tag is displayed, so this is safe.
After I downloaded the config.php file from my website hojer.cn, the PHP program content (no account and password) is no longer displayed in it, only the html tag is displayed.
【Installation method】
Running requires mysql database and php running environment (such as AppServ).
Create a new database, import snow.sql into the database, set the character set to utf8, and set the sorting rule to utf8_general_ci
Change the config configuration file to your information and you can run it.
[Question and answer method]
When asking about the performer of an action (subject) or the object of the action (object), use: who, what, what
Teach: Cat eats rat, ask: What does cat eat, answer: rat
Question: What eats rats? Answer: Cats.
Teaching: The cat gave the mouse an apple. Question: What did the cat give the mouse? Answer: Apple
Teach: The cat makes the mouse dance. Ask: Who does the cat make dance? Answer: The mouse
Question action (predicate verb) uses: how
Teach: cat eats mouse, ask: cat eats mouse, answer: eat
When asking about behavior (actions and action objects), use: what to do, what to do
The behavior of asking the subject: teach: cat eats mouse, ask: what does cat do, answer: eat mouse
The act of asking the object: teach: the cat makes the mouse dance, ask: what does the cat ask the mouse to do, answer: dance
When asking about the identity, nature, and status (predicative) of the subject: what is it?
Teach: Cat is an animal. Ask: What is a cat? Answer: Animal
Use adjectives when asking questions: what kind
Teaching: Cats eat black mice. Question: What kind of mice do cats eat? Answer: Black ones.
Use number words when asking questions: how many, how many
Teaching: A cat eats two rats. Question: How many rats does a cat eat? Answer: 2
When asking about belonging (noun possessive) use: whose, what
Teaching: Azhe’s cat eats mice. Question: Whose cat eats mice? Answer: Azhe
When asking questions (adverb), use: what?
Teaching: Cats often eat mice. Question: How come cats eat mice? Answer: Often
Use question time: when, what time
Teaching: Yesterday the cat ate the mouse. Question: When did the cat eat the mouse? Answer: (Show yesterday’s year, month and day)
When asking about location, use: where, what place
Teaching: The cat eats the mouse in the garden. Ask: Where does the cat eat the mouse? Answer: The garden
"?" words
Teaching: Cat bites mouse. Question: Does cat bite mouse? Answer: Yes
Question: Do cats bite snakes? Answer: Never heard of it
Known sentences (sentences that have been taught before, teach them again)
Teaching: Cat bites mouse
Answer: I know this
Cause-result connectives: so, because
Teaching: The cat is hungry, so the cat eats the mouse
Or teach: Because the cat is hungry, the cat eats the mouse
Or teach: The cat eats the mouse because the cat is hungry.
Asking questions about cause and effect: why, so, what is the result?
Question: Why do cats eat mice? Answer: Because the cat is hungry
Question: The cat is hungry, so what? Answer: Cat eats mouse
Sequence connectives: then, then
Teach: Cats eat, then sleep
Question order: what next, what to do next, what to do before
Question: Cat eats, what happens next. Answer: sleep
Connecting words of purpose: for, purpose is
Teach: Cats eat to survive
Or teach: Cats eat to survive
Questioning purpose: for what, what is the purpose
Question: Why do cats eat? Answer: Survival
Precondition connective: if
Teach: If a cat is thirsty, the cat drinks water
Asking preconditions: what are the conditions and what are the premises?
Question: What are the conditions for cats to drink water? Answer: The cat is thirsty
【Abstract thinking】
It is impossible for me to teach the robot all the specific knowledge. As long as I teach abstract knowledge, it means teaching a lot of specific knowledge.
The first step is to teach abstract knowledge, the second step is to clarify the relationship of belonging: using "belongs" or "is", and the third step is to ask questions.
If you have been taught specific knowledge, give priority to answering based on specific knowledge. If there is no concrete knowledge, only start thinking abstractly to answer.
Single sentence abstract questions and answers
(1) Abstract answer
For example: wolves have not been taught to eat sheep, but animals have been taught to eat meat, and wolves have been taught to be animals. So if you ask what wolves eat, although it cannot answer sheep, after the computer abstracts "what do wolves eat" into "what animals eat", it will answer meat.
(2) Answers from abstract to concrete
For example: teach: mammals to eat fish. Teaching: Bears belong to mammals, and carps belong to fish. Question: What do bears eat? Answer: Carp. Instead of answering fish, it is from abstract to concrete.
Two-sentence abstract question and answer
(1) Answers to related sentences
For example, teach: People eat animals, so animals are afraid of people.
Re-teach: I belong to humans, cows belong to animals
Question: I eat cows
The computer abstracts "I eat cows" into "people eat animals" (full abstraction), "people eat cows" (subject abstraction), and "I eat animals" (object abstraction)
Among them, the knowledge "people eat animals" has been taught before, so I can answer it.
Answer: Cows are afraid of you
Note: Connectives must be written in the relationship between the two sentences (such as so, then), and you cannot write "people eat animals, and animals are afraid of people" ("so" cannot be omitted)
Another example is teaching: Teachers love their students, so students respect their teachers.
Reteach: Zhang San is the teacher and Li Si is the student
Question: Zhang San loves Li Si
Answer: Li Si respects Zhang San
The subject is concrete, the object is abstract
Teaching: I love animals, so I raise them
Teaching: Cats are animals
Q: I love cats
Computer abstracts the sentence into "I love animals"
Answer: You raise cats
The subject is abstract, the object is concrete
Teaching: Animals need to eat, so animals look for food
Teaching: Cats are animals
Question: The cat wants to eat
The computer abstracts the sentence into "animals want to eat"
Answer: Cat looking for food
(2) Sentence A and B
For example, teach: A kicks B, so B hits A
Question: Zhang San kicked Li Si
Answer: Li Si beat Zhang San