#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    How to structure a database for chatbot?


    We are making a project name 127chatbot. Optimistically we are trying to make some thing like ALICE.
    Alice is developed in xml extensions that is AIML, artificial intelligence markup language. However we are trying to model the chat bot system using database.
    For now we have a problem with database handling and modeling the structure.
    Lets say we make a table which stores keywords and resposes. Lets say user say "hi" that is a keyword and it will be searched in database for keywords and corresponding response that might be "hiya" is displayed to user. This is the most simple thing we can do.
    Lets say if we want to model a structure which use m to m relationship between keywords and responses, how we should do that?
    for example a list of similar keywords can have simialar responses like
    "hi" "hello" "hey" can have any of "hi, how r u?" "hey, nice to meet you" .here we have 3 similar keywords and 2 responses to each keyword. response will be picked randomly for now. I want to ask how to model this structure in relation database.

    if i couldnt convey the message well, Kindly ask for further explanation. Your help will be duely appreciated.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,212
    Rep Power
    4279
    Originally Posted by wassay7
    Lets say if we want to model a structure which use m to m relationship between keywords and responses, how we should do that?
    with a many-to-many relationship table

    keywords
    32 hi
    33 hello
    34 hey

    responses
    1009 hi, how r u
    1037 hey, nice to meet you

    keyword_responses
    32 1009
    32 1039
    33 1009
    33 1039
    34 1009
    34 1039
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo