AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Chatbot for my final project [Node.JS-MySQL]
 
 

Hello everyone, just wanted to talk to you about the chatbot i’m currently building (or trying to) for my final project. I really appreciate any comment, tip, or criticism cast on it, and if you think there’s an easy way to improve the project, feel free to say it ^.^


So far i’ve got a working “Hello world” bot built in NodeJS, and i’m working on the program’s logic. The chatbot is supposed to work the following way, with an strong focus on self-learning. This is, thus, a “learning” phase without any real marketing feature (i don’t intend to sell it, and the contents are readily available, just pm me if you want the files i’m working on, all made by me):


1.User types

2.Chatbot looks for an answer on its database for that particular phrase

3.1: If it has a recorded answer, tries it
3.2: If it doesn’t, it looks for a similar text (i need to look into some sort of word-difference algorithm) and returns an answer for that similar text.
3.3: If it doesn’t have anything similar, it prompts the user to teach her what’d be a good answer.

4: It asks the user if the answer is accurate. It then stores the phrase, the answer and a punctuation (+1, -1) into the database. In the 3.1 case, it adds the value to the answer. In 3.2 and 3.3 cases, an “insert” query puts a new row into the database.

5: The bot then talks to the user, using one of the phrases she has learned (Say, if you got 100 rows, she’ll pick one at random and throw it at the user).

6: After the user types something in return, since that’s a very human response (It’s a REAL HUMAN! response), it’ll store it in the database with a good score.

7: Repeat.

___

This is obviously very basic. There’s little “AI” involved, and i’d like the bot to have some knowledge of any previous interaction with the user, but my knowledge is pretty limited.

The entirety of the project is to be coded in Node and the database to be used will be MySQL.

Due to the deadline being quite soon (1 month and a half), and my availability is very limited (i’m horribly busy) i firstly have to focus on it being slightly different than a HelloWorldParrot.


What do you guys think about this? Any ideas?


Thank You for your time, I’ll be watching over this thread everyday for your answers ^^

 

 
  [ # 1 ]

Other Chatbot systems include one or more of the following:
1. Spellcheck input first
2. Apply a Substitution file.  + becomes the word “plus”, - becomes the word “minus”, “don’t” becomes “do not”,no etc.
3. Apply Normalizations: sing, sang, sung, did sing, does sing, will sing, has sung, had sung, will have sung all become “sing” so you store one version of the normalized sentence in the database instead of all combinations.
4. Add some built in functions for date and time.  What day is it?  What time is it?  You cannot store the users answers to these questions literally as they change depending on the date and time.
5. Add Set or Map functionality so that for instance you have a set of “Presidents” and anytime a sentence has one of the presidents in it then say the stored answer “I don’t want to talk about presidents.  That is boring.” Basically this adds classes or generalizations to your AI.
6. Evaluate the users input as being a question or a statement.  If a question you know a response is needed.  if a statement then maybe the user it saying a fact to remember. In your database you could flag your stored questions with a questions type: What? Why? Who? When? Where? How? How Much? How Many?  You can narrow your search in the database by first determining what question word was used and then pick a best match from the subset of records of that type.
7. Topic system.  You could store a topic with each record and during conversation you set the current topic to the last response topic.  You then first search for results of the same topic before searching for all topics if nothing is found initially.  You could ask the user the following question when learning new answers “What topic would you say this answer relates to?” and then store the topic word with the answer.

Have fun.

 

 

 
  [ # 2 ]

Hi sergi
Were you able to query db based on the response??

Could you share code or process you followed to connect with database

 

 
  login or register to react